*** empty log message ***
[gnulib.git] / m4 / size_max.m4
index eeb2f9b..0336f3a 100644 (file)
@@ -1,16 +1,14 @@
-# size_max.m4 serial 1
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# size_max.m4 serial 3
+dnl Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
 AC_DEFUN([gl_SIZE_MAX],
 [
-  AC_CHECK_HEADERS_ONCE(stdint.h)
+  AC_CHECK_HEADERS(stdint.h)
   dnl First test whether the system already has SIZE_MAX.
   AC_MSG_CHECKING([for SIZE_MAX])
   result=
@@ -28,9 +26,9 @@ Found it
     dnl than the type 'unsigned long'.
     dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
     dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
-    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
+    _AC_COMPUTE_INT([(size_t)~(size_t)0 / 10], res_hi,
       [#include <stddef.h>], result=?)
-    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
+    _AC_COMPUTE_INT([(size_t)~(size_t)0 % 10], res_lo,
       [#include <stddef.h>], result=?)
     _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
       [#include <stddef.h>], result=?)
@@ -50,7 +48,7 @@ Found it
       fi
     else
       dnl Shouldn't happen, but who knows...
-      result='~(size_t)0'
+      result='((size_t)~(size_t)0)'
     fi
   fi
   AC_MSG_RESULT([$result])