aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-03-19 13:07:03 -0700
committerPaul Eggert2017-03-19 13:09:31 -0700
commitfa90c5e86e2b11e89c6a1d709e25003a60656f0d (patch)
tree278612addfeefebe9318afd6d052f54accacb108
parent20ccaa63dbf20c0a64e0df360800ee61423252b7 (diff)
downloademacs-fa90c5e86e2b11e89c6a1d709e25003a60656f0d.tar.gz
emacs-fa90c5e86e2b11e89c6a1d709e25003a60656f0d.zip
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.
-rw-r--r--etc/PROBLEMS7
-rw-r--r--lib/gnulib.mk.in1
-rw-r--r--lib/limits.in.h11
-rw-r--r--lib/stat-time.h8
-rw-r--r--lib/stdalign.in.h2
-rw-r--r--lib/stdint.in.h43
-rw-r--r--lib/timespec.h8
-rw-r--r--m4/flexmember.m47
-rw-r--r--m4/gnulib-comp.m47
-rw-r--r--m4/stdalign.m44
10 files changed, 67 insertions, 31 deletions
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 145dd140093..e415887a4d8 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1959,13 +1959,6 @@ EOF
1959 1959
1960This is a bug in HPUX; HPUX patch PHKL_16260 is said to fix it. 1960This is a bug in HPUX; HPUX patch PHKL_16260 is said to fix it.
1961 1961
1962*** HP-UX 11.31 cc: Emacs does not build.
1963
1964HP-UX 11.31 cc has bugs in its implementation of flexible array
1965members, a C99 feature that Emacs relies on. To work around the
1966problem, install GCC and use it to build Emacs. For details, see:
1967http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00066.html
1968
1969** AIX 1962** AIX
1970 1963
1971*** AIX: Trouble using ptys. 1964*** AIX: Trouble using ptys.
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index badfe3207b7..2c0b689e710 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -927,6 +927,7 @@ standardlisppath = @standardlisppath@
927sysconfdir = @sysconfdir@ 927sysconfdir = @sysconfdir@
928target_alias = @target_alias@ 928target_alias = @target_alias@
929version = @version@ 929version = @version@
930with_mailutils = @with_mailutils@
930x_default_search_path = @x_default_search_path@ 931x_default_search_path = @x_default_search_path@
931# End of GNU Make output. 932# End of GNU Make output.
932 933
diff --git a/lib/limits.in.h b/lib/limits.in.h
index a7e307f5c66..08d3c328c4a 100644
--- a/lib/limits.in.h
+++ b/lib/limits.in.h
@@ -28,6 +28,17 @@
28#ifndef _@GUARD_PREFIX@_LIMITS_H 28#ifndef _@GUARD_PREFIX@_LIMITS_H
29#define _@GUARD_PREFIX@_LIMITS_H 29#define _@GUARD_PREFIX@_LIMITS_H
30 30
31/* For HP-UX 11.31. */
32#if defined LONG_LONG_MIN && !defined LLONG_MIN
33# define LLONG_MIN LONG_LONG_MIN
34#endif
35#if defined LONG_LONG_MAX && !defined LLONG_MAX
36# define LLONG_MAX LONG_LONG_MAX
37#endif
38#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
39# define ULLONG_MAX ULONG_LONG_MAX
40#endif
41
31/* The number of usable bits in an unsigned or signed integer type 42/* The number of usable bits in an unsigned or signed integer type
32 with minimum value MIN and maximum value MAX, as an int expression 43 with minimum value MIN and maximum value MAX, as an int expression
33 suitable in #if. Cover all known practical hosts. This 44 suitable in #if. Cover all known practical hosts. This
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 9402b3fc1c0..47469892ee2 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -31,6 +31,10 @@ _GL_INLINE_HEADER_BEGIN
31# define _GL_STAT_TIME_INLINE _GL_INLINE 31# define _GL_STAT_TIME_INLINE _GL_INLINE
32#endif 32#endif
33 33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
34/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type 38/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
35 struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, 39 struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
36 ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, 40 ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
@@ -194,6 +198,10 @@ get_stat_birthtime (struct stat const *st)
194 return t; 198 return t;
195} 199}
196 200
201#ifdef __cplusplus
202}
203#endif
204
197_GL_INLINE_HEADER_END 205_GL_INLINE_HEADER_END
198 206
199#endif 207#endif
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index 5f56eeefd3f..ea248231701 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -103,7 +103,7 @@
103# elif ((defined __APPLE__ && defined __MACH__ \ 103# elif ((defined __APPLE__ && defined __MACH__ \
104 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ 104 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
105 : __GNUC__) \ 105 : __GNUC__) \
106 || 061200 <= __HP_cc || 061200 <= __HP_aCC \ 106 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
107 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) 107 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
108# define _Alignas(a) __attribute__ ((__aligned__ (a))) 108# define _Alignas(a) __attribute__ ((__aligned__ (a)))
109# elif 1300 <= _MSC_VER 109# elif 1300 <= _MSC_VER
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index d899c1e034e..5fbec34310f 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -128,8 +128,13 @@
128 Return an unspecified value if BITS == 0, adding a check to pacify 128 Return an unspecified value if BITS == 0, adding a check to pacify
129 picky compilers. */ 129 picky compilers. */
130 130
131# define _STDINT_MIN(signed, bits, zero) \ 131/* These are separate macros, because if you try to merge these macros into
132 ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) 132 a single one, HP-UX cc rejects the resulting expression in constant
133 expressions. */
134# define _STDINT_UNSIGNED_MIN(bits, zero) \
135 (zero)
136# define _STDINT_SIGNED_MIN(bits, zero) \
137 (~ _STDINT_MAX (1, bits, zero))
133 138
134# define _STDINT_MAX(signed, bits, zero) \ 139# define _STDINT_MAX(signed, bits, zero) \
135 (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) 140 (((((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)
512# undef PTRDIFF_MAX 517# undef PTRDIFF_MAX
513# if @APPLE_UNIVERSAL_BUILD@ 518# if @APPLE_UNIVERSAL_BUILD@
514# ifdef _LP64 519# ifdef _LP64
515# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) 520# define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l)
516# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) 521# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
517# else 522# else
518# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) 523# define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0)
519# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) 524# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
520# endif 525# endif
521# else 526# else
522# define PTRDIFF_MIN \ 527# define PTRDIFF_MIN \
523 _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) 528 _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
524# define PTRDIFF_MAX \ 529# define PTRDIFF_MAX \
525 _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) 530 _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
526# endif 531# endif
@@ -528,9 +533,13 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
528/* sig_atomic_t limits */ 533/* sig_atomic_t limits */
529# undef SIG_ATOMIC_MIN 534# undef SIG_ATOMIC_MIN
530# undef SIG_ATOMIC_MAX 535# undef SIG_ATOMIC_MAX
531# define SIG_ATOMIC_MIN \ 536# if @HAVE_SIGNED_SIG_ATOMIC_T@
532 _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 537# define SIG_ATOMIC_MIN \
533 0@SIG_ATOMIC_T_SUFFIX@) 538 _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
539# else
540# define SIG_ATOMIC_MIN \
541 _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
542# endif
534# define SIG_ATOMIC_MAX \ 543# define SIG_ATOMIC_MAX \
535 _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 544 _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
536 0@SIG_ATOMIC_T_SUFFIX@) 545 0@SIG_ATOMIC_T_SUFFIX@)
@@ -566,16 +575,26 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
566# endif 575# endif
567# undef WCHAR_MIN 576# undef WCHAR_MIN
568# undef WCHAR_MAX 577# undef WCHAR_MAX
569# define WCHAR_MIN \ 578# if @HAVE_SIGNED_WCHAR_T@
570 _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) 579# define WCHAR_MIN \
580 _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
581# else
582# define WCHAR_MIN \
583 _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
584# endif
571# define WCHAR_MAX \ 585# define WCHAR_MAX \
572 _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) 586 _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
573 587
574/* wint_t limits */ 588/* wint_t limits */
575# undef WINT_MIN 589# undef WINT_MIN
576# undef WINT_MAX 590# undef WINT_MAX
577# define WINT_MIN \ 591# if @HAVE_SIGNED_WINT_T@
578 _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) 592# define WINT_MIN \
593 _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
594# else
595# define WINT_MIN \
596 _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
597# endif
579# define WINT_MAX \ 598# define WINT_MAX \
580 _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) 599 _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
581 600
diff --git a/lib/timespec.h b/lib/timespec.h
index a5eca797ce3..f5d823aefe9 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -29,6 +29,10 @@ _GL_INLINE_HEADER_BEGIN
29# define _GL_TIMESPEC_INLINE _GL_INLINE 29# define _GL_TIMESPEC_INLINE _GL_INLINE
30#endif 30#endif
31 31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
32/* Resolution of timespec timestamps (in units per second), and log 36/* Resolution of timespec timestamps (in units per second), and log
33 base 10 of the resolution. */ 37 base 10 of the resolution. */
34 38
@@ -107,6 +111,10 @@ timespectod (struct timespec a)
107void gettime (struct timespec *); 111void gettime (struct timespec *);
108int settime (struct timespec const *); 112int settime (struct timespec const *);
109 113
114#ifdef __cplusplus
115}
116#endif
117
110_GL_INLINE_HEADER_END 118_GL_INLINE_HEADER_END
111 119
112#endif 120#endif
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index 35580ac27c4..9d3b50d1575 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -1,4 +1,4 @@
1# serial 4 1# serial 5
2# Check for flexible array member support. 2# Check for flexible array member support.
3 3
4# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. 4# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
@@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
17 [[#include <stdlib.h> 17 [[#include <stdlib.h>
18 #include <stdio.h> 18 #include <stdio.h>
19 #include <stddef.h> 19 #include <stddef.h>
20 struct s { int n; double d[]; };]], 20 struct m { struct m *next, **list; char name[]; };
21 struct s { struct s *p; struct m *m; int n; double d[]; };]],
21 [[int m = getchar (); 22 [[int m = getchar ();
22 size_t nbytes = offsetof (struct s, d) + m * sizeof (double); 23 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
23 nbytes += sizeof (struct s) - 1; 24 nbytes += sizeof (struct s) - 1;
24 nbytes -= nbytes % sizeof (struct s); 25 nbytes -= nbytes % sizeof (struct s);
25 struct s *p = malloc (nbytes); 26 struct s *p = malloc (nbytes);
27 p->p = p;
28 p->m = NULL;
26 p->d[0] = 0.0; 29 p->d[0] = 0.0;
27 return p->d != (double *) NULL;]])], 30 return p->d != (double *) NULL;]])],
28 [ac_cv_c_flexmember=yes], 31 [ac_cv_c_flexmember=yes],
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index bf7afa51bf6..e613490f1a4 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -787,8 +787,6 @@ changequote([, ])dnl
787 AC_SUBST([LIBGNU_LIBDEPS]) 787 AC_SUBST([LIBGNU_LIBDEPS])
788 LIBGNU_LTLIBDEPS="$gl_ltlibdeps" 788 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
789 AC_SUBST([LIBGNU_LTLIBDEPS]) 789 AC_SUBST([LIBGNU_LTLIBDEPS])
790 LIBTESTS_LIBDEPS="$gltests_libdeps"
791 AC_SUBST([LIBTESTS_LIBDEPS])
792]) 790])
793 791
794# Like AC_LIBOBJ, except that the module name goes 792# Like AC_LIBOBJ, except that the module name goes
@@ -1106,9 +1104,4 @@ AC_DEFUN([gl_FILE_LIST], [
1106 m4/warnings.m4 1104 m4/warnings.m4
1107 m4/wchar_t.m4 1105 m4/wchar_t.m4
1108 m4/wint_t.m4 1106 m4/wint_t.m4
1109 tests=lib/_Noreturn.h
1110 tests=lib/arg-nonnull.h
1111 tests=lib/c++defs.h
1112 tests=lib/dummy.c
1113 tests=lib/warn-on-use.h
1114]) 1107])
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index 3a1265824e5..0652a1e4af5 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -35,8 +35,8 @@ AC_DEFUN([gl_STDALIGN_H],
35 || (defined __APPLE__ && defined __MACH__ \ 35 || (defined __APPLE__ && defined __MACH__ \
36 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ 36 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
37 : __GNUC__) \ 37 : __GNUC__) \
38 || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \ 38 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
39 || __ICC || 0x5110 <= __SUNPRO_C \ 39 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
40 || 1300 <= _MSC_VER) 40 || 1300 <= _MSC_VER)
41 struct alignas_test { char c; char alignas (8) alignas_8; }; 41 struct alignas_test { char c; char alignas (8) alignas_8; };
42 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 42 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8