]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/types.m4 (AC_TYPE_LONG_LONG_INT):
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Jul 2006 07:35:29 +0000 (07:35 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Jul 2006 07:35:29 +0000 (07:35 +0000)
Require that long long int be at least 64 bits wide.
(AC_TYPE_UNSIGNED_LONG_LONG_INT): Likewise.

ChangeLog
lib/autoconf/types.m4

index cdb0895a4df3d9034a115ed03b98dc9453e7931e..b54d20ccc399ca9b36aee9ecb77ec06d64b20d3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/autoconf/types.m4 (AC_TYPE_LONG_LONG_INT):
+       Require that long long int be at least 64 bits wide.  C99 requires
+       this and enough programs depend on it so we should check for it.
+       Bruno Haible reports in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00286.html>
+       that long long int is 32 bits wide with some nonstandard compilers.
+       (AC_TYPE_UNSIGNED_LONG_LONG_INT): Likewise.
+
 2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
 
        * tests/torture.at (Configuring subdirectories): Set CONFIG_SITE
index e91875d5a2560c41c2f994ac6e3156d3464ce7e3..560efa899f1384eeefa5753f3f0cef36960ad4b6 100644 (file)
@@ -472,9 +472,15 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
   AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
     [AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
-         [long long int ll = 1LL; int i = 63;],
-         [long long int llmax = (long long int) -1;
-          return ll << i | ll >> i | llmax / ll | llmax % ll;])],
+         [[long long int ll = 9223372036854775807ll;
+           long long int nll = -9223372036854775807LL;
+           typedef int a[((-9223372036854775807LL < 0
+                           && 0 < 9223372036854775807ll)
+                          ? 1 : -1)];
+           int i = 63;]],
+         [[long long int llmax = 9223372036854775807ll;
+           return (ll << 63 | ll >> 63 | ll < i | ll > i
+                   | llmax / ll | llmax % ll);]])],
        [ac_cv_type_long_long_int=yes],
        [ac_cv_type_long_long_int=no])])
   if test $ac_cv_type_long_long_int = yes; then
@@ -492,9 +498,13 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
     [ac_cv_type_unsigned_long_long_int],
     [AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
-         [unsigned long long int ull = 1ULL; int i = 63;],
-         [unsigned long long int ullmax = (unsigned long long int) -1;
-          return ull << i | ull >> i | ullmax / ull | ullmax % ull;])],
+         [[unsigned long long int ull = 18446744073709551615ULL;
+           typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
+                          ? 1 : -1)];
+          int i = 63;]],
+         [[unsigned long long int ullmax = 18446744073709551615ull;
+           return (ull << 63 | ull >> 63 | ull << i | ull >> i
+                   | ullmax / ull | ullmax % ull);]])],
        [ac_cv_type_unsigned_long_long_int=yes],
        [ac_cv_type_unsigned_long_long_int=no])])
   if test $ac_cv_type_unsigned_long_long_int = yes; then