summaryrefslogtreecommitdiff
path: root/lib/ccan
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-12-15 15:34:55 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-12-15 15:34:55 +1030
commitfef4f5193b68598c99949ee2fbd9bee93daf70b1 (patch)
tree7e2a27e0e286e3dd07f32e1f489ac7ae91e719a8 /lib/ccan
parentfdcbb7e03b3d7edf22d41bc3e08e1b8d58e2860c (diff)
downloadsamba-fef4f5193b68598c99949ee2fbd9bee93daf70b1.tar.gz
samba-fef4f5193b68598c99949ee2fbd9bee93daf70b1.tar.bz2
samba-fef4f5193b68598c99949ee2fbd9bee93daf70b1.zip
lib/ccan: fix m4 tests for builtin_expect and compound literals.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ccan')
-rw-r--r--lib/ccan/libccan.m419
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/ccan/libccan.m4 b/lib/ccan/libccan.m4
index 7dbea5815c..ce71ea2dda 100644
--- a/lib/ccan/libccan.m4
+++ b/lib/ccan/libccan.m4
@@ -196,7 +196,7 @@ AC_CACHE_CHECK([whether we have __builtin_expect],
[
AC_LINK_IFELSE(
[int main(void) {
- return __builtin_expect(main != 0) ? 0 : 1;
+ return __builtin_expect(main != 0, 1) ? 0 : 1;
}],
samba_cv_builtin_expect=yes)
])
@@ -251,20 +251,21 @@ if test x"$samba_cv_builtin_choose_expr" = xyes ; then
[whether we have __builtin_choose_expr])
fi
-AC_CACHE_CHECK([whether we have __builtin_compound_literals],
- samba_cv_builtin_compound_literals,
+# We use @<:@ and @:>@ here for embedded [ and ].
+AC_CACHE_CHECK([whether we have compound literals],
+ samba_cv_compound_literals,
[
AC_COMPILE_IFELSE(
[int main(void) {
- int *foo = (int[]) { 1, 2, 3, 4 };
- return foo[0] == 1 ? 0 : 1;
+ int *foo = (int@<:@@:>@) { 1, 2, 3, 4 };
+ return foo@<:@0@:>@ == 1 ? 0 : 1;
}],
- samba_cv_builtin_compound_literals=yes)
+ samba_cv_compound_literals=yes)
])
-if test x"$samba_cv_builtin_compound_literals" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_COMPOUND_LITERALS, 1,
- [whether we have __builtin_compound_literals])
+if test x"$samba_cv_compound_literals" = xyes ; then
+ AC_DEFINE(HAVE_COMPOUND_LITERALS, 1,
+ [whether we have compound literals])
fi
AC_CACHE_CHECK([whether we have __builtin_have_isblank],