ccan: fix HAVE_BSWAP_64 for autoconf.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 2 Apr 2013 06:30:01 +0000 (17:00 +1030)
committerJeremy Allison <jra@samba.org>
Wed, 3 Apr 2013 20:10:13 +0000 (22:10 +0200)
Autoconf defines HAVE_BSWAP_64_DECL, we want HAVE_BSWAP_64.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/ccan/libccan.m4

index 7b27c69b81750c6e8b70f3e8b6eb58cbc62d3139..cda1353de6e9c59cf6f08915521ce0b8880e1a4a 100644 (file)
@@ -346,4 +346,18 @@ if test x"$samba_cv_warn_unused_result" = xyes ; then
    AC_DEFINE(HAVE_WARN_UNUSED_RESULT, 1,
             [whether we have __attribute__((warn_unused_result))])
 fi
-AC_HAVE_DECL(bswap_64, [#include <byteswap.h>])
+
+AC_CACHE_CHECK([whether we have bswap_64],
+              samba_cv_have_bswap_64,
+              [
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
+                       [#include <byteswap.h>
+                        int main(void) { return bswap_64(1) ? 0 : 1; }
+                       ])],
+                       samba_cv_have_bswap_64=yes)
+               ])
+
+if test x"$samba_cv_have_bswap_64" = xyes ; then
+   AC_DEFINE(HAVE_BSWAP_64, 1,
+            [whether we have bswap_64])
+fi