]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge from gnulib
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Mar 2017 20:07:03 +0000 (13:07 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Mar 2017 20:09:31 +0000 (13:09 -0700)
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
lib/gnulib.mk.in
lib/limits.in.h
lib/stat-time.h
lib/stdalign.in.h
lib/stdint.in.h
lib/timespec.h
m4/flexmember.m4
m4/gnulib-comp.m4
m4/stdalign.m4

index 145dd1400934b99dbf412c2b6597e37c78b0ffdd..e415887a4d81bec1904b6de21df295dcacd5ecf9 100644 (file)
@@ -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.
index badfe3207b769e1c6d4c93217384e01526d28ac3..2c0b689e71088ad3fa36349d074fb1a3d6436e31 100644 (file)
@@ -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.
 
index a7e307f5c664241fb549806baacde2ea4ebeb9c8..08d3c328c4aafc473bdef584f9d1ded3ce535440 100644 (file)
 #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
index 9402b3fc1c05325bf2eab999daf4ba5f54ae5cb3..47469892ee2728778b12bed6cdcee2c055d696ea 100644 (file)
@@ -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
index 5f56eeefd3f427f91fe1b93f54e9f58773f585d2..ea248231701a43f35d1fb620c7bc1ac51e04db49 100644 (file)
 # 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
index d899c1e034e28096555f533b7b0a391f05cea477..5fbec34310fced9cd58e88c4196f65af26e589d4 100644 (file)
    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@, 0@PTRDIFF_T_SUFFIX@)
+    _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
 #  define PTRDIFF_MAX  \
     _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
 # 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@, \
-                0@SIG_ATOMIC_T_SUFFIX@)
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# else
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# endif
 # define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 0@SIG_ATOMIC_T_SUFFIX@)
@@ -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@, 0@WCHAR_T_SUFFIX@)
+# if @HAVE_SIGNED_WCHAR_T@
+#  define WCHAR_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# else
+#  define WCHAR_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# endif
 # define WCHAR_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
 
 /* wint_t limits */
 # undef WINT_MIN
 # undef WINT_MAX
-# define WINT_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# if @HAVE_SIGNED_WINT_T@
+#  define WINT_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# else
+#  define WINT_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# endif
 # define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
 
index a5eca797ce3b5eda275594605022c7485fee4c48..f5d823aefe916649a16d741d7873028b4047b81a 100644 (file)
@@ -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
index 35580ac27c4c36ca17c3c9ea0054fef978be8612..9d3b50d15752aaaaf5b0d75d707fbeed9239b527 100644 (file)
@@ -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],
index bf7afa51bf63e4b706af6921343e4d1dd1f422f6..e613490f1a4143dd95c47204265ce376a9e3ab99 100644 (file)
@@ -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
 ])
index 3a1265824e521171e62bf9fb2ab71aa23b451da6..0652a1e4af5deca541072288007033ceb3626767 100644 (file)
@@ -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