From 5d89a9c2846d32b4726faaf5c8652f3f23dc7d73 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 30 Jul 2020 13:58:58 -0700 Subject: [PATCH] Update from Gnulib MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This incorporates: 2020-07-30 work around some Oracle Studio attribute bugs 2020-07-29 fsusage, regex, stat-size: remove Cray support 2020-07-26 inttypes: remove support for AIX 4 2020-07-26 gettimeofday: remove workaround for Mac OS X 10.0 2020-07-26 don't require gl_LOCALTIME_BUFFER_DEFAULTS 2020-07-26 alloca: remove Cray-2 and Cray Y-MP support 2020-07-26 libgmp: remove dependency on havelib 2020-07-26 libgmp: remove HAVE_GMP, LIB_GMP 2020-07-25 multiarch: prepare for x86_64+arm64 universal in macOS 11 2020-07-25 sigprocmask: small autoconf macro improvement 2020-07-25 small autoconf macro improvements 2020-07-24 timespec: remove dependence on ‘verify’ 2020-07-24 optimize a few more three-valued comparisons 2020-07-24 fix _GL_CMP parenthesization typo 2020-07-23 optimize three-valued comparison between integers 2020-07-24 doc: update for Mac OS X 10.13 2020-07-23 fchmodat, lchmod: use /proc on Cygwin 2020-07-21 inttypes: fix PRI*PTR and SCN*PTR on 64-bit native Windows 2020-07-12 libgmp: avoid warning when --without-libgmp is used 2020-07-12 libgmp: link to the correct shared library * lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for * build-aux/config.guess, build-aux/config.sub: * build-aux/install-sh, doc/misc/texinfo.tex, lib/c-strcasecmp.c: * lib/c-strncasecmp.c, lib/fchmodat.c, lib/fsusage.c: * lib/gettimeofday.c, lib/inttypes.in.h, lib/lchmod.c: * lib/mini-gmp-gnulib.c, lib/nstrftime.c, lib/regex.h, lib/timespec.h: * m4/alloca.m4, m4/getgroups.m4, m4/gettimeofday.m4: * m4/gnulib-common.m4, m4/inttypes.m4, m4/libgmp.m4, m4/mktime.m4: * m4/multiarch.m4: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * src/Makefile.in, test/Makefile.in (LIBGMP): Rename from LIB_GMP for compatibility with Gnulib. All uses changed. --- build-aux/config.guess | 5 +- build-aux/config.sub | 7 +- build-aux/install-sh | 115 +++++----- doc/misc/texinfo.tex | 36 +++- lib/c-strcasecmp.c | 2 +- lib/c-strncasecmp.c | 2 +- lib/fchmodat.c | 2 +- lib/fsusage.c | 4 - lib/gettimeofday.c | 11 - lib/gnulib.mk.in | 19 +- lib/inttypes.in.h | 462 ++++++++++++++--------------------------- lib/lchmod.c | 2 +- lib/mini-gmp-gnulib.c | 6 +- lib/nstrftime.c | 9 - lib/regex.h | 2 - lib/timespec.h | 41 +--- m4/alloca.m4 | 32 +-- m4/getgroups.m4 | 5 +- m4/gettimeofday.m4 | 61 +----- m4/gnulib-common.m4 | 37 +++- m4/gnulib-comp.m4 | 17 -- m4/inttypes.m4 | 18 +- m4/libgmp.m4 | 65 ++++-- m4/mktime.m4 | 35 ++-- m4/multiarch.m4 | 67 +++--- src/Makefile.in | 4 +- test/Makefile.in | 4 +- 27 files changed, 412 insertions(+), 658 deletions(-) diff --git a/build-aux/config.guess b/build-aux/config.guess index 92bfc33e296..e94095c5fbe 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-04-26' +timestamp='2020-07-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1342,6 +1342,9 @@ EOF *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in diff --git a/build-aux/config.sub b/build-aux/config.sub index ce89d5c546c..3d9a8dc3d5a 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-06-28' +timestamp='2020-07-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1104,6 +1104,9 @@ case $cpu-$vendor in xscale-* | xscalee[bl]-*) cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; + arm64-*) + cpu=aarch64 + ;; # Recognize the canonical CPU Types that limit and/or modify the # company names they are paired with. @@ -1163,7 +1166,7 @@ case $cpu-$vendor in | am33_2.0 \ | amdgcn \ | arc | arceb \ - | arm | arm[lb]e | arme[lb] | armv* \ + | arm | arm[lb]e | arme[lb] | armv* \ | avr | avr32 \ | asmjs \ | ba \ diff --git a/build-aux/install-sh b/build-aux/install-sh index 20d8b2eaea9..b34a8fc5ab9 100755 --- a/build-aux/install-sh +++ b/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-07-26.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,10 @@ posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -301,22 +305,6 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +314,49 @@ do fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +367,7 @@ do then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +396,7 @@ do prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index d3136db38aa..0d2a1fdbc8f 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2020-05-22.11} +\def\texinfoversion{2020-06-25.17} % % Copyright 1985, 1986, 1988, 1990-2020 Free Software Foundation, Inc. % @@ -4922,7 +4922,7 @@ end % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} -\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} +\def\docodeindexxxx #1{\docind{\indexname}{#1}} % Used for the aux, toc and index files to prevent expansion of Texinfo @@ -5294,6 +5294,20 @@ end \fi } +% Same as \doind, but for code indices +\def\docind#1#2{% + \iflinks + {% + % + \requireopenindexfile{#1}% + \edef\writeto{\csname#1indfile\endcsname}% + % + \def\indextext{#2}% + \safewhatsit\docindwrite + }% + \fi +} + % Check if an index file has been opened, and if not, open it. \def\requireopenindexfile#1{% \ifnum\csname #1indfile\endcsname=0 @@ -5360,6 +5374,9 @@ end % trim spaces. \edef\trimmed{\segment}% \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% + \ifincodeindex + \edef\trimmed{\noexpand\code{\trimmed}}% + \fi % \xdef\bracedtext{\bracedtext{\trimmed}}% % @@ -5425,7 +5442,12 @@ end % Write the entry in \indextext to the index file. % -\def\doindwrite{% + +\newif\ifincodeindex +\def\doindwrite{\incodeindexfalse\doindwritex} +\def\docindwrite{\incodeindextrue\doindwritex} + +\def\doindwritex{% \maybemarginindex % \atdummies @@ -5645,7 +5667,11 @@ might help (with 'rm \jobname.?? \jobname.??s')% \else \begindoublecolumns \catcode`\\=0\relax - \catcode`\@=12\relax + % + % Make @ an escape character to give macros a chance to work. This + % should work because we (hopefully) don't otherwise use @ in index files. + %\catcode`\@=12\relax + \catcode`\@=0\relax \input \jobname.\indexname s \enddoublecolumns \fi @@ -7562,7 +7588,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim - \def\par{\egroup\box\verbbox\endgraf\starttabbox}% + \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c index 951220f3e29..f1a4b98fa55 100644 --- a/lib/c-strcasecmp.c +++ b/lib/c-strcasecmp.c @@ -52,5 +52,5 @@ c_strcasecmp (const char *s1, const char *s2) /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ - return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); + return _GL_CMP (c1, c2); } diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c index 9ad49191b7f..1d6e1411a67 100644 --- a/lib/c-strncasecmp.c +++ b/lib/c-strncasecmp.c @@ -52,5 +52,5 @@ c_strncasecmp (const char *s1, const char *s2, size_t n) /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ - return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); + return _GL_CMP (c1, c2); } diff --git a/lib/fchmodat.c b/lib/fchmodat.c index 8950168608f..eee0a1c56e4 100644 --- a/lib/fchmodat.c +++ b/lib/fchmodat.c @@ -98,7 +98,7 @@ fchmodat (int dir, char const *file, mode_t mode, int flags) return -1; } -# if defined __linux__ || defined __ANDROID__ +# if defined __linux__ || defined __ANDROID__ || defined __CYGWIN__ static char const fmt[] = "/proc/self/fd/%d"; char buf[sizeof fmt - sizeof "%d" + INT_BUFSIZE_BOUND (int)]; sprintf (buf, fmt, fd); diff --git a/lib/fsusage.c b/lib/fsusage.c index 81960152d41..85bfe0e2837 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -211,11 +211,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) /* Empirically, the block counts on most SVR3 and SVR3-derived systems seem to always be in terms of 512-byte blocks, no matter what value f_bsize has. */ -# if defined _CRAY - fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize); -# else fsp->fsu_blocksize = 512; -# endif #endif diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index 057cebdb163..5301e7c144a 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -29,8 +29,6 @@ # include #endif -#include "localtime-buffer.h" - #ifdef WINDOWS_NATIVE /* Don't assume that UNICODE is not defined. */ @@ -123,11 +121,6 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz) #else # if HAVE_GETTIMEOFDAY -# if GETTIMEOFDAY_CLOBBERS_LOCALTIME - /* Save and restore the contents of the buffer used for localtime's - result around the call to gettimeofday. */ - struct tm save = *localtime_buffer_addr; -# endif # if defined timeval /* 'struct timeval' overridden by gnulib? */ # undef timeval @@ -142,10 +135,6 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz) int result = gettimeofday (tv, (struct timezone *) tz); # endif -# if GETTIMEOFDAY_CLOBBERS_LOCALTIME - *localtime_buffer_addr = save; -# endif - return result; # else diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 68cae8faf74..4dc180d2e33 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -587,6 +587,7 @@ HAVE_INITSTATE = @HAVE_INITSTATE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LIBGMP = @HAVE_LIBGMP@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LSTAT = @HAVE_LSTAT@ @@ -721,6 +722,7 @@ LD_SWITCH_SYSTEM_TEMACS = @LD_SWITCH_SYSTEM_TEMACS@ LD_SWITCH_X_SITE = @LD_SWITCH_X_SITE@ LD_SWITCH_X_SITE_RPATH = @LD_SWITCH_X_SITE_RPATH@ LIBGIF = @LIBGIF@ +LIBGMP = @LIBGMP@ LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ @@ -761,7 +763,6 @@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_EACCESS = @LIB_EACCESS@ LIB_EXECINFO = @LIB_EXECINFO@ LIB_GETRANDOM = @LIB_GETRANDOM@ -LIB_GMP = @LIB_GMP@ LIB_MATH = @LIB_MATH@ LIB_PTHREAD = @LIB_PTHREAD@ LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ @@ -769,6 +770,7 @@ LIB_TIMER_TIME = @LIB_TIMER_TIME@ LIB_WSOCK32 = @LIB_WSOCK32@ LIMITS_H = @LIMITS_H@ LN_S_FILEONLY = @LN_S_FILEONLY@ +LTLIBGMP = @LTLIBGMP@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@ @@ -848,7 +850,6 @@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRE_ALLOC_OBJ = @PRE_ALLOC_OBJ@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ -PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PROFILING_CFLAGS = @PROFILING_CFLAGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ @@ -1963,7 +1964,6 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ - -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ @@ -2069,19 +2069,6 @@ EXTRA_DIST += limits.in.h endif ## end gnulib module limits-h -## begin gnulib module localtime-buffer -ifeq (,$(OMIT_GNULIB_MODULE_localtime-buffer)) - -ifneq (,$(gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9)) - -endif -EXTRA_DIST += localtime-buffer.c localtime-buffer.h - -EXTRA_libgnu_a_SOURCES += localtime-buffer.c - -endif -## end gnulib module localtime-buffer - ## begin gnulib module lstat ifeq (,$(OMIT_GNULIB_MODULE_lstat)) diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index 9f04a6ced4a..596a050458b 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -78,110 +78,92 @@ # define _LONG_LONG_FORMAT_PREFIX "ll" #endif -#if !defined PRId8 || @PRI_MACROS_BROKEN@ -# undef PRId8 +#if !defined PRId8 # ifdef INT8_MAX # define PRId8 "d" # endif #endif -#if !defined PRIi8 || @PRI_MACROS_BROKEN@ -# undef PRIi8 +#if !defined PRIi8 # ifdef INT8_MAX # define PRIi8 "i" # endif #endif -#if !defined PRIo8 || @PRI_MACROS_BROKEN@ -# undef PRIo8 +#if !defined PRIo8 # ifdef UINT8_MAX # define PRIo8 "o" # endif #endif -#if !defined PRIu8 || @PRI_MACROS_BROKEN@ -# undef PRIu8 +#if !defined PRIu8 # ifdef UINT8_MAX # define PRIu8 "u" # endif #endif -#if !defined PRIx8 || @PRI_MACROS_BROKEN@ -# undef PRIx8 +#if !defined PRIx8 # ifdef UINT8_MAX # define PRIx8 "x" # endif #endif -#if !defined PRIX8 || @PRI_MACROS_BROKEN@ -# undef PRIX8 +#if !defined PRIX8 # ifdef UINT8_MAX # define PRIX8 "X" # endif #endif -#if !defined PRId16 || @PRI_MACROS_BROKEN@ -# undef PRId16 +#if !defined PRId16 # ifdef INT16_MAX # define PRId16 "d" # endif #endif -#if !defined PRIi16 || @PRI_MACROS_BROKEN@ -# undef PRIi16 +#if !defined PRIi16 # ifdef INT16_MAX # define PRIi16 "i" # endif #endif -#if !defined PRIo16 || @PRI_MACROS_BROKEN@ -# undef PRIo16 +#if !defined PRIo16 # ifdef UINT16_MAX # define PRIo16 "o" # endif #endif -#if !defined PRIu16 || @PRI_MACROS_BROKEN@ -# undef PRIu16 +#if !defined PRIu16 # ifdef UINT16_MAX # define PRIu16 "u" # endif #endif -#if !defined PRIx16 || @PRI_MACROS_BROKEN@ -# undef PRIx16 +#if !defined PRIx16 # ifdef UINT16_MAX # define PRIx16 "x" # endif #endif -#if !defined PRIX16 || @PRI_MACROS_BROKEN@ -# undef PRIX16 +#if !defined PRIX16 # ifdef UINT16_MAX # define PRIX16 "X" # endif #endif -#if !defined PRId32 || @PRI_MACROS_BROKEN@ -# undef PRId32 +#if !defined PRId32 # ifdef INT32_MAX # define PRId32 "d" # endif #endif -#if !defined PRIi32 || @PRI_MACROS_BROKEN@ -# undef PRIi32 +#if !defined PRIi32 # ifdef INT32_MAX # define PRIi32 "i" # endif #endif -#if !defined PRIo32 || @PRI_MACROS_BROKEN@ -# undef PRIo32 +#if !defined PRIo32 # ifdef UINT32_MAX # define PRIo32 "o" # endif #endif -#if !defined PRIu32 || @PRI_MACROS_BROKEN@ -# undef PRIu32 +#if !defined PRIu32 # ifdef UINT32_MAX # define PRIu32 "u" # endif #endif -#if !defined PRIx32 || @PRI_MACROS_BROKEN@ -# undef PRIx32 +#if !defined PRIx32 # ifdef UINT32_MAX # define PRIx32 "x" # endif #endif -#if !defined PRIX32 || @PRI_MACROS_BROKEN@ -# undef PRIX32 +#if !defined PRIX32 # ifdef UINT32_MAX # define PRIX32 "X" # endif @@ -194,12 +176,10 @@ # elif LONG_MAX >> 30 == 1 # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined PRId64 || @PRI_MACROS_BROKEN@ -# undef PRId64 +# if !defined PRId64 # define PRId64 _PRI64_PREFIX "d" # endif -# if !defined PRIi64 || @PRI_MACROS_BROKEN@ -# undef PRIi64 +# if !defined PRIi64 # define PRIi64 _PRI64_PREFIX "i" # endif #endif @@ -211,263 +191,217 @@ # elif ULONG_MAX >> 31 == 1 # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined PRIo64 || @PRI_MACROS_BROKEN@ -# undef PRIo64 +# if !defined PRIo64 # define PRIo64 _PRIu64_PREFIX "o" # endif -# if !defined PRIu64 || @PRI_MACROS_BROKEN@ -# undef PRIu64 +# if !defined PRIu64 # define PRIu64 _PRIu64_PREFIX "u" # endif -# if !defined PRIx64 || @PRI_MACROS_BROKEN@ -# undef PRIx64 +# if !defined PRIx64 # define PRIx64 _PRIu64_PREFIX "x" # endif -# if !defined PRIX64 || @PRI_MACROS_BROKEN@ -# undef PRIX64 +# if !defined PRIX64 # define PRIX64 _PRIu64_PREFIX "X" # endif #endif -#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST8 +#if !defined PRIdLEAST8 # define PRIdLEAST8 "d" #endif -#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST8 +#if !defined PRIiLEAST8 # define PRIiLEAST8 "i" #endif -#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST8 +#if !defined PRIoLEAST8 # define PRIoLEAST8 "o" #endif -#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST8 +#if !defined PRIuLEAST8 # define PRIuLEAST8 "u" #endif -#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST8 +#if !defined PRIxLEAST8 # define PRIxLEAST8 "x" #endif -#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST8 +#if !defined PRIXLEAST8 # define PRIXLEAST8 "X" #endif -#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST16 +#if !defined PRIdLEAST16 # define PRIdLEAST16 "d" #endif -#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST16 +#if !defined PRIiLEAST16 # define PRIiLEAST16 "i" #endif -#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST16 +#if !defined PRIoLEAST16 # define PRIoLEAST16 "o" #endif -#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST16 +#if !defined PRIuLEAST16 # define PRIuLEAST16 "u" #endif -#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST16 +#if !defined PRIxLEAST16 # define PRIxLEAST16 "x" #endif -#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST16 +#if !defined PRIXLEAST16 # define PRIXLEAST16 "X" #endif -#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST32 +#if !defined PRIdLEAST32 # define PRIdLEAST32 "d" #endif -#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST32 +#if !defined PRIiLEAST32 # define PRIiLEAST32 "i" #endif -#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST32 +#if !defined PRIoLEAST32 # define PRIoLEAST32 "o" #endif -#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST32 +#if !defined PRIuLEAST32 # define PRIuLEAST32 "u" #endif -#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST32 +#if !defined PRIxLEAST32 # define PRIxLEAST32 "x" #endif -#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST32 +#if !defined PRIXLEAST32 # define PRIXLEAST32 "X" #endif #ifdef INT64_MAX -# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST64 +# if !defined PRIdLEAST64 # define PRIdLEAST64 PRId64 # endif -# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST64 +# if !defined PRIiLEAST64 # define PRIiLEAST64 PRIi64 # endif #endif #ifdef UINT64_MAX -# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST64 +# if !defined PRIoLEAST64 # define PRIoLEAST64 PRIo64 # endif -# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST64 +# if !defined PRIuLEAST64 # define PRIuLEAST64 PRIu64 # endif -# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST64 +# if !defined PRIxLEAST64 # define PRIxLEAST64 PRIx64 # endif -# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST64 +# if !defined PRIXLEAST64 # define PRIXLEAST64 PRIX64 # endif #endif -#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST8 +#if !defined PRIdFAST8 # if INT_FAST8_MAX > INT32_MAX # define PRIdFAST8 PRId64 # else # define PRIdFAST8 "d" # endif #endif -#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST8 +#if !defined PRIiFAST8 # if INT_FAST8_MAX > INT32_MAX # define PRIiFAST8 PRIi64 # else # define PRIiFAST8 "i" # endif #endif -#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST8 +#if !defined PRIoFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIoFAST8 PRIo64 # else # define PRIoFAST8 "o" # endif #endif -#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST8 +#if !defined PRIuFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIuFAST8 PRIu64 # else # define PRIuFAST8 "u" # endif #endif -#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST8 +#if !defined PRIxFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIxFAST8 PRIx64 # else # define PRIxFAST8 "x" # endif #endif -#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST8 +#if !defined PRIXFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIXFAST8 PRIX64 # else # define PRIXFAST8 "X" # endif #endif -#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST16 +#if !defined PRIdFAST16 # if INT_FAST16_MAX > INT32_MAX # define PRIdFAST16 PRId64 # else # define PRIdFAST16 "d" # endif #endif -#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST16 +#if !defined PRIiFAST16 # if INT_FAST16_MAX > INT32_MAX # define PRIiFAST16 PRIi64 # else # define PRIiFAST16 "i" # endif #endif -#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST16 +#if !defined PRIoFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIoFAST16 PRIo64 # else # define PRIoFAST16 "o" # endif #endif -#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST16 +#if !defined PRIuFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIuFAST16 PRIu64 # else # define PRIuFAST16 "u" # endif #endif -#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST16 +#if !defined PRIxFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIxFAST16 PRIx64 # else # define PRIxFAST16 "x" # endif #endif -#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST16 +#if !defined PRIXFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIXFAST16 PRIX64 # else # define PRIXFAST16 "X" # endif #endif -#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST32 +#if !defined PRIdFAST32 # if INT_FAST32_MAX > INT32_MAX # define PRIdFAST32 PRId64 # else # define PRIdFAST32 "d" # endif #endif -#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST32 +#if !defined PRIiFAST32 # if INT_FAST32_MAX > INT32_MAX # define PRIiFAST32 PRIi64 # else # define PRIiFAST32 "i" # endif #endif -#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST32 +#if !defined PRIoFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIoFAST32 PRIo64 # else # define PRIoFAST32 "o" # endif #endif -#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST32 +#if !defined PRIuFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIuFAST32 PRIu64 # else # define PRIuFAST32 "u" # endif #endif -#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST32 +#if !defined PRIxFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIxFAST32 PRIx64 # else # define PRIxFAST32 "x" # endif #endif -#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST32 +#if !defined PRIXFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIXFAST32 PRIX64 # else @@ -475,76 +409,64 @@ # endif #endif #ifdef INT64_MAX -# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST64 +# if !defined PRIdFAST64 # define PRIdFAST64 PRId64 # endif -# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST64 +# if !defined PRIiFAST64 # define PRIiFAST64 PRIi64 # endif #endif #ifdef UINT64_MAX -# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST64 +# if !defined PRIoFAST64 # define PRIoFAST64 PRIo64 # endif -# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST64 +# if !defined PRIuFAST64 # define PRIuFAST64 PRIu64 # endif -# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST64 +# if !defined PRIxFAST64 # define PRIxFAST64 PRIx64 # endif -# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST64 +# if !defined PRIXFAST64 # define PRIXFAST64 PRIX64 # endif #endif -#if !defined PRIdMAX || @PRI_MACROS_BROKEN@ -# undef PRIdMAX +#if !defined PRIdMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define PRIdMAX PRId64 # else # define PRIdMAX "ld" # endif #endif -#if !defined PRIiMAX || @PRI_MACROS_BROKEN@ -# undef PRIiMAX +#if !defined PRIiMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define PRIiMAX PRIi64 # else # define PRIiMAX "li" # endif #endif -#if !defined PRIoMAX || @PRI_MACROS_BROKEN@ -# undef PRIoMAX +#if !defined PRIoMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIoMAX PRIo64 # else # define PRIoMAX "lo" # endif #endif -#if !defined PRIuMAX || @PRI_MACROS_BROKEN@ -# undef PRIuMAX +#if !defined PRIuMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIuMAX PRIu64 # else # define PRIuMAX "lu" # endif #endif -#if !defined PRIxMAX || @PRI_MACROS_BROKEN@ -# undef PRIxMAX +#if !defined PRIxMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIxMAX PRIx64 # else # define PRIxMAX "lx" # endif #endif -#if !defined PRIXMAX || @PRI_MACROS_BROKEN@ -# undef PRIXMAX +#if !defined PRIXMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIXMAX PRIX64 # else @@ -552,129 +474,108 @@ # endif #endif -#if !defined PRIdPTR || @PRI_MACROS_BROKEN@ -# undef PRIdPTR +#if !defined PRIdPTR # ifdef INTPTR_MAX # define PRIdPTR @PRIPTR_PREFIX@ "d" # endif #endif -#if !defined PRIiPTR || @PRI_MACROS_BROKEN@ -# undef PRIiPTR +#if !defined PRIiPTR # ifdef INTPTR_MAX # define PRIiPTR @PRIPTR_PREFIX@ "i" # endif #endif -#if !defined PRIoPTR || @PRI_MACROS_BROKEN@ -# undef PRIoPTR +#if !defined PRIoPTR # ifdef UINTPTR_MAX # define PRIoPTR @PRIPTR_PREFIX@ "o" # endif #endif -#if !defined PRIuPTR || @PRI_MACROS_BROKEN@ -# undef PRIuPTR +#if !defined PRIuPTR # ifdef UINTPTR_MAX # define PRIuPTR @PRIPTR_PREFIX@ "u" # endif #endif -#if !defined PRIxPTR || @PRI_MACROS_BROKEN@ -# undef PRIxPTR +#if !defined PRIxPTR # ifdef UINTPTR_MAX # define PRIxPTR @PRIPTR_PREFIX@ "x" # endif #endif -#if !defined PRIXPTR || @PRI_MACROS_BROKEN@ -# undef PRIXPTR +#if !defined PRIXPTR # ifdef UINTPTR_MAX # define PRIXPTR @PRIPTR_PREFIX@ "X" # endif #endif -#if !defined SCNd8 || @PRI_MACROS_BROKEN@ -# undef SCNd8 +#if !defined SCNd8 # ifdef INT8_MAX # define SCNd8 "hhd" # endif #endif -#if !defined SCNi8 || @PRI_MACROS_BROKEN@ -# undef SCNi8 +#if !defined SCNi8 # ifdef INT8_MAX # define SCNi8 "hhi" # endif #endif -#if !defined SCNo8 || @PRI_MACROS_BROKEN@ -# undef SCNo8 +#if !defined SCNo8 # ifdef UINT8_MAX # define SCNo8 "hho" # endif #endif -#if !defined SCNu8 || @PRI_MACROS_BROKEN@ -# undef SCNu8 +#if !defined SCNu8 # ifdef UINT8_MAX # define SCNu8 "hhu" # endif #endif -#if !defined SCNx8 || @PRI_MACROS_BROKEN@ -# undef SCNx8 +#if !defined SCNx8 # ifdef UINT8_MAX # define SCNx8 "hhx" # endif #endif -#if !defined SCNd16 || @PRI_MACROS_BROKEN@ -# undef SCNd16 +#if !defined SCNd16 # ifdef INT16_MAX # define SCNd16 "hd" # endif #endif -#if !defined SCNi16 || @PRI_MACROS_BROKEN@ -# undef SCNi16 +#if !defined SCNi16 # ifdef INT16_MAX # define SCNi16 "hi" # endif #endif -#if !defined SCNo16 || @PRI_MACROS_BROKEN@ -# undef SCNo16 +#if !defined SCNo16 # ifdef UINT16_MAX # define SCNo16 "ho" # endif #endif -#if !defined SCNu16 || @PRI_MACROS_BROKEN@ -# undef SCNu16 +#if !defined SCNu16 # ifdef UINT16_MAX # define SCNu16 "hu" # endif #endif -#if !defined SCNx16 || @PRI_MACROS_BROKEN@ -# undef SCNx16 +#if !defined SCNx16 # ifdef UINT16_MAX # define SCNx16 "hx" # endif #endif -#if !defined SCNd32 || @PRI_MACROS_BROKEN@ -# undef SCNd32 +#if !defined SCNd32 # ifdef INT32_MAX # define SCNd32 "d" # endif #endif -#if !defined SCNi32 || @PRI_MACROS_BROKEN@ -# undef SCNi32 +#if !defined SCNi32 # ifdef INT32_MAX # define SCNi32 "i" # endif #endif -#if !defined SCNo32 || @PRI_MACROS_BROKEN@ -# undef SCNo32 +#if !defined SCNo32 # ifdef UINT32_MAX # define SCNo32 "o" # endif #endif -#if !defined SCNu32 || @PRI_MACROS_BROKEN@ -# undef SCNu32 +#if !defined SCNu32 # ifdef UINT32_MAX # define SCNu32 "u" # endif #endif -#if !defined SCNx32 || @PRI_MACROS_BROKEN@ -# undef SCNx32 +#if !defined SCNx32 # ifdef UINT32_MAX # define SCNx32 "x" # endif @@ -687,12 +588,10 @@ # elif LONG_MAX >> 30 == 1 # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined SCNd64 || @PRI_MACROS_BROKEN@ -# undef SCNd64 +# if !defined SCNd64 # define SCNd64 _SCN64_PREFIX "d" # endif -# if !defined SCNi64 || @PRI_MACROS_BROKEN@ -# undef SCNi64 +# if !defined SCNi64 # define SCNi64 _SCN64_PREFIX "i" # endif #endif @@ -704,107 +603,83 @@ # elif ULONG_MAX >> 31 == 1 # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined SCNo64 || @PRI_MACROS_BROKEN@ -# undef SCNo64 +# if !defined SCNo64 # define SCNo64 _SCNu64_PREFIX "o" # endif -# if !defined SCNu64 || @PRI_MACROS_BROKEN@ -# undef SCNu64 +# if !defined SCNu64 # define SCNu64 _SCNu64_PREFIX "u" # endif -# if !defined SCNx64 || @PRI_MACROS_BROKEN@ -# undef SCNx64 +# if !defined SCNx64 # define SCNx64 _SCNu64_PREFIX "x" # endif #endif -#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST8 +#if !defined SCNdLEAST8 # define SCNdLEAST8 "hhd" #endif -#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST8 +#if !defined SCNiLEAST8 # define SCNiLEAST8 "hhi" #endif -#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST8 +#if !defined SCNoLEAST8 # define SCNoLEAST8 "hho" #endif -#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST8 +#if !defined SCNuLEAST8 # define SCNuLEAST8 "hhu" #endif -#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST8 +#if !defined SCNxLEAST8 # define SCNxLEAST8 "hhx" #endif -#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST16 +#if !defined SCNdLEAST16 # define SCNdLEAST16 "hd" #endif -#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST16 +#if !defined SCNiLEAST16 # define SCNiLEAST16 "hi" #endif -#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST16 +#if !defined SCNoLEAST16 # define SCNoLEAST16 "ho" #endif -#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST16 +#if !defined SCNuLEAST16 # define SCNuLEAST16 "hu" #endif -#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST16 +#if !defined SCNxLEAST16 # define SCNxLEAST16 "hx" #endif -#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST32 +#if !defined SCNdLEAST32 # define SCNdLEAST32 "d" #endif -#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST32 +#if !defined SCNiLEAST32 # define SCNiLEAST32 "i" #endif -#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST32 +#if !defined SCNoLEAST32 # define SCNoLEAST32 "o" #endif -#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST32 +#if !defined SCNuLEAST32 # define SCNuLEAST32 "u" #endif -#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST32 +#if !defined SCNxLEAST32 # define SCNxLEAST32 "x" #endif #ifdef INT64_MAX -# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST64 +# if !defined SCNdLEAST64 # define SCNdLEAST64 SCNd64 # endif -# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST64 +# if !defined SCNiLEAST64 # define SCNiLEAST64 SCNi64 # endif #endif #ifdef UINT64_MAX -# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST64 +# if !defined SCNoLEAST64 # define SCNoLEAST64 SCNo64 # endif -# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST64 +# if !defined SCNuLEAST64 # define SCNuLEAST64 SCNu64 # endif -# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST64 +# if !defined SCNxLEAST64 # define SCNxLEAST64 SCNx64 # endif #endif -#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST8 +#if !defined SCNdFAST8 # if INT_FAST8_MAX > INT32_MAX # define SCNdFAST8 SCNd64 # elif INT_FAST8_MAX == 0x7fff @@ -815,8 +690,7 @@ # define SCNdFAST8 "d" # endif #endif -#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST8 +#if !defined SCNiFAST8 # if INT_FAST8_MAX > INT32_MAX # define SCNiFAST8 SCNi64 # elif INT_FAST8_MAX == 0x7fff @@ -827,8 +701,7 @@ # define SCNiFAST8 "i" # endif #endif -#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST8 +#if !defined SCNoFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNoFAST8 SCNo64 # elif UINT_FAST8_MAX == 0xffff @@ -839,8 +712,7 @@ # define SCNoFAST8 "o" # endif #endif -#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST8 +#if !defined SCNuFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNuFAST8 SCNu64 # elif UINT_FAST8_MAX == 0xffff @@ -851,8 +723,7 @@ # define SCNuFAST8 "u" # endif #endif -#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST8 +#if !defined SCNxFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNxFAST8 SCNx64 # elif UINT_FAST8_MAX == 0xffff @@ -863,8 +734,7 @@ # define SCNxFAST8 "x" # endif #endif -#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST16 +#if !defined SCNdFAST16 # if INT_FAST16_MAX > INT32_MAX # define SCNdFAST16 SCNd64 # elif INT_FAST16_MAX == 0x7fff @@ -873,8 +743,7 @@ # define SCNdFAST16 "d" # endif #endif -#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST16 +#if !defined SCNiFAST16 # if INT_FAST16_MAX > INT32_MAX # define SCNiFAST16 SCNi64 # elif INT_FAST16_MAX == 0x7fff @@ -883,8 +752,7 @@ # define SCNiFAST16 "i" # endif #endif -#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST16 +#if !defined SCNoFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNoFAST16 SCNo64 # elif UINT_FAST16_MAX == 0xffff @@ -893,8 +761,7 @@ # define SCNoFAST16 "o" # endif #endif -#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST16 +#if !defined SCNuFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNuFAST16 SCNu64 # elif UINT_FAST16_MAX == 0xffff @@ -903,8 +770,7 @@ # define SCNuFAST16 "u" # endif #endif -#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST16 +#if !defined SCNxFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNxFAST16 SCNx64 # elif UINT_FAST16_MAX == 0xffff @@ -913,40 +779,35 @@ # define SCNxFAST16 "x" # endif #endif -#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST32 +#if !defined SCNdFAST32 # if INT_FAST32_MAX > INT32_MAX # define SCNdFAST32 SCNd64 # else # define SCNdFAST32 "d" # endif #endif -#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST32 +#if !defined SCNiFAST32 # if INT_FAST32_MAX > INT32_MAX # define SCNiFAST32 SCNi64 # else # define SCNiFAST32 "i" # endif #endif -#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST32 +#if !defined SCNoFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNoFAST32 SCNo64 # else # define SCNoFAST32 "o" # endif #endif -#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST32 +#if !defined SCNuFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNuFAST32 SCNu64 # else # define SCNuFAST32 "u" # endif #endif -#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST32 +#if !defined SCNxFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNxFAST32 SCNx64 # else @@ -954,64 +815,54 @@ # endif #endif #ifdef INT64_MAX -# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST64 +# if !defined SCNdFAST64 # define SCNdFAST64 SCNd64 # endif -# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST64 +# if !defined SCNiFAST64 # define SCNiFAST64 SCNi64 # endif #endif #ifdef UINT64_MAX -# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST64 +# if !defined SCNoFAST64 # define SCNoFAST64 SCNo64 # endif -# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST64 +# if !defined SCNuFAST64 # define SCNuFAST64 SCNu64 # endif -# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST64 +# if !defined SCNxFAST64 # define SCNxFAST64 SCNx64 # endif #endif -#if !defined SCNdMAX || @PRI_MACROS_BROKEN@ -# undef SCNdMAX +#if !defined SCNdMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define SCNdMAX SCNd64 # else # define SCNdMAX "ld" # endif #endif -#if !defined SCNiMAX || @PRI_MACROS_BROKEN@ -# undef SCNiMAX +#if !defined SCNiMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define SCNiMAX SCNi64 # else # define SCNiMAX "li" # endif #endif -#if !defined SCNoMAX || @PRI_MACROS_BROKEN@ -# undef SCNoMAX +#if !defined SCNoMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNoMAX SCNo64 # else # define SCNoMAX "lo" # endif #endif -#if !defined SCNuMAX || @PRI_MACROS_BROKEN@ -# undef SCNuMAX +#if !defined SCNuMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNuMAX SCNu64 # else # define SCNuMAX "lu" # endif #endif -#if !defined SCNxMAX || @PRI_MACROS_BROKEN@ -# undef SCNxMAX +#if !defined SCNxMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNxMAX SCNx64 # else @@ -1019,32 +870,27 @@ # endif #endif -#if !defined SCNdPTR || @PRI_MACROS_BROKEN@ -# undef SCNdPTR +#if !defined SCNdPTR # ifdef INTPTR_MAX # define SCNdPTR @PRIPTR_PREFIX@ "d" # endif #endif -#if !defined SCNiPTR || @PRI_MACROS_BROKEN@ -# undef SCNiPTR +#if !defined SCNiPTR # ifdef INTPTR_MAX # define SCNiPTR @PRIPTR_PREFIX@ "i" # endif #endif -#if !defined SCNoPTR || @PRI_MACROS_BROKEN@ -# undef SCNoPTR +#if !defined SCNoPTR # ifdef UINTPTR_MAX # define SCNoPTR @PRIPTR_PREFIX@ "o" # endif #endif -#if !defined SCNuPTR || @PRI_MACROS_BROKEN@ -# undef SCNuPTR +#if !defined SCNuPTR # ifdef UINTPTR_MAX # define SCNuPTR @PRIPTR_PREFIX@ "u" # endif #endif -#if !defined SCNxPTR || @PRI_MACROS_BROKEN@ -# undef SCNxPTR +#if !defined SCNxPTR # ifdef UINTPTR_MAX # define SCNxPTR @PRIPTR_PREFIX@ "x" # endif diff --git a/lib/lchmod.c b/lib/lchmod.c index e1132116234..77a00609552 100644 --- a/lib/lchmod.c +++ b/lib/lchmod.c @@ -76,7 +76,7 @@ lchmod (char const *file, mode_t mode) return -1; } -# if defined __linux__ || defined __ANDROID__ +# if defined __linux__ || defined __ANDROID__ || defined __CYGWIN__ static char const fmt[] = "/proc/self/fd/%d"; char buf[sizeof fmt - sizeof "%d" + INT_BUFSIZE_BOUND (int)]; sprintf (buf, fmt, fd); diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c index 5019be5d52a..e9e8a174c03 100644 --- a/lib/mini-gmp-gnulib.c +++ b/lib/mini-gmp-gnulib.c @@ -22,12 +22,14 @@ #include "mini-gmp.h" -/* Pacify GCC -Wsuggest-attribute=const, malloc, pure. */ +/* Pacify GCC -Wsuggest-attribute=const, pure, malloc. */ #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # pragma GCC diagnostic ignored "-Wsuggest-attribute=const" -# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" #endif +#if 8 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" +#endif /* Pacify GCC -Wunused-variable for variables used only in 'assert' calls. */ #if defined NDEBUG && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) diff --git a/lib/nstrftime.c b/lib/nstrftime.c index 28b539dc2f2..2816cf4d58b 100644 --- a/lib/nstrftime.c +++ b/lib/nstrftime.c @@ -495,15 +495,6 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) const char *format_end = NULL; #endif -#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST - /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned - by localtime. On such systems, we must either use the tzset and - localtime wrappers to work around the bug (which sets - HAVE_RUN_TZSET_TEST) or make a copy of the structure. */ - struct tm copy = *tp; - tp = © -#endif - zone = NULL; #if HAVE_TM_ZONE /* The POSIX test suite assumes that setting diff --git a/lib/regex.h b/lib/regex.h index 76ff4e342fe..610f139eb39 100644 --- a/lib/regex.h +++ b/lib/regex.h @@ -600,11 +600,9 @@ extern void re_set_registers (struct re_pattern_buffer *__buffer, #endif /* Use GNU */ #if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC) -# ifndef _CRAY /* 4.2 bsd compatibility. */ extern char *re_comp (const char *); extern int re_exec (const char *); -# endif #endif /* For plain 'restrict', use glibc's __restrict if defined. diff --git a/lib/timespec.h b/lib/timespec.h index 02684ce6eac..dc999f944b2 100644 --- a/lib/timespec.h +++ b/lib/timespec.h @@ -34,7 +34,6 @@ extern "C" { #endif #include "arg-nonnull.h" -#include "verify.h" /* Inverse resolution of timespec timestamps (in units per second), and log base 10 of the inverse resolution. */ @@ -59,46 +58,12 @@ make_timespec (time_t s, long int ns) return r; } -/* Return negative, zero, positive if A < B, A == B, A > B, respectively. - - For each timestamp T, this code assumes that either: - - * T.tv_nsec is in the range 0..999999999; or - * T.tv_sec corresponds to a valid leap second on a host that supports - leap seconds, and T.tv_nsec is in the range 1000000000..1999999999; or - * T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or - T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000. - This allows for special struct timespec values that are less or - greater than all possible valid timestamps. - - In all these cases, it is safe to subtract two tv_nsec values and - convert the result to integer without worrying about overflow on - any platform of interest to the GNU project, since all such - platforms have 32-bit int or wider. - - Replacing "a.tv_nsec - b.tv_nsec" with something like - "a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause - this function to work in some cases where the above assumption is - violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2, - b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the - extra instructions. Using a subtraction has the advantage of - detecting some invalid cases on platforms that detect integer - overflow. */ +/* Return negative, zero, positive if A < B, A == B, A > B, respectively. */ _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE timespec_cmp (struct timespec a, struct timespec b) { - if (a.tv_sec < b.tv_sec) - return -1; - if (a.tv_sec > b.tv_sec) - return 1; - - /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02). See: - https://lists.gnu.org/r/bug-gnulib/2017-10/msg00006.html */ - assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_HZ); - assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_HZ); - - return a.tv_nsec - b.tv_nsec; + return 2 * _GL_CMP (a.tv_sec, b.tv_sec) + _GL_CMP (a.tv_nsec, b.tv_nsec); } /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be @@ -106,7 +71,7 @@ timespec_cmp (struct timespec a, struct timespec b) _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE timespec_sign (struct timespec a) { - return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; + return _GL_CMP (a.tv_sec, 0) + (!a.tv_sec & !!a.tv_nsec); } struct timespec timespec_add (struct timespec, struct timespec) diff --git a/m4/alloca.m4 b/m4/alloca.m4 index 59225245b91..d3e98c51bf4 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,4 +1,4 @@ -# alloca.m4 serial 15 +# alloca.m4 serial 16 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -51,12 +51,9 @@ AC_DEFUN([gl_FUNC_ALLOCA], AC_DEFUN([gl_PREREQ_ALLOCA], [:]) # This works around a bug in autoconf <= 2.68. -# See . - -m4_version_prereq([2.69], [] ,[ - -# This is taken from the following Autoconf patch: -# https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497 +# See and +# . +# Also it has a simplification that is not yet in Autoconf. # _AC_LIBOBJ_ALLOCA # ----------------- @@ -72,26 +69,6 @@ AC_LIBSOURCES(alloca.c) AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) -AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray, -[AC_EGREP_CPP(webecray, -[#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif -], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - AC_CHECK_FUNC($ac_func, - [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, - [Define to one of '_getb67', 'GETB67', - 'getb67' for Cray-2 and Cray-YMP - systems. This function is required for - 'alloca.c' support on those systems.]) - break]) - done -fi - AC_CACHE_CHECK([stack direction for C alloca], [ac_cv_c_stack_direction], [AC_RUN_IFELSE([AC_LANG_SOURCE( @@ -124,5 +101,4 @@ AH_VERBATIM([STACK_DIRECTION], STACK_DIRECTION = 0 => direction of growth unknown */ @%:@undef STACK_DIRECTION])dnl AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) -])# _AC_LIBOBJ_ALLOCA ]) diff --git a/m4/getgroups.m4 b/m4/getgroups.m4 index 3e7e46f8672..e3441621b25 100644 --- a/m4/getgroups.m4 +++ b/m4/getgroups.m4 @@ -1,4 +1,4 @@ -# serial 23 +# serial 24 dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. @@ -79,7 +79,8 @@ AC_DEFUN([gl_FUNC_GETGROUPS], AC_DEFINE([GETGROUPS_ZERO_BUG], [1], [Define this to 1 if getgroups(0,NULL) does not return the number of groups.]) else - dnl Detect FreeBSD bug; POSIX requires getgroups(-1,ptr) to fail. + dnl Detect Mac OS X and FreeBSD bug; POSIX requires getgroups(-1,ptr) + dnl to fail. AC_CACHE_CHECK([whether getgroups handles negative values], [gl_cv_func_getgroups_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index c72b3eacc63..578ed49b077 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,4 +1,4 @@ -# serial 27 +# serial 28 # Copyright (C) 2001-2003, 2005, 2007, 2009-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -19,7 +19,6 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY], if test $ac_cv_func_gettimeofday != yes; then HAVE_GETTIMEOFDAY=0 else - gl_FUNC_GETTIMEOFDAY_CLOBBER AC_CACHE_CHECK([for gettimeofday with POSIX signature], [gl_cv_func_gettimeofday_posix_signature], [AC_COMPILE_IFELSE( @@ -66,63 +65,5 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); declaration of the second argument to gettimeofday.]) ]) - -dnl See if gettimeofday clobbers the static buffer that localtime uses -dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 -dnl (i.e., Darwin 1.3.7) has this problem. -dnl -dnl If it does, then arrange to use gettimeofday and localtime only via -dnl the wrapper functions that work around the problem. - -AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], -[ - AC_REQUIRE([gl_HEADER_SYS_TIME_H]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) - - AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], - [gl_cv_func_gettimeofday_clobber], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include - #include - #include - ]], - [[ - time_t t = 0; - struct tm *lt; - struct tm saved_lt; - struct timeval tv; - lt = localtime (&t); - saved_lt = *lt; - gettimeofday (&tv, NULL); - return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; - ]])], - [gl_cv_func_gettimeofday_clobber=no], - [gl_cv_func_gettimeofday_clobber=yes], - [# When cross-compiling: - case "$host_os" in - # Guess all is fine on glibc systems. - *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; - # Guess all is fine on musl systems. - *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;; - esac - ])]) - - case "$gl_cv_func_gettimeofday_clobber" in - *yes) - REPLACE_GETTIMEOFDAY=1 - AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], - [Define if gettimeofday clobbers the localtime buffer.]) - gl_LOCALTIME_BUFFER_NEEDED - ;; - esac -]) - # Prerequisites of lib/gettimeofday.c. AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index f4ba5e3a00d..57f3a780118 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 50 +# gnulib-common.m4 serial 52 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -120,9 +120,14 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif /* Avoid __attribute__ ((cold)) on MinGW; see thread starting at - . */ + . + Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */ #if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__ -# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__)) +# ifndef __SUNPRO_C +# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__)) +# else +# define _GL_ATTRIBUTE_COLD __attribute__ ((cold)) +# endif #else # define _GL_ATTRIBUTE_COLD #endif @@ -176,7 +181,8 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_LEAF #endif -#if _GL_HAS_ATTRIBUTE (may_alias) +/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */ +#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C # define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) #else # define _GL_ATTRIBUTE_MAY_ALIAS @@ -292,6 +298,20 @@ AC_DEFUN([gl_COMMON_BODY], [ that may clobber errno, it needs to save and restore the value of errno. */ #define _GL_ASYNC_SAFE +]) + AH_VERBATIM([micro_optimizations], +[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2. + It returns + 1 if n1 > n2 + 0 if n1 == n2 + -1 if n1 < n2 + The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional + jump with nearly all GCC versions up to GCC 10. + This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many + GCC versions up to GCC 9. + The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9 + avoids conditional jumps in all GCC versions >= 3.4. */ +#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2))) ]) dnl Hint which direction to take regarding cross-compilation guesses: dnl When a user installs a program on a platform they are not intimately @@ -612,6 +632,15 @@ AC_DEFUN([gl_BIGENDIAN], AC_C_BIGENDIAN ]) +# gl_SILENT(command) +# executes command, but without the normal configure output. +AC_DEFUN([gl_SILENT], +[ + { + $1 + } AS_MESSAGE_FD>/dev/null +]) + # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not # output a spurious "(cached)" mark in the midst of other configure output. diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index f577a6fa741..4472af81b70 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -120,7 +120,6 @@ AC_DEFUN([gl_EARLY], # Code from module libc-config: # Code from module libgmp: # Code from module limits-h: - # Code from module localtime-buffer: # Code from module lstat: # Code from module malloca: # Code from module manywarnings: @@ -508,7 +507,6 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false gl_gnulib_enabled_lchmod=false - gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false gl_gnulib_enabled_malloca=false gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false gl_gnulib_enabled_open=false @@ -624,14 +622,6 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_lchmod=true fi } - func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 () - { - if ! $gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9; then - AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) - AC_LIBOBJ([localtime-buffer]) - gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=true - fi - } func_gl_gnulib_m4code_malloca () { if ! $gl_gnulib_enabled_malloca; then @@ -751,9 +741,6 @@ AC_DEFUN([gl_INIT], if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then func_gl_gnulib_m4code_open fi - if test $NEED_LOCALTIME_BUFFER = 1; then - func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 - fi if test $HAVE_READLINKAT = 0; then func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b fi @@ -785,7 +772,6 @@ AC_DEFUN([gl_INIT], AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod]) - AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9]) AM_CONDITIONAL([gl_GNULIB_ENABLED_malloca], [$gl_gnulib_enabled_malloca]) AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open]) @@ -1030,8 +1016,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/lchmod.c lib/libc-config.h lib/limits.in.h - lib/localtime-buffer.c - lib/localtime-buffer.h lib/lstat.c lib/malloca.c lib/malloca.h @@ -1176,7 +1160,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/lchmod.m4 m4/libgmp.m4 m4/limits-h.m4 - m4/localtime-buffer.m4 m4/lstat.m4 m4/malloca.m4 m4/manywarnings-c++.m4 diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 224d0cdd8e2..28bac816b69 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 29 +# inttypes.m4 serial 31 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,12 +35,19 @@ AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], # Ensure that the PRI* and SCN* macros are defined appropriately. AC_DEFUN([gl_INTTYPES_PRI_SCN], [ - AC_REQUIRE([gt_INTTYPES_PRI]) - PRIPTR_PREFIX= if test -n "$STDINT_H"; then - dnl Using the gnulib . It always defines intptr_t to 'long'. - PRIPTR_PREFIX='"l"' + dnl Using the gnulib . It defines intptr_t to 'long' or + dnl 'long long', depending on _WIN64. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifdef _WIN64 + LLP64 + #endif + ]]), + ], + [PRIPTR_PREFIX='"l"'], + [PRIPTR_PREFIX='"ll"']) else dnl Using the system's . for glpfx in '' l ll I64; do @@ -152,7 +159,6 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS], REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) - PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) diff --git a/m4/libgmp.m4 b/m4/libgmp.m4 index b569bb73462..82c065e2c2c 100644 --- a/m4/libgmp.m4 +++ b/m4/libgmp.m4 @@ -1,44 +1,67 @@ +# libgmp.m4 serial 4 # Configure the GMP library or a replacement. - dnl Copyright 2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl gl_LIBGMP +dnl Search for an installed libgmp. +dnl If found, set and AC_SUBST HAVE_LIBGMP=yes and the LIBGMP and LTLIBGMP +dnl variables, and augment the CPPFLAGS variable, and #define HAVE_LIBGMP to 1. +dnl Otherwise, set and AC_SUBST HAVE_LIBGMP=no and LIBGMP and LTLIBGMP to +dnl empty. + AC_DEFUN([gl_LIBGMP], [ AC_ARG_WITH([libgmp], [AS_HELP_STRING([--without-libgmp], [do not use the GNU Multiple Precision (GMP) library; this is the default on systems lacking libgmp.])]) - - AC_CHECK_HEADERS_ONCE([gmp.h]) - GMP_H=gmp.h - LIB_GMP= - - case $with_libgmp in - no) ;; - yes) GMP_H= LIB_GMP=-lgmp;; - *) if test "$ac_cv_header_gmp_h" = yes; then - gl_saved_LIBS=$LIBS + case "$with_libgmp" in + no) + HAVE_LIBGMP=no + LIBGMP= + LTLIBGMP= + ;; + *) + dnl Prefer AC_LIB_HAVE_LINKFLAGS if the havelib module is also in use. + m4_ifdef([gl_HAVE_MODULE_HAVELIB], + [AC_LIB_HAVE_LINKFLAGS([gmp], [], + [#include ], + [static const mp_limb_t x[2] = { 0x73, 0x55 }; + mpz_t tmp; + mpz_roinit_n (tmp, x, 2); + ], + [no])], + [gl_saved_LIBS=$LIBS AC_SEARCH_LIBS([__gmpz_roinit_n], [gmp]) LIBS=$gl_saved_LIBS case $ac_cv_search___gmpz_roinit_n in 'none needed') - GMP_H=;; + HAVE_LIBGMP=yes LIBGMP=;; -*) - GMP_H= LIB_GMP=$ac_cv_search___gmpz_roinit_n;; + HAVE_LIBGMP=yes LIBGMP=$ac_cv_search___gmpz_roinit_n;; + *) + HAVE_LIBGMP=no LIBGMP=;; esac - fi;; + LTLIBGMP=$LIBGMP + AC_SUBST([HAVE_LIBGMP]) + AC_SUBST([LIBGMP]) + AC_SUBST([LTLIBGMP])]) + if test "$with_libgmp,$HAVE_LIBGMP" = yes,no; then + AC_MSG_ERROR( + [GMP not found, although --with-libgmp was specified.m4_ifdef( + [AC_LIB_HAVE_LINKFLAGS], + [ Try specifying --with-libgmp-prefix=DIR.])]) + fi + ;; esac - - if test -z "$GMP_H"; then - AC_DEFINE([HAVE_GMP], 1, - [Define to 1 if you have the GMP library instead of just the - mini-gmp replacement.]) + if test $HAVE_LIBGMP = yes; then + GMP_H= + else + GMP_H=gmp.h fi - - AC_SUBST([LIB_GMP]) AC_SUBST([GMP_H]) AM_CONDITIONAL([GL_GENERATE_GMP_H], [test -n "$GMP_H"]) ]) diff --git a/m4/mktime.m4 b/m4/mktime.m4 index c00843f0f40..8d9b827fe21 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,4 +1,4 @@ -# serial 31 +# serial 32 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -33,15 +33,15 @@ AC_DEFUN([gl_FUNC_MKTIME_WORKS], AC_CHECK_DECLS_ONCE([alarm]) AC_CHECK_FUNCS_ONCE([tzset]) AC_REQUIRE([gl_MULTIARCH]) - if test $APPLE_UNIVERSAL_BUILD = 1; then - # A universal build on Apple Mac OS X platforms. - # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. - # But we need a configuration result that is valid in both modes. - gl_cv_func_working_mktime=no - fi AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime], - [AC_RUN_IFELSE( - [AC_LANG_SOURCE( + [if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple Mac OS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + gl_cv_func_working_mktime="guessing no" + else + AC_RUN_IFELSE( + [AC_LANG_SOURCE( [[/* Test program from Paul Eggert and Tony Leneis. */ #include #include @@ -242,14 +242,15 @@ main () result |= 64; return result; }]])], - [gl_cv_func_working_mktime=yes], - [gl_cv_func_working_mktime=no], - [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_working_mktime="guessing no" ;; - *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; - esac - ]) + [gl_cv_func_working_mktime=yes], + [gl_cv_func_working_mktime=no], + [case "$host_os" in + # Guess no on native Windows. + mingw*) gl_cv_func_working_mktime="guessing no" ;; + *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; + esac + ]) + fi ]) ]) diff --git a/m4/multiarch.m4 b/m4/multiarch.m4 index 3c2034c5e00..2c61afbd76e 100644 --- a/m4/multiarch.m4 +++ b/m4/multiarch.m4 @@ -1,4 +1,4 @@ -# multiarch.m4 serial 7 +# multiarch.m4 serial 9 dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,37 +21,40 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN_ONCE([gl_MULTIARCH], [ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. - gl_cv_c_multiarch=no - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - ]])], - [ - dnl Check for potential -arch flags. It is not universal unless - dnl there are at least two -arch flags with different values. - arch= - prev= - for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do - if test -n "$prev"; then - case $word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$arch" || test "$arch" = "$word"; then - arch="$word" - else - gl_cv_c_multiarch=yes - fi - ;; - esac - prev= - else - if test "x$word" = "x-arch"; then - prev=arch - fi - fi - done + AC_CACHE_CHECK([whether the compiler produces multi-arch binaries], + [gl_cv_c_multiarch], + [gl_cv_c_multiarch=no + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + ]])], + [ + dnl Check for potential -arch flags. It is not universal unless + dnl there are at least two -arch flags with different values. + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64 | arm | arm64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + ]) ]) if test $gl_cv_c_multiarch = yes; then APPLE_UNIVERSAL_BUILD=1 diff --git a/src/Makefile.in b/src/Makefile.in index 72d69fb7a3e..7141f16ec25 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -323,7 +323,7 @@ INTERVALS_H = dispextern.h intervals.h composite.h GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ -LIB_GMP = @LIB_GMP@ +LIBGMP = @LIBGMP@ RUN_TEMACS = ./temacs @@ -530,7 +530,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(HARFBUZZ_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(GETADDRINFO_A_LIBS) $(LCMS2_LIBS) \ $(NOTIFY_LIBS) $(LIB_MATH) $(LIBZ) $(LIBMODULES) $(LIBSYSTEMD_LIBS) \ - $(JSON_LIBS) $(LIB_GMP) + $(JSON_LIBS) $(LIBGMP) ## FORCE it so that admin/unidata can decide whether this file is ## up-to-date. Although since charprop depends on bootstrap-emacs, diff --git a/test/Makefile.in b/test/Makefile.in index c4840670e61..d1da02e582c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -256,7 +256,7 @@ FPIC_CFLAGS = -fPIC endif GMP_H = @GMP_H@ -LIB_GMP = @LIB_GMP@ +LIBGMP = @LIBGMP@ MODULE_CFLAGS = -I../src -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib \ $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ @@ -271,7 +271,7 @@ src/emacs-module-tests.log src/emacs-module-tests.elc: $(test_module) $(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h $(AM_V_at)${MKDIR_P} $(dir $@) $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ - -o $@ $< $(LIB_GMP) \ + -o $@ $< $(LIBGMP) \ $(and $(GMP_H),$(srcdir)/../lib/mini-gmp-gnulib.c) \ $(srcdir)/../lib/timespec.c $(srcdir)/../lib/gettime.c endif -- 2.39.2