summaryrefslogtreecommitdiff
path: root/config/c-compiler.m4
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-10-08 13:01:36 -0400
committerRobert Haas <rhaas@postgresql.org>2015-10-08 13:01:36 -0400
commitc171818b275b9dbd6a1f1cf1666e9e72237f75e6 (patch)
tree6c0edd56a407532f84bc53fddd15d87cb37f665d /config/c-compiler.m4
parent1e353198612586befd44fe5e87304d08ebfac552 (diff)
downloadpostgresql-c171818b275b9dbd6a1f1cf1666e9e72237f75e6.tar.gz
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
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r--config/c-compiler.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 9feec0c108..550d03474c 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(),