summaryrefslogtreecommitdiff
path: root/lib/ccan/wscript
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:05:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:05:13 +0930
commitabb437c0abedc6646927381017666db3f962befd (patch)
tree9a2bafc03384af589281a0f09aca93752ceb3c3b /lib/ccan/wscript
parenta26fe036fee538c16a9e1b5e2369270260aec189 (diff)
downloadsamba-abb437c0abedc6646927381017666db3f962befd.tar.gz
samba-abb437c0abedc6646927381017666db3f962befd.tar.bz2
samba-abb437c0abedc6646927381017666db3f962befd.zip
ccan: configure check for HAVE_BUILTIN_CHOOSE_EXPR
We weren't testing for this, and without it, typesafe_cb just casts its function argument. This is why I didn't get a warning when one of my patches amended a function incorrectly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ccan/wscript')
-rw-r--r--lib/ccan/wscript3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ccan/wscript b/lib/ccan/wscript
index 0543a4de07..9daf091e5b 100644
--- a/lib/ccan/wscript
+++ b/lib/ccan/wscript
@@ -79,6 +79,9 @@ def configure(conf):
Logs.error("Failed endian determination. The PDP-11 is back?")
sys.exit(1)
+ conf.CHECK_CODE('return __builtin_choose_expr(1, 0, "garbage");',
+ link=True,
+ define='HAVE_BUILTIN_CHOOSE_EXPR')
conf.CHECK_CODE('return __builtin_clz(1) == (sizeof(int)*8 - 1) ? 0 : 1;',
link=True,
define='HAVE_BUILTIN_CLZ')