]> git.ozlabs.org Git - ccan/commitdiff
tools: don't unnecessarily redefine _GNU_SOURCE in config.h
authorDouglas Bagnall <douglas@paradise.net.nz>
Wed, 20 Apr 2011 14:50:23 +0000 (02:50 +1200)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 28 Apr 2011 04:26:08 +0000 (13:56 +0930)
Makes it easier to reuse this code in other projects.

config.h
tools/configurator/configurator.c

index dbfe0295fdf4c32c49ae672108c2905a0af373ce..4e6ba3a7502774c2dbcd50c27eb6323e73a55d7b 100644 (file)
--- a/config.h
+++ b/config.h
@@ -1,7 +1,9 @@
 /* Generated by CCAN configurator */
 #ifndef CCAN_CONFIG_H
 #define CCAN_CONFIG_H
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE /* Always use GNU extensions. */
+#endif
 #define CCAN_COMPILER "cc"
 #define CCAN_CFLAGS "-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -DCCAN_STR_DEBUG=1"
 
index b78b112f4a9f0b523de52a4b212bc12b17fa9fad..7b3403a9d96d50ca43b25abcc0143808f95e1cab 100644 (file)
@@ -394,7 +394,9 @@ int main(int argc, const char *argv[])
        printf("/* Generated by CCAN configurator */\n"
               "#ifndef CCAN_CONFIG_H\n"
               "#define CCAN_CONFIG_H\n");
+       printf("#ifndef _GNU_SOURCE\n");
        printf("#define _GNU_SOURCE /* Always use GNU extensions. */\n");
+       printf("#endif\n");
        printf("#define CCAN_COMPILER \"%s\"\n", argv[1]);
        printf("#define CCAN_CFLAGS \"%s\"\n\n", cmd + strlen(argv[1]) + 1);
        for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)