diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:05:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:05:13 +0930 |
commit | abb437c0abedc6646927381017666db3f962befd (patch) | |
tree | 9a2bafc03384af589281a0f09aca93752ceb3c3b /lib/ccan/libccan.m4 | |
parent | a26fe036fee538c16a9e1b5e2369270260aec189 (diff) | |
download | samba-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/libccan.m4')
-rw-r--r-- | lib/ccan/libccan.m4 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/ccan/libccan.m4 b/lib/ccan/libccan.m4 index df38d3b962..7dbea5815c 100644 --- a/lib/ccan/libccan.m4 +++ b/lib/ccan/libccan.m4 @@ -236,6 +236,21 @@ if test x"$samba_cv_builtin_types_compatible_p" = xyes ; then [whether we have __builtin_types_compatible_p]) fi +AC_CACHE_CHECK([whether we have __builtin_choose_exptr], + samba_cv_builtin_choose_expr, + [ + AC_LINK_IFELSE( + [int main(void) { + return __builtin_choose_expr(1, 0, "garbage"); + }], + samba_cv_builtin_types_choose_expr=yes) + ]) + +if test x"$samba_cv_builtin_choose_expr" = xyes ; then + AC_DEFINE(HAVE_BUILTIN_CHOOSE_EXPR, 1, + [whether we have __builtin_choose_expr]) +fi + AC_CACHE_CHECK([whether we have __builtin_compound_literals], samba_cv_builtin_compound_literals, [ |