From c171818b275b9dbd6a1f1cf1666e9e72237f75e6 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 8 Oct 2015 13:01:36 -0400 Subject: Add BSWAP64 macro. This is like BSWAP32, but for 64-bit values. Since we've got two of them now and they have use cases (like sortsupport) beyond CRCs, move the definitions to their own header file. Peter Geoghegan --- config/c-compiler.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'config/c-compiler.m4') diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 9feec0c1086..550d03474c6 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -214,6 +214,24 @@ fi])# PGAC_C_BUILTIN_BSWAP32 +# PGAC_C_BUILTIN_BSWAP64 +# ------------------------- +# Check if the C compiler understands __builtin_bswap64(), +# and define HAVE__BUILTIN_BSWAP64 if so. +AC_DEFUN([PGAC_C_BUILTIN_BSWAP64], +[AC_CACHE_CHECK(for __builtin_bswap64, pgac_cv__builtin_bswap64, +[AC_COMPILE_IFELSE([AC_LANG_SOURCE( +[static unsigned long int x = __builtin_bswap64(0xaabbccddeeff0011);] +)], +[pgac_cv__builtin_bswap64=yes], +[pgac_cv__builtin_bswap64=no])]) +if test x"$pgac_cv__builtin_bswap64" = xyes ; then +AC_DEFINE(HAVE__BUILTIN_BSWAP64, 1, + [Define to 1 if your compiler understands __builtin_bswap64.]) +fi])# PGAC_C_BUILTIN_BSWAP64 + + + # PGAC_C_BUILTIN_CONSTANT_P # ------------------------- # Check if the C compiler understands __builtin_constant_p(), -- cgit v1.2.3