From: Rusty Russell Date: Tue, 14 Feb 2012 09:34:00 +0000 (+1030) Subject: configurator: define HAVE_CCAN. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=98b8ada203137a324f1712c042f7f6f3a5ef9ea0 configurator: define HAVE_CCAN. An interesting case came up with the tdb2 code in SAMBA recently. It's a public library, and it doesn't want to be dependent on CCAN, but the header uses cast and typesafe_cb for extra type safety. A good solution to this is to put dummy versions under !HAVE_CCAN. Of course, any CCAN config.h should define HAVE_CCAN. --- diff --git a/config.h b/config.h index 14788013..09b45824 100644 --- a/config.h +++ b/config.h @@ -7,6 +7,7 @@ #define CCAN_COMPILER "cc" #define CCAN_CFLAGS "-g3 -ggdb -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -DCCAN_STR_DEBUG=1" +#define HAVE_CCAN 1 #define HAVE_32BIT_OFF_T 1 #define HAVE_ALIGNOF 1 #define HAVE_ASPRINTF 1 diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index e2c13b7e..d5a23c2a 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -440,6 +440,8 @@ int main(int argc, const char *argv[]) printf("#endif\n"); printf("#define CCAN_COMPILER \"%s\"\n", argv[1]); printf("#define CCAN_CFLAGS \"%s\"\n\n", cmd + strlen(argv[1]) + 1); + /* This one implies "#include