summaryrefslogtreecommitdiff
path: root/config/c-compiler.m4
diff options
context:
space:
mode:
authorPeter Eisentraut2003-01-28 21:57:12 +0000
committerPeter Eisentraut2003-01-28 21:57:12 +0000
commit955a1f81a702489102b2526e24631b9f51e14247 (patch)
tree0539ade1756c036ad8a64471cc01c27a9879b0a4 /config/c-compiler.m4
parentc0276244b1856537aa2a7c8abd0992c3492516fd (diff)
Factor out the code that detects the long long int snprintf format into a
separate macro. Also add support for %I64d which is the way on Windows. The code that checks for the 64-bit int type now gives more reasonable results when cross-compiling: In that case we just take the compiler's information and trust that the arithmetic works. Disabling int64 is too pessimistic.
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r--config/c-compiler.m410
1 files changed, 6 insertions, 4 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 5171e1e6d97..2f1d228623f 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -1,5 +1,5 @@
# Macros to detect C compiler features
-# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.5 2002/03/29 17:32:53 petere Exp $
+# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.6 2003/01/28 21:57:12 petere Exp $
# PGAC_C_SIGNED
@@ -54,9 +54,11 @@ main() {
}],
[Ac_cachevar=yes],
[Ac_cachevar=no],
-[Ac_cachevar=no
-dnl We will do better here with Autoconf 2.50
-AC_MSG_WARN([64 bit arithmetic disabled when cross-compiling])])])
+[# If cross-compiling, check the size reported by the compiler and
+# trust that the arithmetic works.
+AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [sizeof($1) == 8])],
+ Ac_cachevar=yes,
+ Ac_cachevar=no)])])
Ac_define=$Ac_cachevar
if test x"$Ac_cachevar" = xyes ; then