]> Savannah Git Hosting - gnulib.git/commitdiff
xstrtoll: Fix compilation failure.
authorBruno Haible <bruno@clisp.org>
Sat, 15 Oct 2011 15:06:24 +0000 (17:06 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 15 Oct 2011 15:06:24 +0000 (17:06 +0200)
* lib/xstrtol.c (ULLONG_MAX, LLONG_MAX, LLONG_MIN): New macros, taken
from lib/strtol.c.
* doc/posix-headers/limits.texi: Mention missing numerical limits on
some platforms.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.

ChangeLog
doc/posix-headers/limits.texi
lib/xstrtol.c

index ee724cd329db91e0718a479c0e25d33ed90e5173..28133a6c03b7929711f4c4fe28f182e9866f1dbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-10-15  Bruno Haible  <bruno@clisp.org>
+
+       xstrtoll: Fix compilation failure.
+       * lib/xstrtol.c (ULLONG_MAX, LLONG_MAX, LLONG_MIN): New macros, taken
+       from lib/strtol.c.
+       * doc/posix-headers/limits.texi: Mention missing numerical limits on
+       some platforms.
+       Reported by Tom G. Christensen <tgc@jupiterrise.com>.
+
 2011-10-15  Bruno Haible  <bruno@clisp.org>
 
        vasnprintf: Optimize bit search operation.
index bec8310ec04e7cb8c342dbd62d7edf986be99719..c7bc7ba72d969c7faad1b20d938269b07c1fbb8e 100644 (file)
@@ -7,13 +7,24 @@ Gnulib module: gethostname
 
 Portability problems fixed by Gnulib:
 @itemize
-@item The @code{HOST_NAME_MAX} macro is not defined on some platforms:
+@item
+The @code{HOST_NAME_MAX} macro is not defined on some platforms:
 MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11,
 IRIX 6.5, OSF/1 5.1, Solaris 11 2010-11, Cygwin 1.5.x, mingw, MSVC 9, Interix 3.5, BeOS.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+The macros @code{LLONG_MIN}, @code{LLONG_MAX}, @code{ULLONG_MAX} are not
+defined on some platforms:
+AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1 with gcc.
+@item
+The macros @code{WORD_BIT}, @code{LONG_BIT} are not defined on some platforms:
+glibc 2.11 without @code{-D_GNU_SOURCE}, Cygwin, mingw, MSVC 9.
+@item
+The macro @code{SSIZE_MAX} is not defined on some platforms:
+MSVC 9.
 @end itemize
 
 For @code{PATH_MAX}, Gnulib provides a module @code{pathmax} with a header
index 97ebd9078bd19e1250be74213ceba4483b73e487..b1fdd4938d55f16b2bfcda28d8eab177d4373b49 100644 (file)
 
 #include "intprops.h"
 
+/* xstrtoll.c and xstrtoull.c, which include this file, require that
+   ULLONG_MAX, LLONG_MAX, LLONG_MIN are defined, but <limits.h> does not
+   define them on all platforms.  */
+#ifndef ULLONG_MAX
+# define ULLONG_MAX TYPE_MAXIMUM (unsigned long long)
+#endif
+#ifndef LLONG_MAX
+# define LLONG_MAX TYPE_MAXIMUM (long long int)
+#endif
+#ifndef LLONG_MIN
+# define LLONG_MIN TYPE_MINIMUM (long long int)
+#endif
+
 static strtol_error
 bkm_scale (__strtol_t *x, int scale_factor)
 {