X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fconfigurator%2Fconfigurator.c;h=a8c5c8d49bf98ab6d159a0cf6d1c82dd47c9e5a6;hp=7b3403a9d96d50ca43b25abcc0143808f95e1cab;hb=53de95c6adcb8951bef8a28dc8e0cb44de29d059;hpb=5bfb3995da36408ded842c36052a5eadd602c431 diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index 7b3403a9..a8c5c8d4 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -1,5 +1,26 @@ /* Simple tool to create config.h. - * Would be much easier with ccan modules, but deliberately standalone. */ + * Would be much easier with ccan modules, but deliberately standalone. + * + * Copyright 2011 Rusty Russell . MIT license. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include #include #include @@ -68,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 \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"