Commit 98b8ada2 authored by Rusty Russell's avatar Rusty Russell

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.
parent c438ec17
......@@ -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
......
......@@ -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 <ccan/..." works, eg. for tdb2.h */
printf("#define HAVE_CCAN 1\n");
for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)
printf("#define %s %u\n", tests[i].name, tests[i].answer);
printf("#endif /* CCAN_CONFIG_H */\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment