From: Paul Eggert Date: Thu, 25 Aug 2016 03:48:32 +0000 (-0700) Subject: intprops: port to OpenVMS X-Git-Tag: v1.0~6675 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a073adb9e928352d0b1433cc67bdb0b3d026081e;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index e842a3340c..7cfd2444a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2016-08-24 Paul Eggert + + 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 parse-datetime: improve debug implementation diff --git a/doc/posix-headers/limits.texi b/doc/posix-headers/limits.texi index 9f4ffa5823..31207ac807 100644 --- a/doc/posix-headers/limits.texi +++ b/doc/posix-headers/limits.texi @@ -18,7 +18,7 @@ Portability problems not fixed by Gnulib: @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. diff --git a/lib/intprops.h b/lib/intprops.h index feb02c3c60..fe6c789825 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -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.