changeset 18383:b46efe11d7e1

intprops: port to OpenVMS Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300 * doc/posix-headers/limits.texi: Document the problem. * lib/intprops.h (LLONG_MAX, LLONG_MIN) [__INT64_MAX]: Define if not already defined.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 24 Aug 2016 20:48:32 -0700
parents 0e4c96966001
children 0a363216611b
files ChangeLog doc/posix-headers/limits.texi lib/intprops.h
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Aug 14 21:29:50 2016 -0400
+++ b/ChangeLog	Wed Aug 24 20:48:32 2016 -0700
@@ -1,3 +1,11 @@
+2016-08-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+	intprops: port to OpenVMS
+	Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300
+	* doc/posix-headers/limits.texi: Document the problem.
+	* lib/intprops.h (LLONG_MAX, LLONG_MIN) [__INT64_MAX]:
+	Define if not already defined.
+
 2016-08-19  Assaf Gordon  <assafgordon@gmail.com>
 
 	parse-datetime: improve debug implementation
--- a/doc/posix-headers/limits.texi	Sun Aug 14 21:29:50 2016 -0400
+++ b/doc/posix-headers/limits.texi	Wed Aug 24 20:48:32 2016 -0700
@@ -18,7 +18,7 @@
 @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.
+AIX 5.1, HP-UX 11, IRIX 6.5, OpenVMS, 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.
--- a/lib/intprops.h	Sun Aug 14 21:29:50 2016 -0400
+++ b/lib/intprops.h	Wed Aug 24 20:48:32 2016 -0700
@@ -67,6 +67,12 @@
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
   (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
 
+/* Work around OpenVMS incompatibility with C99.  */
+#if !defined LLONG_MAX && defined __INT64_MAX
+# define LLONG_MAX __INT64_MAX
+# define LLONG_MIN __INT64_MIN
+#endif
+
 /* This include file assumes that signed types are two's complement without
    padding bits; the above macros have undefined behavior otherwise.
    If this is a problem for you, please let us know how to fix it for your host.