1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00

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.
This commit is contained in:
Paul Eggert 2017-03-19 13:07:03 -07:00
parent 20ccaa63db
commit fa90c5e86e
10 changed files with 67 additions and 31 deletions

View 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.

View 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.

View File

@ -28,6 +28,17 @@
#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

View 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

View File

@ -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

View File

@ -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@, 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@)

View 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

View 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],

View 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
])

View 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