summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-10-15 17:06:24 +0200
committerBruno Haible <bruno@clisp.org>2011-10-15 17:06:24 +0200
commit0a19a162755da4ef297bcacd62cf5243c76324ed (patch)
tree3ffcd285dc62a5b350de98cbcaad107dc1e4bd7d /lib
parent8f9c414718161f157f9970b3c97b977d0343093e (diff)
downloadgnulib-0a19a162755da4ef297bcacd62cf5243c76324ed.tar.gz
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>.
Diffstat (limited to 'lib')
-rw-r--r--lib/xstrtol.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/xstrtol.c b/lib/xstrtol.c
index 97ebd9078b..b1fdd4938d 100644
--- a/lib/xstrtol.c
+++ b/lib/xstrtol.c
@@ -43,6 +43,19 @@
#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)
{