]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(AC_SYS_LARGEFILE_TEST_INCLUDES): Don't reject
authorJim Meyering <meyering@lucent.com>
Fri, 9 Feb 2001 15:04:06 +0000 (15:04 +0000)
committerJim Meyering <meyering@lucent.com>
Fri, 9 Feb 2001 15:04:06 +0000 (15:04 +0000)
C++ compilers that are masquerading as C compilers, and that
incorrectly reject large integers.
From Paul Eggert.

acspecific.m4
lib/autoconf/specific.m4

index 9d4305c683d9b8b62efe1cbdfdf1f17e29f409e9..8c75c8c013d6240723e7a42b88b24499eb40c778 100644 (file)
@@ -356,7 +356,14 @@ with arguments. Remove this warning when you adjust your code.])])
 # -------------------------------
 m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
 [@%:@include <sys/types.h>
-int a[[(off_t) 9223372036854775807ULL == 9223372036854775807ULL ? 1 : -1]];[]dnl
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1]];[]dnl
 ])
 
 
index 9d4305c683d9b8b62efe1cbdfdf1f17e29f409e9..8c75c8c013d6240723e7a42b88b24499eb40c778 100644 (file)
@@ -356,7 +356,14 @@ with arguments. Remove this warning when you adjust your code.])])
 # -------------------------------
 m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
 [@%:@include <sys/types.h>
-int a[[(off_t) 9223372036854775807ULL == 9223372036854775807ULL ? 1 : -1]];[]dnl
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1]];[]dnl
 ])