Discussion:
limits.h test with HP-UX cc
(too old to reply)
Bruno Haible
2017-03-15 21:03:29 UTC
Permalink
Raw Message
Hi,

With cc on HP-UX 11.31, test-limits-h.c fails to compile, apparently
because LLONG_MIN, LLONG_MAX, ULLONG_MAX are not defined.
But /usr/include/limits.h defines LONG_LONG_MIN, LONG_LONG_MAX, ULONG_LONG_MAX.

So, here's the simple fix:


2017-03-14 Bruno Haible <***@clisp.org>

limits-h: Make it work with HP-UX cc.
* lib/limits.in.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define if not
defined.

diff --git a/lib/limits.in.h b/lib/limits.in.h
index 7ff33ab..1846704 100644
--- a/lib/limits.in.h
+++ b/lib/limits.in.h
@@ -28,6 +28,17 @@
#ifndef ***@GUARD_PREFIX@_LIMITS_H
#define ***@GUARD_PREFIX@_LIMITS_H

+/* For HP-UX 11.31. */
+#if defined LONG_LONG_MIN && !defined LLONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+#endif
+#if defined LONG_LONG_MAX && !defined LLONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+#endif
+#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
+# define ULLONG_MAX ULONG_LONG_MAX
+#endif
+
/* The number of usable bits in an unsigned or signed integer type
with minimum value MIN and maximum value MAX, as an int expression
suitable in #if. Cover all known practical hosts. This

Loading...