configurator: HAVE_BACKTRACE
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 29 Nov 2011 22:38:11 +0000 (09:08 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 29 Nov 2011 22:38:11 +0000 (09:08 +1030)
config.h
tools/configurator/configurator.c

index 4e6ba3a7502774c2dbcd50c27eb6323e73a55d7b..912730e33dbbab8cb2b9ed3c28d07e0623bd4728 100644 (file)
--- a/config.h
+++ b/config.h
@@ -17,6 +17,7 @@
 #define HAVE_ATTRIBUTE_PRINTF 1
 #define HAVE_ATTRIBUTE_UNUSED 1
 #define HAVE_ATTRIBUTE_USED 1
+#define HAVE_BACKTRACE 1
 #define HAVE_BIG_ENDIAN 0
 #define HAVE_BSWAP_64 1
 #define HAVE_BUILTIN_CHOOSE_EXPR 1
index d46a147ada14e3c8b16f53bb354be47a4491d229..a8c5c8d49bf98ab6d159a0cf6d1c82dd47c9e5a6 100644 (file)
@@ -89,6 +89,12 @@ static struct test tests[] = {
          "static int __attribute__((unused)) func(int x) { return x; }" },
        { "HAVE_ATTRIBUTE_USED", OUTSIDE_MAIN, NULL,
          "static int __attribute__((used)) func(int x) { return x; }" },
+       { "HAVE_BACKTRACE", DEFINES_FUNC, NULL,
+         "#include <execinfo.h>\n"
+         "static int func(int x) {"
+         "     void *bt[10];\n"
+         "     return backtrace(bt, 10) < x;\n"
+         "}" },
        { "HAVE_BIG_ENDIAN", INSIDE_MAIN|EXECUTE, NULL,
          "union { int i; char c[sizeof(int)]; } u;\n"
          "u.i = 0x01020304;\n"