emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master fa90c5e 2/2: Merge from gnulib


From: Paul Eggert
Subject: [Emacs-diffs] master fa90c5e 2/2: Merge from gnulib
Date: Sun, 19 Mar 2017 16:09:37 -0400 (EDT)

branch: master
commit fa90c5e86e2b11e89c6a1d709e25003a60656f0d
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from gnulib
    
    This gets Emacs working again with HP-UX Itanium cc.
    It incorporates:
    2017-03-19 stdalign: tweak version# and test for HP-UX IA64
    2017-03-18 stdalign: restore previous behavior for HP-UX IA64
    2017-03-17 stat-time, timespec: Support header files in C++ mode
    2017-03-17 stdalign: Make it work with HP-UX cc
    2017-03-17 flexmember: try to detect HP-UX 11.31 cc bug
    2017-03-16 stdint: Fix test compilation failure with HP-UX 11 cc.
    2017-03-14 gnulib-tool: don't produce tests with only snippets
    2017-03-14 limits-h: Make it work with HP-UX cc.
    * etc/PROBLEMS: Remove now-obsolete entry for HP-UX 11.31.
    * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
    * lib/limits.in.h, lib/stat-time.h, lib/stdalign.in.h:
    * lib/stdint.in.h, lib/timespec.h, m4/flexmember.m4, m4/stdalign.m4:
    Copy from gnulib.
---
 etc/PROBLEMS      |  7 -------
 lib/gnulib.mk.in  |  1 +
 lib/limits.in.h   | 11 +++++++++++
 lib/stat-time.h   |  8 ++++++++
 lib/stdalign.in.h |  2 +-
 lib/stdint.in.h   | 43 +++++++++++++++++++++++++++++++------------
 lib/timespec.h    |  8 ++++++++
 m4/flexmember.m4  |  7 +++++--
 m4/gnulib-comp.m4 |  7 -------
 m4/stdalign.m4    |  4 ++--
 10 files changed, 67 insertions(+), 31 deletions(-)

diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 145dd14..e415887 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1959,13 +1959,6 @@ EOF
 
 This is a bug in HPUX; HPUX patch PHKL_16260 is said to fix it.
 
-*** HP-UX 11.31 cc: Emacs does not build.
-
-HP-UX 11.31 cc has bugs in its implementation of flexible array
-members, a C99 feature that Emacs relies on.  To work around the
-problem, install GCC and use it to build Emacs.  For details, see:
-http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00066.html
-
 ** AIX
 
 *** AIX: Trouble using ptys.
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index badfe32..2c0b689 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -927,6 +927,7 @@ standardlisppath = @standardlisppath@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 version = @version@
+with_mailutils = @with_mailutils@
 x_default_search_path = @x_default_search_path@
 # End of GNU Make output.
 
diff --git a/lib/limits.in.h b/lib/limits.in.h
index a7e307f..08d3c32 100644
--- a/lib/limits.in.h
+++ b/lib/limits.in.h
@@ -28,6 +28,17 @@
 #ifndef address@hidden@_LIMITS_H
 #define address@hidden@_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
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 9402b3f..4746989 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -31,6 +31,10 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_STAT_TIME_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
    struct timespec, if available.  If not, then STAT_TIMESPEC_NS (ST,
    ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
@@ -194,6 +198,10 @@ get_stat_birthtime (struct stat const *st)
   return t;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index 5f56eee..ea24823 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -103,7 +103,7 @@
 # elif ((defined __APPLE__ && defined __MACH__                  \
          ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
          : __GNUC__)                                            \
-        || 061200 <= __HP_cc || 061200 <= __HP_aCC                \
+        || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
         || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index d899c1e..5fbec34 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -128,8 +128,13 @@
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
-# define _STDINT_MIN(signed, bits, zero) \
-    ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
+/* These are separate macros, because if you try to merge these macros into
+   a single one, HP-UX cc rejects the resulting expression in constant
+   expressions.  */
+# define _STDINT_UNSIGNED_MIN(bits, zero) \
+    (zero)
+# define _STDINT_SIGNED_MIN(bits, zero) \
+    (~ _STDINT_MAX (1, bits, zero))
 
 # define _STDINT_MAX(signed, bits, zero) \
     (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
@@ -512,15 +517,15 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 # undef PTRDIFF_MAX
 # if @APPLE_UNIVERSAL_BUILD@
 #  ifdef _LP64
-#   define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (64, 0l)
 #   define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
 #  else
-#   define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (32, 0)
 #   define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
 #  endif
 # else
 #  define PTRDIFF_MIN  \
-    _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
+    _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, address@hidden@)
 #  define PTRDIFF_MAX  \
     _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
 # endif
@@ -528,9 +533,13 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 /* sig_atomic_t limits */
 # undef SIG_ATOMIC_MIN
 # undef SIG_ATOMIC_MAX
-# define SIG_ATOMIC_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-                address@hidden@)
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, address@hidden@)
+# else
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, address@hidden@)
+# endif
 # define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 address@hidden@)
@@ -566,16 +575,26 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 # endif
 # undef WCHAR_MIN
 # undef WCHAR_MAX
-# define WCHAR_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
+# if @HAVE_SIGNED_WCHAR_T@
+#  define WCHAR_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, address@hidden@)
+# else
+#  define WCHAR_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, address@hidden@)
+# endif
 # define WCHAR_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
 
 /* wint_t limits */
 # undef WINT_MIN
 # undef WINT_MAX
-# define WINT_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
+# if @HAVE_SIGNED_WINT_T@
+#  define WINT_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, address@hidden@)
+# else
+#  define WINT_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, address@hidden@)
+# endif
 # define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
 
diff --git a/lib/timespec.h b/lib/timespec.h
index a5eca79..f5d823a 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -29,6 +29,10 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_TIMESPEC_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Resolution of timespec timestamps (in units per second), and log
    base 10 of the resolution.  */
 
@@ -107,6 +111,10 @@ timespectod (struct timespec a)
 void gettime (struct timespec *);
 int settime (struct timespec const *);
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index 35580ac..9d3b50d 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -1,4 +1,4 @@
-# serial 4
+# serial 5
 # Check for flexible array member support.
 
 # Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
@@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
           [[#include <stdlib.h>
             #include <stdio.h>
             #include <stddef.h>
-            struct s { int n; double d[]; };]],
+            struct m { struct m *next, **list; char name[]; };
+            struct s { struct s *p; struct m *m; int n; double d[]; };]],
           [[int m = getchar ();
             size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
             nbytes += sizeof (struct s) - 1;
             nbytes -= nbytes % sizeof (struct s);
             struct s *p = malloc (nbytes);
+            p->p = p;
+            p->m = NULL;
             p->d[0] = 0.0;
             return p->d != (double *) NULL;]])],
        [ac_cv_c_flexmember=yes],
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index bf7afa5..e613490 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -787,8 +787,6 @@ changequote([, ])dnl
   AC_SUBST([LIBGNU_LIBDEPS])
   LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
   AC_SUBST([LIBGNU_LTLIBDEPS])
-  LIBTESTS_LIBDEPS="$gltests_libdeps"
-  AC_SUBST([LIBTESTS_LIBDEPS])
 ])
 
 # Like AC_LIBOBJ, except that the module name goes
@@ -1106,9 +1104,4 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/warnings.m4
   m4/wchar_t.m4
   m4/wint_t.m4
-  tests=lib/_Noreturn.h
-  tests=lib/arg-nonnull.h
-  tests=lib/c++defs.h
-  tests=lib/dummy.c
-  tests=lib/warn-on-use.h
 ])
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index 3a12658..0652a1e 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -35,8 +35,8 @@ AC_DEFUN([gl_STDALIGN_H],
                  || (defined __APPLE__ && defined __MACH__ \
                      ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
                      : __GNUC__) \
-                 || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
-                 || __ICC || 0x5110 <= __SUNPRO_C \
+                 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+                 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
                  || 1300 <= _MSC_VER)
               struct alignas_test { char c; char alignas (8) alignas_8; };
               char test_alignas[offsetof (struct alignas_test, alignas_8) == 8



reply via email to

[Prev in Thread] Current Thread [Next in Thread]