Avoid redefinition warnings for SIZE_MAX.
authorBruno Haible <bruno@clisp.org>
Thu, 21 May 2009 13:15:09 +0000 (15:15 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 21 May 2009 13:15:09 +0000 (15:15 +0200)
ChangeLog
m4/size_max.m4

index 5744510..89a4882 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-05-21  Bruno Haible  <bruno@clisp.org>
 
+       Avoid redefinition warnings for SIZE_MAX.
+       * m4/size_max.m4 (gl_SIZE_MAX): Avoid redefining SIZE_MAX in config.h.
+       Reported by Simon Josefsson.
+
+2009-05-21  Bruno Haible  <bruno@clisp.org>
+
        * m4/size_max.m4 (gl_SIZE_MAX): Use AC_CACHE_CHECK instead of
        AC_CACHE_VAL.
 
index a18caad..35bd3d6 100644 (file)
@@ -1,4 +1,4 @@
-# size_max.m4 serial 8
+# size_max.m4 serial 9
 dnl Copyright (C) 2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,6 +57,15 @@ Found it
     AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
       [Define as the maximum value of type 'size_t', if the system doesn't define it.])
   fi
+  dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
+  dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
+  dnl #define by AC_DEFINE_UNQUOTED.
+  AH_VERBATIM([SIZE_MAX],
+[/* Define as the maximum value of type 'size_t', if the system doesn't define
+   it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif])
 ])
 
 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.