diff options
author | Paul E. Murphy <murphyp@linux.ibm.com> | 2021-01-22 13:55:45 -0600 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-02-05 13:35:20 -0500 |
commit | 9c9d63b15ad548f65f8bfd41cb7a4ef9af5ccb28 (patch) | |
tree | d232965a0537906ce89ec096cd97ac943991a6b7 /gnulib/import | |
parent | 0110ec824ef40f3f08b8670bdfa2160d157e2000 (diff) | |
download | gdb-9c9d63b15ad548f65f8bfd41cb7a4ef9af5ccb28.zip gdb-9c9d63b15ad548f65f8bfd41cb7a4ef9af5ccb28.tar.gz gdb-9c9d63b15ad548f65f8bfd41cb7a4ef9af5ccb28.tar.bz2 |
gnulib: update to 776af40e0
This fixes PR27184, a failure to compile gdb due to
cdefs.h being out of sync with glibc on ppc64le targets
which are compiled with -mabi=ieeelongdouble and glibc
2.32.
Likewise, update usage of _GL_ATTRIBUTE_FORMAT_PRINTF to
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD.
Likewise, disable newly added rpl_free gnulib api in
gdbserver support libraries.
Likewise, undefine read/write macros before redefining them
on mingw targets.
Likewise, wrap C++ usage of free with GNULIB_NAMESPACE namespace
as needed.
Change-Id: I86517613c0d8ac8f5ea45bbc4ebe2b54a3aef29f
Diffstat (limited to 'gnulib/import')
387 files changed, 5403 insertions, 3310 deletions
diff --git a/gnulib/import/Makefile.am b/gnulib/import/Makefile.am index 84de424..de8d7de 100644 --- a/gnulib/import/Makefile.am +++ b/gnulib/import/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # 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 @@ -103,7 +103,7 @@ EXTRA_libgnu_a_SOURCES = # Use this preprocessor expression to decide whether #include_next works. # Do not rely on a 'configure'-time test for this, since the expression # might appear in an installed header, which is used by some other compiler. -HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) +HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER) ## end gnulib module absolute-header @@ -198,6 +198,14 @@ EXTRA_DIST += attribute.h ## end gnulib module attribute +## begin gnulib module basename-lgpl + +libgnu_a_SOURCES += basename-lgpl.c + +EXTRA_DIST += basename-lgpl.h + +## end gnulib module basename-lgpl + ## begin gnulib module btowc @@ -345,7 +353,7 @@ EXTRA_libgnu_a_SOURCES += dirfd.c ## begin gnulib module dirname-lgpl -libgnu_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c +libgnu_a_SOURCES += dirname-lgpl.c stripslash.c EXTRA_DIST += dirname.h @@ -369,6 +377,13 @@ EXTRA_libgnu_a_SOURCES += dup2.c ## end gnulib module dup2 +## begin gnulib module eloop-threshold + + +EXTRA_DIST += eloop-threshold.h + +## end gnulib module eloop-threshold + ## begin gnulib module errno BUILT_SOURCES += $(ERRNO_H) @@ -457,6 +472,8 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's/@''GNULIB_MDA_CREAT''@/$(GNULIB_MDA_CREAT)/g' \ + -e 's/@''GNULIB_MDA_OPEN''@/$(GNULIB_MDA_OPEN)/g' \ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \ @@ -560,6 +577,15 @@ EXTRA_libgnu_a_SOURCES += fnmatch.c fnmatch_loop.c ## end gnulib module fnmatch +## begin gnulib module fnmatch-gnu + + +EXTRA_DIST += fnmatch.c + +EXTRA_libgnu_a_SOURCES += fnmatch.c + +## end gnulib module fnmatch-gnu + ## begin gnulib module fnmatch-h BUILT_SOURCES += $(FNMATCH_H) @@ -601,6 +627,15 @@ EXTRA_DIST += fpucw.h ## end gnulib module fpucw +## begin gnulib module free-posix + + +EXTRA_DIST += free.c + +EXTRA_libgnu_a_SOURCES += free.c + +## end gnulib module free-posix + ## begin gnulib module frexp @@ -756,6 +791,12 @@ EXTRA_DIST += hard-locale.h ## end gnulib module hard-locale +## begin gnulib module idx + +libgnu_a_SOURCES += idx.h + +## end gnulib module idx + ## begin gnulib module inet_ntop @@ -786,7 +827,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' \ @@ -927,15 +967,6 @@ EXTRA_DIST += locale.in.h ## end gnulib module locale -## begin gnulib module localtime-buffer - - -EXTRA_DIST += localtime-buffer.c localtime-buffer.h - -EXTRA_libgnu_a_SOURCES += localtime-buffer.c - -## end gnulib module localtime-buffer - ## begin gnulib module lock libgnu_a_SOURCES += glthread/lock.h glthread/lock.c @@ -1079,6 +1110,12 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + -e 's/@''GNULIB_MDA_J0''@/$(GNULIB_MDA_J0)/g' \ + -e 's/@''GNULIB_MDA_J1''@/$(GNULIB_MDA_J1)/g' \ + -e 's/@''GNULIB_MDA_JN''@/$(GNULIB_MDA_JN)/g' \ + -e 's/@''GNULIB_MDA_Y0''@/$(GNULIB_MDA_Y0)/g' \ + -e 's/@''GNULIB_MDA_Y1''@/$(GNULIB_MDA_Y1)/g' \ + -e 's/@''GNULIB_MDA_YN''@/$(GNULIB_MDA_YN)/g' \ | \ sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ @@ -1247,7 +1284,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ - -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \ -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ @@ -1313,6 +1350,15 @@ EXTRA_libgnu_a_SOURCES += memchr.c ## end gnulib module memchr +## begin gnulib module memmem + + +EXTRA_DIST += memmem.c + +EXTRA_libgnu_a_SOURCES += memmem.c + +## end gnulib module memmem + ## begin gnulib module memmem-simple @@ -1469,6 +1515,15 @@ EXTRA_DIST += pathmax.h ## end gnulib module pathmax +## begin gnulib module pipe-posix + + +EXTRA_DIST += pipe.c + +EXTRA_libgnu_a_SOURCES += pipe.c + +## end gnulib module pipe-posix + ## begin gnulib module rawmemchr @@ -1549,7 +1604,7 @@ EXTRA_DIST += save-cwd.h ## begin gnulib module scratch_buffer -libgnu_a_SOURCES += malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c +libgnu_a_SOURCES += malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h @@ -1875,8 +1930,15 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \ + -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \ + -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \ + -e 's/@''GNULIB_MDA_GETW''@/$(GNULIB_MDA_GETW)/g' \ + -e 's/@''GNULIB_MDA_PUTW''@/$(GNULIB_MDA_PUTW)/g' \ + -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GNULIB_MDA_TEMPNAM)/g' \ < $(srcdir)/stdio.in.h | \ - sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \ + -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ @@ -1952,9 +2014,11 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GNULIB_ALIGNED_ALLOC)/g' \ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ @@ -1965,6 +2029,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GNULIB_POSIX_MEMALIGN)/g' \ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ @@ -1986,10 +2051,19 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + -e 's/@''GNULIB_MDA_ECVT''@/$(GNULIB_MDA_ECVT)/g' \ + -e 's/@''GNULIB_MDA_FCVT''@/$(GNULIB_MDA_FCVT)/g' \ + -e 's/@''GNULIB_MDA_GCVT''@/$(GNULIB_MDA_GCVT)/g' \ + -e 's/@''GNULIB_MDA_MKTEMP''@/$(GNULIB_MDA_MKTEMP)/g' \ + -e 's/@''GNULIB_MDA_PUTENV''@/$(GNULIB_MDA_PUTENV)/g' \ < $(srcdir)/stdlib.in.h | \ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \ + -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \ + -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ @@ -2001,6 +2075,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ @@ -2023,12 +2098,15 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ @@ -2157,14 +2235,18 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ + -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ + -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GNULIB_MDA_MEMCCPY)/g' \ + -e 's/@''GNULIB_MDA_STRDUP''@/$(GNULIB_MDA_STRDUP)/g' \ < $(srcdir)/string.in.h | \ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ - -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -2180,8 +2262,12 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ + -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ + -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ @@ -2195,6 +2281,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -2224,6 +2311,15 @@ libgnu_a_SOURCES += strnlen1.h strnlen1.c ## end gnulib module strnlen1 +## begin gnulib module strstr + + +EXTRA_DIST += strstr.c + +EXTRA_libgnu_a_SOURCES += strstr.c + +## end gnulib module strstr + ## begin gnulib module strstr-simple @@ -2347,8 +2443,10 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_GETUMASK''@/$(GNULIB_GETUMASK)/g' \ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIR''@/$(GNULIB_MKDIR)/g' \ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ @@ -2357,9 +2455,13 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's/@''GNULIB_MDA_CHMOD''@/$(GNULIB_MDA_CHMOD)/g' \ + -e 's/@''GNULIB_MDA_MKDIR''@/$(GNULIB_MDA_MKDIR)/g' \ + -e 's/@''GNULIB_MDA_UMASK''@/$(GNULIB_MDA_UMASK)/g' \ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ @@ -2375,7 +2477,9 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -2512,15 +2616,17 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIMESPEC_GET''@/$(GNULIB_TIMESPEC_GET)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's/@''GNULIB_MDA_TZSET''@/$(GNULIB_MDA_TZSET)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ - -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ @@ -2534,6 +2640,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @@ -2582,6 +2689,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_EXECL''@/$(GNULIB_EXECL)/g' \ + -e 's/@''GNULIB_EXECLE''@/$(GNULIB_EXECLE)/g' \ + -e 's/@''GNULIB_EXECLP''@/$(GNULIB_EXECLP)/g' \ + -e 's/@''GNULIB_EXECV''@/$(GNULIB_EXECV)/g' \ + -e 's/@''GNULIB_EXECVE''@/$(GNULIB_EXECVE)/g' \ + -e 's/@''GNULIB_EXECVP''@/$(GNULIB_EXECVP)/g' \ + -e 's/@''GNULIB_EXECVPE''@/$(GNULIB_EXECVPE)/g' \ -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ @@ -2627,12 +2741,33 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + -e 's/@''GNULIB_MDA_ACCESS''@/$(GNULIB_MDA_ACCESS)/g' \ + -e 's/@''GNULIB_MDA_CHDIR''@/$(GNULIB_MDA_CHDIR)/g' \ + -e 's/@''GNULIB_MDA_CLOSE''@/$(GNULIB_MDA_CLOSE)/g' \ + -e 's/@''GNULIB_MDA_DUP''@/$(GNULIB_MDA_DUP)/g' \ + -e 's/@''GNULIB_MDA_DUP2''@/$(GNULIB_MDA_DUP2)/g' \ + -e 's/@''GNULIB_MDA_EXECL''@/$(GNULIB_MDA_EXECL)/g' \ + -e 's/@''GNULIB_MDA_EXECLE''@/$(GNULIB_MDA_EXECLE)/g' \ + -e 's/@''GNULIB_MDA_EXECLP''@/$(GNULIB_MDA_EXECLP)/g' \ + -e 's/@''GNULIB_MDA_EXECV''@/$(GNULIB_MDA_EXECV)/g' \ + -e 's/@''GNULIB_MDA_EXECVE''@/$(GNULIB_MDA_EXECVE)/g' \ + -e 's/@''GNULIB_MDA_EXECVP''@/$(GNULIB_MDA_EXECVP)/g' \ + -e 's/@''GNULIB_MDA_EXECVPE''@/$(GNULIB_MDA_EXECVPE)/g' \ + -e 's/@''GNULIB_MDA_GETCWD''@/$(GNULIB_MDA_GETCWD)/g' \ + -e 's/@''GNULIB_MDA_GETPID''@/$(GNULIB_MDA_GETPID)/g' \ + -e 's/@''GNULIB_MDA_ISATTY''@/$(GNULIB_MDA_ISATTY)/g' \ + -e 's/@''GNULIB_MDA_LSEEK''@/$(GNULIB_MDA_LSEEK)/g' \ + -e 's/@''GNULIB_MDA_READ''@/$(GNULIB_MDA_READ)/g' \ + -e 's/@''GNULIB_MDA_RMDIR''@/$(GNULIB_MDA_RMDIR)/g' \ + -e 's/@''GNULIB_MDA_SWAB''@/$(GNULIB_MDA_SWAB)/g' \ + -e 's/@''GNULIB_MDA_UNLINK''@/$(GNULIB_MDA_UNLINK)/g' \ + -e 's/@''GNULIB_MDA_WRITE''@/$(GNULIB_MDA_WRITE)/g' \ < $(srcdir)/unistd.in.h | \ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ - -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ @@ -2662,6 +2797,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ @@ -2680,6 +2816,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ + -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \ + -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \ + -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \ + -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \ + -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \ + -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ @@ -2814,6 +2957,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + -e 's/@''GNULIB_MDA_WCSDUP''@/$(GNULIB_MDA_WCSDUP)/g' \ < $(srcdir)/wchar.in.h | \ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ @@ -2856,6 +3000,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ | \ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ diff --git a/gnulib/import/Makefile.in b/gnulib/import/Makefile.in index 476cde8..224a517 100644 --- a/gnulib/import/Makefile.in +++ b/gnulib/import/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # 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 @@ -178,6 +178,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/builtin-expect.m4 \ $(top_srcdir)/import/m4/canonicalize.m4 \ $(top_srcdir)/import/m4/chdir-long.m4 \ + $(top_srcdir)/import/m4/clock_time.m4 \ $(top_srcdir)/import/m4/close.m4 \ $(top_srcdir)/import/m4/closedir.m4 \ $(top_srcdir)/import/m4/codeset.m4 \ @@ -186,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/d-type.m4 \ $(top_srcdir)/import/m4/dirent_h.m4 \ $(top_srcdir)/import/m4/dirfd.m4 \ - $(top_srcdir)/import/m4/dirname.m4 \ $(top_srcdir)/import/m4/double-slash-root.m4 \ $(top_srcdir)/import/m4/dup.m4 $(top_srcdir)/import/m4/dup2.m4 \ $(top_srcdir)/import/m4/eealloc.m4 \ @@ -208,6 +208,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/fnmatch.m4 \ $(top_srcdir)/import/m4/fnmatch_h.m4 \ $(top_srcdir)/import/m4/fpieee.m4 \ + $(top_srcdir)/import/m4/free.m4 \ $(top_srcdir)/import/m4/frexp.m4 \ $(top_srcdir)/import/m4/frexpl.m4 \ $(top_srcdir)/import/m4/fstat.m4 \ @@ -228,7 +229,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/gnulib-comp.m4 \ $(top_srcdir)/import/m4/include_next.m4 \ $(top_srcdir)/import/m4/inet_ntop.m4 \ - $(top_srcdir)/import/m4/inttypes-pri.m4 \ $(top_srcdir)/import/m4/inttypes.m4 \ $(top_srcdir)/import/m4/isblank.m4 \ $(top_srcdir)/import/m4/isnand.m4 \ @@ -240,7 +240,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/locale-ja.m4 \ $(top_srcdir)/import/m4/locale-zh.m4 \ $(top_srcdir)/import/m4/locale_h.m4 \ - $(top_srcdir)/import/m4/localtime-buffer.m4 \ $(top_srcdir)/import/m4/lock.m4 \ $(top_srcdir)/import/m4/lstat.m4 \ $(top_srcdir)/import/m4/malloc.m4 \ @@ -273,6 +272,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/openat.m4 \ $(top_srcdir)/import/m4/opendir.m4 \ $(top_srcdir)/import/m4/pathmax.m4 \ + $(top_srcdir)/import/m4/pid_t.m4 \ + $(top_srcdir)/import/m4/pipe.m4 \ $(top_srcdir)/import/m4/pthread_rwlock_rdlock.m4 \ $(top_srcdir)/import/m4/rawmemchr.m4 \ $(top_srcdir)/import/m4/readdir.m4 \ @@ -341,15 +342,16 @@ am__v_AR_1 = libgnu_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = am__dirstamp = $(am__leading_dot)dirstamp -am_libgnu_a_OBJECTS = openat-proc.$(OBJEXT) cloexec.$(OBJEXT) \ - count-one-bits.$(OBJEXT) dirname-lgpl.$(OBJEXT) \ - basename-lgpl.$(OBJEXT) stripslash.$(OBJEXT) \ - exitfail.$(OBJEXT) fd-hook.$(OBJEXT) fd-safer-flag.$(OBJEXT) \ +am_libgnu_a_OBJECTS = openat-proc.$(OBJEXT) basename-lgpl.$(OBJEXT) \ + cloexec.$(OBJEXT) count-one-bits.$(OBJEXT) \ + dirname-lgpl.$(OBJEXT) stripslash.$(OBJEXT) exitfail.$(OBJEXT) \ + fd-hook.$(OBJEXT) fd-safer-flag.$(OBJEXT) \ dup-safer-flag.$(OBJEXT) filenamecat-lgpl.$(OBJEXT) \ getprogname.$(OBJEXT) hard-locale.$(OBJEXT) \ localcharset.$(OBJEXT) glthread/lock.$(OBJEXT) \ malloca.$(OBJEXT) math.$(OBJEXT) openat-die.$(OBJEXT) \ - save-cwd.$(OBJEXT) malloc/scratch_buffer_grow.$(OBJEXT) \ + save-cwd.$(OBJEXT) malloc/scratch_buffer_dupfree.$(OBJEXT) \ + malloc/scratch_buffer_grow.$(OBJEXT) \ malloc/scratch_buffer_grow_preserve.$(OBJEXT) \ malloc/scratch_buffer_set_array_size.$(OBJEXT) \ setlocale_null.$(OBJEXT) stat-time.$(OBJEXT) \ @@ -477,6 +479,7 @@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ACCESS = @GNULIB_ACCESS@ GNULIB_ACOSF = @GNULIB_ACOSF@ GNULIB_ACOSL = @GNULIB_ACOSL@ +GNULIB_ALIGNED_ALLOC = @GNULIB_ALIGNED_ALLOC@ GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ GNULIB_ASINF = @GNULIB_ASINF@ GNULIB_ASINL = @GNULIB_ASINL@ @@ -516,6 +519,13 @@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_EXECL = @GNULIB_EXECL@ +GNULIB_EXECLE = @GNULIB_EXECLE@ +GNULIB_EXECLP = @GNULIB_EXECLP@ +GNULIB_EXECV = @GNULIB_EXECV@ +GNULIB_EXECVE = @GNULIB_EXECVE@ +GNULIB_EXECVP = @GNULIB_EXECVP@ +GNULIB_EXECVPE = @GNULIB_EXECVPE@ GNULIB_EXP2 = @GNULIB_EXP2@ GNULIB_EXP2F = @GNULIB_EXP2F@ GNULIB_EXP2L = @GNULIB_EXP2L@ @@ -558,6 +568,7 @@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREE_POSIX = @GNULIB_FREE_POSIX@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPF = @GNULIB_FREXPF@ @@ -595,6 +606,7 @@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUMASK = @GNULIB_GETUMASK@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GLOB = @GNULIB_GLOB@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ @@ -669,10 +681,58 @@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MDA_ACCESS = @GNULIB_MDA_ACCESS@ +GNULIB_MDA_CHDIR = @GNULIB_MDA_CHDIR@ +GNULIB_MDA_CHMOD = @GNULIB_MDA_CHMOD@ +GNULIB_MDA_CLOSE = @GNULIB_MDA_CLOSE@ +GNULIB_MDA_CREAT = @GNULIB_MDA_CREAT@ +GNULIB_MDA_DUP = @GNULIB_MDA_DUP@ +GNULIB_MDA_DUP2 = @GNULIB_MDA_DUP2@ +GNULIB_MDA_ECVT = @GNULIB_MDA_ECVT@ +GNULIB_MDA_EXECL = @GNULIB_MDA_EXECL@ +GNULIB_MDA_EXECLE = @GNULIB_MDA_EXECLE@ +GNULIB_MDA_EXECLP = @GNULIB_MDA_EXECLP@ +GNULIB_MDA_EXECV = @GNULIB_MDA_EXECV@ +GNULIB_MDA_EXECVE = @GNULIB_MDA_EXECVE@ +GNULIB_MDA_EXECVP = @GNULIB_MDA_EXECVP@ +GNULIB_MDA_EXECVPE = @GNULIB_MDA_EXECVPE@ +GNULIB_MDA_FCLOSEALL = @GNULIB_MDA_FCLOSEALL@ +GNULIB_MDA_FCVT = @GNULIB_MDA_FCVT@ +GNULIB_MDA_FDOPEN = @GNULIB_MDA_FDOPEN@ +GNULIB_MDA_FILENO = @GNULIB_MDA_FILENO@ +GNULIB_MDA_GCVT = @GNULIB_MDA_GCVT@ +GNULIB_MDA_GETCWD = @GNULIB_MDA_GETCWD@ +GNULIB_MDA_GETPID = @GNULIB_MDA_GETPID@ +GNULIB_MDA_GETW = @GNULIB_MDA_GETW@ +GNULIB_MDA_ISATTY = @GNULIB_MDA_ISATTY@ +GNULIB_MDA_J0 = @GNULIB_MDA_J0@ +GNULIB_MDA_J1 = @GNULIB_MDA_J1@ +GNULIB_MDA_JN = @GNULIB_MDA_JN@ +GNULIB_MDA_LSEEK = @GNULIB_MDA_LSEEK@ +GNULIB_MDA_MEMCCPY = @GNULIB_MDA_MEMCCPY@ +GNULIB_MDA_MKDIR = @GNULIB_MDA_MKDIR@ +GNULIB_MDA_MKTEMP = @GNULIB_MDA_MKTEMP@ +GNULIB_MDA_OPEN = @GNULIB_MDA_OPEN@ +GNULIB_MDA_PUTENV = @GNULIB_MDA_PUTENV@ +GNULIB_MDA_PUTW = @GNULIB_MDA_PUTW@ +GNULIB_MDA_READ = @GNULIB_MDA_READ@ +GNULIB_MDA_RMDIR = @GNULIB_MDA_RMDIR@ +GNULIB_MDA_STRDUP = @GNULIB_MDA_STRDUP@ +GNULIB_MDA_SWAB = @GNULIB_MDA_SWAB@ +GNULIB_MDA_TEMPNAM = @GNULIB_MDA_TEMPNAM@ +GNULIB_MDA_TZSET = @GNULIB_MDA_TZSET@ +GNULIB_MDA_UMASK = @GNULIB_MDA_UMASK@ +GNULIB_MDA_UNLINK = @GNULIB_MDA_UNLINK@ +GNULIB_MDA_WCSDUP = @GNULIB_MDA_WCSDUP@ +GNULIB_MDA_WRITE = @GNULIB_MDA_WRITE@ +GNULIB_MDA_Y0 = @GNULIB_MDA_Y0@ +GNULIB_MDA_Y1 = @GNULIB_MDA_Y1@ +GNULIB_MDA_YN = @GNULIB_MDA_YN@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIR = @GNULIB_MKDIR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ @@ -701,6 +761,7 @@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_MEMALIGN = @GNULIB_POSIX_MEMALIGN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_POWF = @GNULIB_POWF@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -754,7 +815,9 @@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETLOCALE_NULL = @GNULIB_SETLOCALE_NULL@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGABBREV_NP = @GNULIB_SIGABBREV_NP@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGDESCR_NP = @GNULIB_SIGDESCR_NP@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ @@ -776,6 +839,7 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERRORNAME_NP = @GNULIB_STRERRORNAME_NP@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRFTIME = @GNULIB_STRFTIME@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ @@ -801,6 +865,7 @@ GNULIB_TANF = @GNULIB_TANF@ GNULIB_TANHF = @GNULIB_TANHF@ GNULIB_TANL = @GNULIB_TANL@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIMESPEC_GET = @GNULIB_TIMESPEC_GET@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ @@ -873,6 +938,7 @@ GREP = @GREP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ACOSF = @HAVE_ACOSF@ HAVE_ACOSL = @HAVE_ACOSL@ +HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@ HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ HAVE_ALPHASORT = @HAVE_ALPHASORT@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ @@ -907,13 +973,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ECVT = @HAVE_DECL_ECVT@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@ HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@ +HAVE_DECL_FCVT = @HAVE_DECL_FCVT@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@ HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ @@ -922,6 +992,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GCVT = @HAVE_DECL_GCVT@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ @@ -974,14 +1045,15 @@ HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DIRENT_H = @HAVE_DIRENT_H@ HAVE_DPRINTF = @HAVE_DPRINTF@ -HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXECVPE = @HAVE_EXECVPE@ HAVE_EXPF = @HAVE_EXPF@ HAVE_EXPL = @HAVE_EXPL@ HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ @@ -1024,6 +1096,7 @@ HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETRANDOM = @HAVE_GETRANDOM@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GETUMASK = @HAVE_GETUMASK@ HAVE_GLOB = @HAVE_GLOB@ HAVE_GLOB_H = @HAVE_GLOB_H@ HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@ @@ -1066,7 +1139,6 @@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MBTOWC = @HAVE_MBTOWC@ -HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ @@ -1091,6 +1163,7 @@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_POWF = @HAVE_POWF@ @@ -1124,7 +1197,9 @@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SETSTATE = @HAVE_SETSTATE@ +HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ @@ -1142,6 +1217,7 @@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ @@ -1170,9 +1246,9 @@ HAVE_TANF = @HAVE_TANF@ HAVE_TANHF = @HAVE_TANHF@ HAVE_TANL = @HAVE_TANL@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ -HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -1247,6 +1323,7 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBSTDTHREAD = @LIBSTDTHREAD@ LIBTHREAD = @LIBTHREAD@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_GETLOGIN = @LIB_GETLOGIN@ LIB_GETRANDOM = @LIB_GETRANDOM@ LIB_HARD_LOCALE = @LIB_HARD_LOCALE@ @@ -1338,12 +1415,12 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ -PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_ACCESS = @REPLACE_ACCESS@ REPLACE_ACOSF = @REPLACE_ACOSF@ +REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ REPLACE_ASINF = @REPLACE_ASINF@ REPLACE_ATAN2F = @REPLACE_ATAN2F@ REPLACE_ATANF = @REPLACE_ATANF@ @@ -1367,6 +1444,13 @@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_EXECL = @REPLACE_EXECL@ +REPLACE_EXECLE = @REPLACE_EXECLE@ +REPLACE_EXECLP = @REPLACE_EXECLP@ +REPLACE_EXECV = @REPLACE_EXECV@ +REPLACE_EXECVE = @REPLACE_EXECVE@ +REPLACE_EXECVP = @REPLACE_EXECVP@ +REPLACE_EXECVPE = @REPLACE_EXECVPE@ REPLACE_EXP2 = @REPLACE_EXP2@ REPLACE_EXP2L = @REPLACE_EXP2L@ REPLACE_EXPF = @REPLACE_EXPF@ @@ -1383,6 +1467,7 @@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FFSLL = @REPLACE_FFSLL@ REPLACE_FLOOR = @REPLACE_FLOOR@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -1396,6 +1481,7 @@ REPLACE_FNMATCH = @REPLACE_FNMATCH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREE = @REPLACE_FREE@ REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FREXP = @REPLACE_FREXP@ @@ -1478,7 +1564,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKNODAT = @REPLACE_MKNODAT@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_MODF = @REPLACE_MODF@ @@ -1494,6 +1582,7 @@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_OPENDIR = @REPLACE_OPENDIR@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ @@ -1525,7 +1614,7 @@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SETSTATE = @REPLACE_SETSTATE@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ -REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ +REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@ REPLACE_SINF = @REPLACE_SINF@ REPLACE_SINHF = @REPLACE_SINHF@ REPLACE_SLEEP = @REPLACE_SLEEP@ @@ -1541,6 +1630,7 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ @@ -1600,6 +1690,7 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ @@ -1680,40 +1771,41 @@ noinst_LIBRARIES = libgnu.a noinst_LTLIBRARIES = # No GNU Make output. EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h arpa_inet.in.h \ - assure.h attribute.h btowc.c canonicalize-lgpl.c chdir-long.c \ - chdir-long.h cloexec.h close.c closedir.c dirent-private.h \ - count-one-bits.h ctype.in.h dirent.in.h dirfd.c dirname.h \ - dup.c dup2.c errno.in.h error.c error.h exitfail.h fchdir.c \ - fcntl.c fcntl.in.h fd-hook.h fdopendir.c filename.h \ + assure.h attribute.h basename-lgpl.h btowc.c \ + canonicalize-lgpl.c chdir-long.c chdir-long.h cloexec.h \ + close.c closedir.c dirent-private.h count-one-bits.h \ + ctype.in.h dirent.in.h dirfd.c dirname.h dup.c dup2.c \ + eloop-threshold.h errno.in.h error.c error.h exitfail.h \ + fchdir.c fcntl.c fcntl.in.h fd-hook.h fdopendir.c filename.h \ filenamecat.h flexmember.h float.c float.in.h itold.c \ - fnmatch.c fnmatch_loop.c fnmatch.in.h fpucw.h frexp.c frexp.c \ - frexpl.c fstat.c stat-w32.c stat-w32.h at-func.c fstatat.c \ - getcwd.c getcwd-lgpl.c getdtablesize.c getlogin_r.c \ - getrandom.c gettimeofday.c glob.c glob_internal.h \ + fnmatch.c fnmatch_loop.c fnmatch.c fnmatch.in.h fpucw.h free.c \ + frexp.c frexp.c frexpl.c fstat.c stat-w32.c stat-w32.h \ + at-func.c fstatat.c getcwd.c getcwd-lgpl.c getdtablesize.c \ + getlogin_r.c getrandom.c gettimeofday.c glob.c glob_internal.h \ glob_pattern_p.c globfree.c glob-libc.h glob.in.h \ hard-locale.h inet_ntop.c intprops.h inttypes.in.h isblank.c \ float+.h isnan.c isnand-nolibm.h isnand.c float+.h isnan.c \ isnanl-nolibm.h isnanl.c cdefs.h libc-config.h limits.in.h \ - localcharset.h locale.in.h localtime-buffer.c \ - localtime-buffer.h lstat.c malloc.c malloca.h math.in.h \ - lc-charset-dispatch.c lc-charset-dispatch.h \ + localcharset.h locale.in.h lstat.c malloc.c malloca.h \ + math.in.h lc-charset-dispatch.c lc-charset-dispatch.h \ mbrtowc-impl-utf8.h mbrtowc-impl.h mbrtowc.c mbtowc-lock.c \ mbtowc-lock.h windows-initguard.h mbsinit.c mbsrtowcs-impl.h \ mbsrtowcs-state.c mbsrtowcs.c mbtowc-impl.h mbtowc.c memchr.c \ - memchr.valgrind memmem.c str-two-way.h mempcpy.c memrchr.c \ - mkdir.c mkdtemp.c mkostemp.c msvc-inval.c msvc-inval.h \ - msvc-nothrow.c msvc-nothrow.h netinet_in.in.h open.c openat.c \ - openat.h dirent-private.h opendir.c pathmax.h rawmemchr.c \ - rawmemchr.valgrind dirent-private.h readdir.c readlink.c \ - realloc.c rename.c dirent-private.h rewinddir.c rmdir.c \ - same-inode.h save-cwd.h malloc/scratch_buffer.h \ - scratch_buffer.h setenv.c setlocale-lock.c setlocale_null.h \ - windows-initguard.h signal.in.h _Noreturn.h arg-nonnull.h \ - c++defs.h warn-on-use.h stat-w32.c stat-w32.h stat.c \ - stat-time.h stdalign.in.h stdbool.in.h stddef.in.h stdint.in.h \ - stdio.in.h stdlib.in.h strchrnul.c strchrnul.valgrind strdup.c \ - streq.h strerror.c strerror-override.c strerror-override.h \ - strerror_r.c string.in.h strnlen.c str-two-way.h strstr.c \ + memchr.valgrind memmem.c memmem.c str-two-way.h mempcpy.c \ + memrchr.c mkdir.c mkdtemp.c mkostemp.c msvc-inval.c \ + msvc-inval.h msvc-nothrow.c msvc-nothrow.h netinet_in.in.h \ + open.c openat.c openat.h dirent-private.h opendir.c pathmax.h \ + pipe.c rawmemchr.c rawmemchr.valgrind dirent-private.h \ + readdir.c readlink.c realloc.c rename.c dirent-private.h \ + rewinddir.c rmdir.c same-inode.h save-cwd.h \ + malloc/scratch_buffer.h scratch_buffer.h setenv.c \ + setlocale-lock.c setlocale_null.h windows-initguard.h \ + signal.in.h _Noreturn.h arg-nonnull.h c++defs.h warn-on-use.h \ + stat-w32.c stat-w32.h stat.c stat-time.h stdalign.in.h \ + stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \ + strchrnul.c strchrnul.valgrind strdup.c streq.h strerror.c \ + strerror-override.c strerror-override.h strerror_r.c \ + string.in.h strnlen.c strstr.c str-two-way.h strstr.c \ strtok_r.c sys_random.in.h sys_socket.in.h sys_stat.in.h \ sys_time.in.h sys_types.in.h sys_uio.in.h tempname.h time.in.h \ time_r.c unistd.in.h unistd--.h unistd-safer.h unsetenv.c \ @@ -1749,12 +1841,13 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = AM_CFLAGS = -libgnu_a_SOURCES = openat-priv.h openat-proc.c cloexec.c \ - count-one-bits.c dirname-lgpl.c basename-lgpl.c stripslash.c \ +libgnu_a_SOURCES = openat-priv.h openat-proc.c basename-lgpl.c \ + cloexec.c count-one-bits.c dirname-lgpl.c stripslash.c \ exitfail.c fd-hook.c fd-safer-flag.c dup-safer-flag.c \ filenamecat-lgpl.c getprogname.h getprogname.c gettext.h \ - hard-locale.c localcharset.c glthread/lock.h glthread/lock.c \ - malloca.c math.c minmax.h openat-die.c save-cwd.c \ + hard-locale.c idx.h localcharset.c glthread/lock.h \ + glthread/lock.c malloca.c math.c minmax.h openat-die.c \ + save-cwd.c malloc/scratch_buffer_dupfree.c \ malloc/scratch_buffer_grow.c \ malloc/scratch_buffer_grow_preserve.c \ malloc/scratch_buffer_set_array_size.c setlocale_null.c \ @@ -1766,25 +1859,26 @@ libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ EXTRA_libgnu_a_SOURCES = alloca.c btowc.c canonicalize-lgpl.c \ chdir-long.c close.c closedir.c dirfd.c dup.c dup2.c error.c \ fchdir.c fcntl.c fdopendir.c float.c itold.c fnmatch.c \ - fnmatch_loop.c frexp.c frexp.c frexpl.c fstat.c stat-w32.c \ - at-func.c fstatat.c getcwd.c getcwd-lgpl.c getdtablesize.c \ - getlogin_r.c getrandom.c gettimeofday.c glob.c \ + fnmatch_loop.c fnmatch.c free.c frexp.c frexp.c frexpl.c \ + fstat.c stat-w32.c at-func.c fstatat.c getcwd.c getcwd-lgpl.c \ + getdtablesize.c getlogin_r.c getrandom.c gettimeofday.c glob.c \ glob_pattern_p.c globfree.c inet_ntop.c isblank.c isnan.c \ - isnand.c isnan.c isnanl.c localtime-buffer.c lstat.c malloc.c \ + isnand.c isnan.c isnanl.c lstat.c malloc.c \ lc-charset-dispatch.c mbrtowc.c mbtowc-lock.c mbsinit.c \ mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c memmem.c \ - mempcpy.c memrchr.c mkdir.c mkdtemp.c mkostemp.c msvc-inval.c \ - msvc-nothrow.c open.c openat.c opendir.c rawmemchr.c readdir.c \ - readlink.c realloc.c rename.c rewinddir.c rmdir.c setenv.c \ - setlocale-lock.c stat-w32.c stat.c strchrnul.c strdup.c \ - strerror.c strerror-override.c strerror_r.c strnlen.c strstr.c \ - strtok_r.c time_r.c unsetenv.c windows-mutex.c windows-once.c \ - windows-recmutex.c windows-rwlock.c wmemchr.c wmempcpy.c + memmem.c mempcpy.c memrchr.c mkdir.c mkdtemp.c mkostemp.c \ + msvc-inval.c msvc-nothrow.c open.c openat.c opendir.c pipe.c \ + rawmemchr.c readdir.c readlink.c realloc.c rename.c \ + rewinddir.c rmdir.c setenv.c setlocale-lock.c stat-w32.c \ + stat.c strchrnul.c strdup.c strerror.c strerror-override.c \ + strerror_r.c strnlen.c strstr.c strstr.c strtok_r.c time_r.c \ + unsetenv.c windows-mutex.c windows-once.c windows-recmutex.c \ + windows-rwlock.c wmemchr.c wmempcpy.c # Use this preprocessor expression to decide whether #include_next works. # Do not rely on a 'configure'-time test for this, since the expression # might appear in an installed header, which is used by some other compiler. -HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) +HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER) # Because this Makefile snippet defines a variable used by other # gnulib Makefile snippets, it must be present in all makefiles that @@ -1856,6 +1950,8 @@ malloc/$(am__dirstamp): malloc/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) malloc/$(DEPDIR) @: > malloc/$(DEPDIR)/$(am__dirstamp) +malloc/scratch_buffer_dupfree.$(OBJEXT): malloc/$(am__dirstamp) \ + malloc/$(DEPDIR)/$(am__dirstamp) malloc/scratch_buffer_grow.$(OBJEXT): malloc/$(am__dirstamp) \ malloc/$(DEPDIR)/$(am__dirstamp) malloc/scratch_buffer_grow_preserve.$(OBJEXT): malloc/$(am__dirstamp) \ @@ -1917,6 +2013,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch_loop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ @@ -1940,7 +2037,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lc-charset-dispatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime-buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ @@ -1966,6 +2062,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ @@ -2004,6 +2101,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmempcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/lock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/threadlib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_dupfree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_grow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_grow_preserve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_set_array_size.Po@am__quote@ @@ -2391,6 +2489,8 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's/@''GNULIB_MDA_CREAT''@/$(GNULIB_MDA_CREAT)/g' \ + -e 's/@''GNULIB_MDA_OPEN''@/$(GNULIB_MDA_OPEN)/g' \ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \ @@ -2477,7 +2577,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' \ @@ -2656,6 +2755,12 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + -e 's/@''GNULIB_MDA_J0''@/$(GNULIB_MDA_J0)/g' \ + -e 's/@''GNULIB_MDA_J1''@/$(GNULIB_MDA_J1)/g' \ + -e 's/@''GNULIB_MDA_JN''@/$(GNULIB_MDA_JN)/g' \ + -e 's/@''GNULIB_MDA_Y0''@/$(GNULIB_MDA_Y0)/g' \ + -e 's/@''GNULIB_MDA_Y1''@/$(GNULIB_MDA_Y1)/g' \ + -e 's/@''GNULIB_MDA_YN''@/$(GNULIB_MDA_YN)/g' \ | \ sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ @@ -2824,7 +2929,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ - -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \ -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ @@ -3033,8 +3138,15 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \ + -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \ + -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \ + -e 's/@''GNULIB_MDA_GETW''@/$(GNULIB_MDA_GETW)/g' \ + -e 's/@''GNULIB_MDA_PUTW''@/$(GNULIB_MDA_PUTW)/g' \ + -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GNULIB_MDA_TEMPNAM)/g' \ < $(srcdir)/stdio.in.h | \ - sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \ + -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ @@ -3101,9 +3213,11 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GNULIB_ALIGNED_ALLOC)/g' \ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ @@ -3114,6 +3228,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GNULIB_POSIX_MEMALIGN)/g' \ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ @@ -3135,10 +3250,19 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + -e 's/@''GNULIB_MDA_ECVT''@/$(GNULIB_MDA_ECVT)/g' \ + -e 's/@''GNULIB_MDA_FCVT''@/$(GNULIB_MDA_FCVT)/g' \ + -e 's/@''GNULIB_MDA_GCVT''@/$(GNULIB_MDA_GCVT)/g' \ + -e 's/@''GNULIB_MDA_MKTEMP''@/$(GNULIB_MDA_MKTEMP)/g' \ + -e 's/@''GNULIB_MDA_PUTENV''@/$(GNULIB_MDA_PUTENV)/g' \ < $(srcdir)/stdlib.in.h | \ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \ + -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \ + -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ @@ -3150,6 +3274,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ @@ -3172,12 +3297,15 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ @@ -3245,14 +3373,18 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ + -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ + -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GNULIB_MDA_MEMCCPY)/g' \ + -e 's/@''GNULIB_MDA_STRDUP''@/$(GNULIB_MDA_STRDUP)/g' \ < $(srcdir)/string.in.h | \ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ - -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -3268,8 +3400,12 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ + -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ + -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ @@ -3283,6 +3419,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -3372,8 +3509,10 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_GETUMASK''@/$(GNULIB_GETUMASK)/g' \ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIR''@/$(GNULIB_MKDIR)/g' \ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ @@ -3382,9 +3521,13 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's/@''GNULIB_MDA_CHMOD''@/$(GNULIB_MDA_CHMOD)/g' \ + -e 's/@''GNULIB_MDA_MKDIR''@/$(GNULIB_MDA_MKDIR)/g' \ + -e 's/@''GNULIB_MDA_UMASK''@/$(GNULIB_MDA_UMASK)/g' \ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ @@ -3400,7 +3543,9 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -3485,15 +3630,17 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIMESPEC_GET''@/$(GNULIB_TIMESPEC_GET)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's/@''GNULIB_MDA_TZSET''@/$(GNULIB_MDA_TZSET)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ - -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ @@ -3507,6 +3654,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @@ -3536,6 +3684,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_EXECL''@/$(GNULIB_EXECL)/g' \ + -e 's/@''GNULIB_EXECLE''@/$(GNULIB_EXECLE)/g' \ + -e 's/@''GNULIB_EXECLP''@/$(GNULIB_EXECLP)/g' \ + -e 's/@''GNULIB_EXECV''@/$(GNULIB_EXECV)/g' \ + -e 's/@''GNULIB_EXECVE''@/$(GNULIB_EXECVE)/g' \ + -e 's/@''GNULIB_EXECVP''@/$(GNULIB_EXECVP)/g' \ + -e 's/@''GNULIB_EXECVPE''@/$(GNULIB_EXECVPE)/g' \ -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ @@ -3581,12 +3736,33 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + -e 's/@''GNULIB_MDA_ACCESS''@/$(GNULIB_MDA_ACCESS)/g' \ + -e 's/@''GNULIB_MDA_CHDIR''@/$(GNULIB_MDA_CHDIR)/g' \ + -e 's/@''GNULIB_MDA_CLOSE''@/$(GNULIB_MDA_CLOSE)/g' \ + -e 's/@''GNULIB_MDA_DUP''@/$(GNULIB_MDA_DUP)/g' \ + -e 's/@''GNULIB_MDA_DUP2''@/$(GNULIB_MDA_DUP2)/g' \ + -e 's/@''GNULIB_MDA_EXECL''@/$(GNULIB_MDA_EXECL)/g' \ + -e 's/@''GNULIB_MDA_EXECLE''@/$(GNULIB_MDA_EXECLE)/g' \ + -e 's/@''GNULIB_MDA_EXECLP''@/$(GNULIB_MDA_EXECLP)/g' \ + -e 's/@''GNULIB_MDA_EXECV''@/$(GNULIB_MDA_EXECV)/g' \ + -e 's/@''GNULIB_MDA_EXECVE''@/$(GNULIB_MDA_EXECVE)/g' \ + -e 's/@''GNULIB_MDA_EXECVP''@/$(GNULIB_MDA_EXECVP)/g' \ + -e 's/@''GNULIB_MDA_EXECVPE''@/$(GNULIB_MDA_EXECVPE)/g' \ + -e 's/@''GNULIB_MDA_GETCWD''@/$(GNULIB_MDA_GETCWD)/g' \ + -e 's/@''GNULIB_MDA_GETPID''@/$(GNULIB_MDA_GETPID)/g' \ + -e 's/@''GNULIB_MDA_ISATTY''@/$(GNULIB_MDA_ISATTY)/g' \ + -e 's/@''GNULIB_MDA_LSEEK''@/$(GNULIB_MDA_LSEEK)/g' \ + -e 's/@''GNULIB_MDA_READ''@/$(GNULIB_MDA_READ)/g' \ + -e 's/@''GNULIB_MDA_RMDIR''@/$(GNULIB_MDA_RMDIR)/g' \ + -e 's/@''GNULIB_MDA_SWAB''@/$(GNULIB_MDA_SWAB)/g' \ + -e 's/@''GNULIB_MDA_UNLINK''@/$(GNULIB_MDA_UNLINK)/g' \ + -e 's/@''GNULIB_MDA_WRITE''@/$(GNULIB_MDA_WRITE)/g' \ < $(srcdir)/unistd.in.h | \ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ - -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ @@ -3616,6 +3792,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ @@ -3634,6 +3811,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ + -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \ + -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \ + -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \ + -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \ + -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \ + -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ @@ -3728,6 +3912,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + -e 's/@''GNULIB_MDA_WCSDUP''@/$(GNULIB_MDA_WCSDUP)/g' \ < $(srcdir)/wchar.in.h | \ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ @@ -3770,6 +3955,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ | \ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ diff --git a/gnulib/import/_Noreturn.h b/gnulib/import/_Noreturn.h index 394ca3c..38afe1d 100644 --- a/gnulib/import/_Noreturn.h +++ b/gnulib/import/_Noreturn.h @@ -1,5 +1,5 @@ /* A C macro for declaring that a function does not return. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib/import/alloca.c b/gnulib/import/alloca.c index d0476d5..91b9ec3 100644 --- a/gnulib/import/alloca.c +++ b/gnulib/import/alloca.c @@ -39,8 +39,8 @@ # define memory_full() abort () #endif -/* If compiling with GCC 2, this file's not needed. */ -#if !defined (__GNUC__) || __GNUC__ < 2 +/* If compiling with GCC or clang, this file is not needed. */ +#if !(defined __GNUC__ || defined __clang__) /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ @@ -62,16 +62,6 @@ lose # endif /* static */ # endif /* emacs */ -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -# if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -# else -# define ADDRESS_FUNCTION(arg) &(arg) -# endif - /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. @@ -140,7 +130,7 @@ void * alloca (size_t size) { auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); + register char *depth = &probe; # if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ @@ -206,273 +196,5 @@ alloca (size_t size) } } -# if defined (CRAY) && defined (CRAY_STACKSEG_END) - -# ifdef DEBUG_I00AFUNC -# include <stdio.h> -# endif - -# ifndef CRAY_STACK -# define CRAY_STACK -# ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -# else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -# endif /* CRAY2 */ -# endif /* not CRAY_STACK */ - -# ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == NULL) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != NULL) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == NULL || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == NULL) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != NULL); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -# else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -# ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -# endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -# ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -# endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -# endif /* not CRAY2 */ -# endif /* CRAY */ - # endif /* no alloca */ -#endif /* not GCC 2 */ +#endif /* not GCC || clang */ diff --git a/gnulib/import/alloca.in.h b/gnulib/import/alloca.in.h index 5686b08..0a6137e 100644 --- a/gnulib/import/alloca.in.h +++ b/gnulib/import/alloca.in.h @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2020 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ # endif #endif #ifndef alloca -# ifdef __GNUC__ +# if defined __GNUC__ || (__clang_major__ >= 4) # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca diff --git a/gnulib/import/arg-nonnull.h b/gnulib/import/arg-nonnull.h index ac26ca8..5b81b50 100644 --- a/gnulib/import/arg-nonnull.h +++ b/gnulib/import/arg-nonnull.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -18,7 +18,7 @@ that the values passed as arguments n, ..., m must be non-NULL pointers. n = 1 stands for the first argument, n = 2 for the second argument etc. */ #ifndef _GL_ARG_NONNULL -# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) # else # define _GL_ARG_NONNULL(params) diff --git a/gnulib/import/arpa_inet.in.h b/gnulib/import/arpa_inet.in.h index 9f13d48..5b103da 100644 --- a/gnulib/import/arpa_inet.in.h +++ b/gnulib/import/arpa_inet.in.h @@ -1,6 +1,6 @@ /* A GNU-like <arpa/inet.h>. - Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/assure.h b/gnulib/import/assure.h index 09a4edf..b6f4076 100644 --- a/gnulib/import/assure.h +++ b/gnulib/import/assure.h @@ -1,6 +1,6 @@ /* Run-time assert-like macros. - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/at-func.c b/gnulib/import/at-func.c index 90022e0..b6d9de7 100644 --- a/gnulib/import/at-func.c +++ b/gnulib/import/at-func.c @@ -1,5 +1,5 @@ /* Define at-style functions like fstatat, unlinkat, fchownat, etc. - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/attribute.h b/gnulib/import/attribute.h index 2836b99..8224527 100644 --- a/gnulib/import/attribute.h +++ b/gnulib/import/attribute.h @@ -1,6 +1,6 @@ /* ATTRIBUTE_* macros for using attributes in GCC and similar compilers - Copyright 2020 Free Software Foundation, Inc. + Copyright 2020-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -80,7 +80,7 @@ /* Attributes for variadic functions. */ /* The variadic function expects a trailing NULL argument. - ATTRIBUTE_SENTINEL () - The last argument is NULL. + ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99). ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */ /* Applies to: functions. */ #define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos) @@ -170,18 +170,21 @@ /* Applies to: function. */ #define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE -/* The function does not affect observable state, and always returns a value. - Compilers can omit duplicate calls with the same arguments if - observable state is not changed between calls. (This attribute is - looser than ATTRIBUTE_CONST.) */ +/* It is OK for a compiler to omit duplicate calls with the same arguments. + This attribute is safe for a function that neither depends on + nor affects observable state, and always returns exactly once - + e.g., does not loop forever, and does not call longjmp. + (This attribute is stricter than ATTRIBUTE_PURE.) */ /* Applies to: functions. */ -#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE +#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST -/* The function neither depends on nor affects observable state, - and always returns a value. Compilers can omit duplicate calls with - the same arguments. (This attribute is stricter than ATTRIBUTE_PURE.) */ +/* It is OK for a compiler to omit duplicate calls with the same + arguments if observable state is not changed between calls. + This attribute is safe for a function that does not affect + observable state, and always returns exactly once. + (This attribute is looser than ATTRIBUTE_CONST.) */ /* Applies to: functions. */ -#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST +#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE /* The function is rarely executed. */ /* Applies to: functions. */ diff --git a/gnulib/import/basename-lgpl.c b/gnulib/import/basename-lgpl.c index 565469e..f8394ed 100644 --- a/gnulib/import/basename-lgpl.c +++ b/gnulib/import/basename-lgpl.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2020 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -18,20 +18,20 @@ #include <config.h> -#include "dirname.h" +/* Specification. */ +#include "basename-lgpl.h" +#include <stdbool.h> #include <string.h> -/* Return the address of the last file name component of NAME. If - NAME has no relative file name components because it is a file - system root, return the empty string. */ +#include "filename.h" char * last_component (char const *name) { char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); char const *p; - bool saw_slash = false; + bool last_was_slash = false; while (ISSLASH (*base)) base++; @@ -39,21 +39,17 @@ last_component (char const *name) for (p = base; *p; p++) { if (ISSLASH (*p)) - saw_slash = true; - else if (saw_slash) + last_was_slash = true; + else if (last_was_slash) { base = p; - saw_slash = false; + last_was_slash = false; } } return (char *) base; } -/* Return the length of the basename NAME. Typically NAME is the - value returned by base_name or last_component. Act like strlen - (NAME), except omit all trailing slashes. */ - size_t base_len (char const *name) { diff --git a/gnulib/import/basename-lgpl.h b/gnulib/import/basename-lgpl.h new file mode 100644 index 0000000..1e9631a --- /dev/null +++ b/gnulib/import/basename-lgpl.h @@ -0,0 +1,78 @@ +/* Extract the last component (base name) of a file name. + + Copyright (C) 1998, 2001, 2003-2006, 2009-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#ifndef _BASENAME_LGPL_H +#define _BASENAME_LGPL_H + +#include <stddef.h> + +#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT +# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Return the address of the last file name component of FILENAME. + If FILENAME has some trailing slash(es), they are considered to be + part of the last component. + If FILENAME has no relative file name components because it is a file + system root, return the empty string. + Examples: + FILENAME RESULT + "foo.c" "foo.c" + "foo/bar.c" "bar.c" + "/foo/bar.c" "bar.c" + "foo/bar/" "bar/" + "foo/bar//" "bar//" + "/" "" + "//" "" + "" "" + The return value is a tail of the given FILENAME; do NOT free() it! */ + +/* This function was traditionally called 'basename', but we avoid this + function name because + * Various platforms have different functions in their libc. + In particular, the glibc basename(), defined in <string.h>, does + not consider trailing slashes to be part of the component: + FILENAME RESULT + "foo/bar/" "" + "foo/bar//" "" + * The 'basename' command eliminates trailing slashes and for a root + produces a non-empty result: + FILENAME RESULT + "foo/bar/" "bar" + "foo/bar//" "bar" + "/" "/" + "//" "/" + */ +extern char *last_component (char const *filename) _GL_ATTRIBUTE_PURE; + +/* Return the length of the basename FILENAME. + Typically FILENAME is the value returned by base_name or last_component. + Act like strlen (FILENAME), except omit all trailing slashes. */ +extern size_t base_len (char const *filename) _GL_ATTRIBUTE_PURE; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _BASENAME_LGPL_H */ diff --git a/gnulib/import/btowc.c b/gnulib/import/btowc.c index 6828b70..58186c4 100644 --- a/gnulib/import/btowc.c +++ b/gnulib/import/btowc.c @@ -1,5 +1,5 @@ /* Convert unibyte character to wide character. - Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/c++defs.h b/gnulib/import/c++defs.h index 3e6aaab..39df1bc 100644 --- a/gnulib/import/c++defs.h +++ b/gnulib/import/c++defs.h @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -146,6 +146,16 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif +/* _GL_CXXALIAS_MDA (func, rettype, parameters); + is to be used when func is a Microsoft deprecated alias, on native Windows. + It declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to _func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); + */ +#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) + /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); except that the C function rpl_func may have a slightly different @@ -171,6 +181,14 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif +/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_MDA (func, rettype, parameters); + except that the C function func may have a slightly different declaration. + A cast is used to silence the "invalid conversion" error that would + otherwise occur. */ +#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) + /* _GL_CXXALIAS_SYS (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func that redirects to the system provided function func, if GNULIB_NAMESPACE @@ -268,7 +286,7 @@ _GL_CXXALIASWARN_2 (func, namespace) /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_WARN_ON_USE (func, \ "The symbol ::" #func " refers to the system function. " \ @@ -296,9 +314,9 @@ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ "The symbol ::" #func " refers to the system function. " \ "Use " #namespace "::" #func " instead.") # else diff --git a/gnulib/import/canonicalize-lgpl.c b/gnulib/import/canonicalize-lgpl.c index 9f99098..4bb4c0c 100644 --- a/gnulib/import/canonicalize-lgpl.c +++ b/gnulib/import/canonicalize-lgpl.c @@ -1,19 +1,20 @@ /* Return the canonical absolute name of a given file. - Copyright (C) 1996-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. */ + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #ifndef _LIBC /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc @@ -21,38 +22,38 @@ # define _GL_ARG_NONNULL(params) # define _GL_USE_STDLIB_ALLOC 1 -# include <config.h> +# include <libc-config.h> #endif -#if !HAVE_CANONICALIZE_FILE_NAME || !FUNC_REALPATH_WORKS || defined _LIBC - /* Specification. */ #include <stdlib.h> -#include <alloca.h> -#include <string.h> -#include <unistd.h> +#include <errno.h> +#include <fcntl.h> #include <limits.h> -#if HAVE_SYS_PARAM_H || defined _LIBC -# include <sys/param.h> -#endif +#include <stdbool.h> +#include <string.h> #include <sys/stat.h> -#include <errno.h> -#include <stddef.h> +#include <unistd.h> + +#include <eloop-threshold.h> +#include <filename.h> +#include <idx.h> +#include <intprops.h> +#include <scratch_buffer.h> #ifdef _LIBC # include <shlib-compat.h> +# define GCC_LINT 1 +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else -# define SHLIB_COMPAT(lib, introduced, obsoleted) 0 -# define versioned_symbol(lib, local, symbol, version) extern int dummy -# define compat_symbol(lib, local, symbol, version) -# define weak_alias(local, symbol) # define __canonicalize_file_name canonicalize_file_name # define __realpath realpath # include "pathmax.h" -# include "malloca.h" -# include "filename.h" -# if HAVE_GETCWD +# define __faccessat faccessat +# if defined _WIN32 && !defined __CYGWIN__ +# define __getcwd _getcwd +# elif HAVE_GETCWD # if IN_RELOCWRAPPER /* When building the relocatable program wrapper, use the system's getcwd function, not the gnulib override, otherwise we would get a link error. @@ -70,57 +71,137 @@ # else # define __getcwd(buf, max) getwd (buf) # endif +# define __mempcpy mempcpy +# define __pathconf pathconf +# define __rawmemchr rawmemchr # define __readlink readlink -# define __set_errno(e) errno = (e) -# ifndef MAXSYMLINKS -# ifdef SYMLOOP_MAX -# define MAXSYMLINKS SYMLOOP_MAX -# else -# define MAXSYMLINKS 20 -# endif -# endif +# define __stat stat #endif -#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT -# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 +/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */ +#if defined GCC_LINT || defined lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ #endif -/* Define this independently so that stdint.h is not a prerequisite. */ -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) +#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT +# define DOUBLE_SLASH_IS_DISTINCT_ROOT false #endif -#if !FUNC_REALPATH_WORKS || defined _LIBC +#if defined _LIBC || !FUNC_REALPATH_WORKS + +/* Return true if FILE's existence can be shown, false (setting errno) + otherwise. Follow symbolic links. */ +static bool +file_accessible (char const *file) +{ +# if defined _LIBC || HAVE_FACCESSAT + return __faccessat (AT_FDCWD, file, F_OK, AT_EACCESS) == 0; +# else + struct stat st; + return __stat (file, &st) == 0 || errno == EOVERFLOW; +# endif +} -static void -alloc_failed (void) +/* True if concatenating END as a suffix to a file name means that the + code needs to check that the file name is that of a searchable + directory, since the canonicalize_filename_mode_stk code won't + check this later anyway when it checks an ordinary file name + component within END. END must either be empty, or start with a + slash. */ + +static bool _GL_ATTRIBUTE_PURE +suffix_requires_dir_check (char const *end) { -#if defined _WIN32 && ! defined __CYGWIN__ - /* Avoid errno problem without using the malloc or realloc modules; see: - https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */ - errno = ENOMEM; + /* If END does not start with a slash, the suffix is OK. */ + while (ISSLASH (*end)) + { + /* Two or more slashes act like a single slash. */ + do + end++; + while (ISSLASH (*end)); + + switch (*end++) + { + default: return false; /* An ordinary file name component is OK. */ + case '\0': return true; /* Trailing "/" is trouble. */ + case '.': break; /* Possibly "." or "..". */ + } + /* Trailing "/.", or "/.." even if not trailing, is trouble. */ + if (!*end || (*end == '.' && (!end[1] || ISSLASH (end[1])))) + return true; + } + + return false; +} + +/* Append this to a file name to test whether it is a searchable directory. + On POSIX platforms "/" suffices, but "/./" is sometimes needed on + macOS 10.13 <https://bugs.gnu.org/30350>, and should also work on + platforms like AIX 7.2 that need at least "/.". */ + +#if defined _LIBC || defined LSTAT_FOLLOWS_SLASHED_SYMLINK +static char const dir_suffix[] = "/"; +#else +static char const dir_suffix[] = "/./"; #endif + +/* Return true if DIR is a searchable dir, false (setting errno) otherwise. + DIREND points to the NUL byte at the end of the DIR string. + Store garbage into DIREND[0 .. strlen (dir_suffix)]. */ + +static bool +dir_check (char *dir, char *dirend) +{ + strcpy (dirend, dir_suffix); + return file_accessible (dir); } -/* Return the canonical absolute name of file NAME. A canonical name - does not contain any ".", ".." components nor any repeated path - separators ('/') or symlinks. All path components must exist. If - RESOLVED is null, the result is malloc'd; otherwise, if the - canonical name is PATH_MAX chars or more, returns null with 'errno' - set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, - returns the name in RESOLVED. If the name cannot be resolved and - RESOLVED is non-NULL, it contains the path of the first component - that cannot be resolved. If the path can be resolved, RESOLVED - holds the same value as the value returned. */ +static idx_t +get_path_max (void) +{ +# ifdef PATH_MAX + long int path_max = PATH_MAX; +# else + /* The caller invoked realpath with a null RESOLVED, even though + PATH_MAX is not defined as a constant. The glibc manual says + programs should not do this, and POSIX says the behavior is undefined. + Historically, glibc here used the result of pathconf, or 1024 if that + failed; stay consistent with this (dubious) historical practice. */ + int err = errno; + long int path_max = __pathconf ("/", _PC_PATH_MAX); + __set_errno (err); +# endif + return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX; +} -char * -__realpath (const char *name, char *resolved) +/* Act like __realpath (see below), with an additional argument + rname_buf that can be used as temporary storage. + + If GCC_LINT is defined, do not inline this function with GCC 10.1 + and later, to avoid creating a pointer to the stack that GCC + -Wreturn-local-addr incorrectly complains about. See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644 + Although the noinline attribute can hurt performance a bit, no better way + to pacify GCC is known; even an explicit #pragma does not pacify GCC. + When the GCC bug is fixed this workaround should be limited to the + broken GCC versions. */ +#if __GNUC_PREREQ (10, 1) +# if defined GCC_LINT || defined lint +__attribute__ ((__noinline__)) +# elif __OPTIMIZE__ && !__NO_INLINE__ +# define GCC_BOGUS_WRETURN_LOCAL_ADDR +# endif +#endif +static char * +realpath_stk (const char *name, char *resolved, + struct scratch_buffer *rname_buf) { - char *rpath, *dest, *extra_buf = NULL; - const char *start, *end, *rpath_limit; - long int path_max; + char *dest; + char const *start; + char const *end; int num_links = 0; - size_t prefix_len; if (name == NULL) { @@ -140,205 +221,148 @@ __realpath (const char *name, char *resolved) return NULL; } -#ifdef PATH_MAX - path_max = PATH_MAX; -#else - path_max = pathconf (name, _PC_PATH_MAX); - if (path_max <= 0) - path_max = 8192; -#endif - - if (resolved == NULL) - { - rpath = malloc (path_max); - if (rpath == NULL) - { - alloc_failed (); - return NULL; - } - } - else - rpath = resolved; - rpath_limit = rpath + path_max; + struct scratch_buffer extra_buffer, link_buffer; + scratch_buffer_init (&extra_buffer); + scratch_buffer_init (&link_buffer); + scratch_buffer_init (rname_buf); + char *rname_on_stack = rname_buf->data; + char *rname = rname_on_stack; + bool end_in_extra_buffer = false; + bool failed = true; /* This is always zero for Posix hosts, but can be 2 for MS-Windows and MS-DOS X:/foo/bar file names. */ - prefix_len = FILE_SYSTEM_PREFIX_LEN (name); + idx_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name); if (!IS_ABSOLUTE_FILE_NAME (name)) { - if (!__getcwd (rpath, path_max)) + while (!__getcwd (rname, rname_buf->length)) { - rpath[0] = '\0'; - goto error; + if (errno != ERANGE) + { + dest = rname; + goto error; + } + if (!scratch_buffer_grow (rname_buf)) + goto error_nomem; + rname = rname_buf->data; } - dest = strchr (rpath, '\0'); + dest = __rawmemchr (rname, '\0'); start = name; - prefix_len = FILE_SYSTEM_PREFIX_LEN (rpath); + prefix_len = FILE_SYSTEM_PREFIX_LEN (rname); } else { - dest = rpath; - if (prefix_len) - { - memcpy (rpath, name, prefix_len); - dest += prefix_len; - } + dest = __mempcpy (rname, name, prefix_len); *dest++ = '/'; if (DOUBLE_SLASH_IS_DISTINCT_ROOT) { - if (ISSLASH (name[1]) && !ISSLASH (name[2]) && !prefix_len) + if (prefix_len == 0 /* implies ISSLASH (name[0]) */ + && ISSLASH (name[1]) && !ISSLASH (name[2])) *dest++ = '/'; *dest = '\0'; } start = name + prefix_len; } - for (end = start; *start; start = end) + for ( ; *start; start = end) { -#ifdef _LIBC - struct stat64 st; -#else - struct stat st; -#endif - - /* Skip sequence of multiple path-separators. */ + /* Skip sequence of multiple file name separators. */ while (ISSLASH (*start)) ++start; - /* Find end of path component. */ + /* Find end of component. */ for (end = start; *end && !ISSLASH (*end); ++end) /* Nothing. */; - if (end - start == 0) + /* Length of this file name component; it can be zero if a file + name ends in '/'. */ + idx_t startlen = end - start; + + if (startlen == 0) break; - else if (end - start == 1 && start[0] == '.') + else if (startlen == 1 && start[0] == '.') /* nothing */; - else if (end - start == 2 && start[0] == '.' && start[1] == '.') + else if (startlen == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ - if (dest > rpath + prefix_len + 1) - for (--dest; dest > rpath && !ISSLASH (dest[-1]); --dest) + if (dest > rname + prefix_len + 1) + for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest) continue; if (DOUBLE_SLASH_IS_DISTINCT_ROOT - && dest == rpath + 1 && !prefix_len + && dest == rname + 1 && !prefix_len && ISSLASH (*dest) && !ISSLASH (dest[1])) dest++; } else { - size_t new_size; - if (!ISSLASH (dest[-1])) *dest++ = '/'; - if (dest + (end - start) >= rpath_limit) + while (rname + rname_buf->length - dest + < startlen + sizeof dir_suffix) { - ptrdiff_t dest_offset = dest - rpath; - char *new_rpath; - - if (resolved) - { - __set_errno (ENAMETOOLONG); - if (dest > rpath + prefix_len + 1) - dest--; - *dest = '\0'; - goto error; - } - new_size = rpath_limit - rpath; - if (end - start + 1 > path_max) - new_size += end - start + 1; - else - new_size += path_max; - new_rpath = (char *) realloc (rpath, new_size); - if (new_rpath == NULL) - { - alloc_failed (); - goto error; - } - rpath = new_rpath; - rpath_limit = rpath + new_size; - - dest = rpath + dest_offset; + idx_t dest_offset = dest - rname; + if (!scratch_buffer_grow_preserve (rname_buf)) + goto error_nomem; + rname = rname_buf->data; + dest = rname + dest_offset; } -#ifdef _LIBC - dest = __mempcpy (dest, start, end - start); -#else - memcpy (dest, start, end - start); - dest += end - start; -#endif + dest = __mempcpy (dest, start, startlen); *dest = '\0'; - /* FIXME: if lstat fails with errno == EOVERFLOW, - the entry exists. */ -#ifdef _LIBC - if (__lxstat64 (_STAT_VER, rpath, &st) < 0) -#else - if (lstat (rpath, &st) < 0) -#endif - goto error; - - if (S_ISLNK (st.st_mode)) + char *buf; + ssize_t n; + while (true) { - char *buf; - size_t len; - ssize_t n; - - if (++num_links > MAXSYMLINKS) + buf = link_buffer.data; + idx_t bufsize = link_buffer.length; + n = __readlink (rname, buf, bufsize - 1); + if (n < bufsize - 1) + break; + if (!scratch_buffer_grow (&link_buffer)) + goto error_nomem; + } + if (0 <= n) + { + if (++num_links > __eloop_threshold ()) { __set_errno (ELOOP); goto error; } - buf = malloca (path_max); - if (!buf) - { - __set_errno (ENOMEM); - goto error; - } - - n = __readlink (rpath, buf, path_max - 1); - if (n < 0) - { - int saved_errno = errno; - freea (buf); - __set_errno (saved_errno); - goto error; - } buf[n] = '\0'; - if (!extra_buf) + char *extra_buf = extra_buffer.data; + idx_t end_idx IF_LINT (= 0); + if (end_in_extra_buffer) + end_idx = end - extra_buf; + size_t len = strlen (end); + if (INT_ADD_OVERFLOW (len, n)) { - extra_buf = malloca (path_max); - if (!extra_buf) - { - freea (buf); - __set_errno (ENOMEM); - goto error; - } + __set_errno (ENOMEM); + goto error_nomem; } - - len = strlen (end); - /* Check that n + len + 1 doesn't overflow and is <= path_max. */ - if (n >= SIZE_MAX - len || n + len >= path_max) + while (extra_buffer.length <= len + n) { - freea (buf); - __set_errno (ENAMETOOLONG); - goto error; + if (!scratch_buffer_grow_preserve (&extra_buffer)) + goto error_nomem; + extra_buf = extra_buffer.data; } + if (end_in_extra_buffer) + end = extra_buf + end_idx; /* Careful here, end may be a pointer into extra_buf... */ memmove (&extra_buf[n], end, len + 1); name = end = memcpy (extra_buf, buf, n); + end_in_extra_buffer = true; if (IS_ABSOLUTE_FILE_NAME (buf)) { - size_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf); + idx_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf); - if (pfxlen) - memcpy (rpath, buf, pfxlen); - dest = rpath + pfxlen; + dest = __mempcpy (rname, buf, pfxlen); *dest++ = '/'; /* It's an absolute symlink */ if (DOUBLE_SLASH_IS_DISTINCT_ROOT) { @@ -353,44 +377,67 @@ __realpath (const char *name, char *resolved) { /* Back up to previous component, ignore if at root already: */ - if (dest > rpath + prefix_len + 1) - for (--dest; dest > rpath && !ISSLASH (dest[-1]); --dest) + if (dest > rname + prefix_len + 1) + for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest) continue; - if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1 + if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && ISSLASH (*dest) && !ISSLASH (dest[1]) && !prefix_len) dest++; } } - else if (!S_ISDIR (st.st_mode) && *end != '\0') - { - __set_errno (ENOTDIR); - goto error; - } + else if (! (suffix_requires_dir_check (end) + ? dir_check (rname, dest) + : errno == EINVAL)) + goto error; } } - if (dest > rpath + prefix_len + 1 && ISSLASH (dest[-1])) + if (dest > rname + prefix_len + 1 && ISSLASH (dest[-1])) --dest; - if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1 && !prefix_len + if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && !prefix_len && ISSLASH (*dest) && !ISSLASH (dest[1])) dest++; - *dest = '\0'; + failed = false; - if (extra_buf) - freea (extra_buf); +error: + *dest++ = '\0'; + if (resolved != NULL && dest - rname <= get_path_max ()) + rname = strcpy (resolved, rname); - return rpath; +error_nomem: + scratch_buffer_free (&extra_buffer); + scratch_buffer_free (&link_buffer); -error: - { - int saved_errno = errno; - if (extra_buf) - freea (extra_buf); - if (resolved == NULL) - free (rpath); - __set_errno (saved_errno); - } - return NULL; + if (failed || rname == resolved) + { + scratch_buffer_free (rname_buf); + return failed ? NULL : resolved; + } + + return scratch_buffer_dupfree (rname_buf, dest - rname); } + +/* Return the canonical absolute name of file NAME. A canonical name + does not contain any ".", ".." components nor any repeated file name + separators ('/') or symlinks. All file name components must exist. If + RESOLVED is null, the result is malloc'd; otherwise, if the + canonical name is PATH_MAX chars or more, returns null with 'errno' + set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, + returns the name in RESOLVED. If the name cannot be resolved and + RESOLVED is non-NULL, it contains the name of the first component + that cannot be resolved. If the name can be resolved, RESOLVED + holds the same value as the value returned. */ + +char * +__realpath (const char *name, char *resolved) +{ + #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR + #warning "GCC might issue a bogus -Wreturn-local-addr warning here." + #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." + #endif + struct scratch_buffer rname_buffer; + return realpath_stk (name, resolved, &rname_buffer); +} +libc_hidden_def (__realpath) versioned_symbol (libc, __realpath, realpath, GLIBC_2_3); #endif /* !FUNC_REALPATH_WORKS || defined _LIBC */ @@ -418,11 +465,3 @@ __canonicalize_file_name (const char *name) return __realpath (name, NULL); } weak_alias (__canonicalize_file_name, canonicalize_file_name) - -#else - -/* This declaration is solely to ensure that after preprocessing - this file is never empty. */ -typedef int dummy; - -#endif diff --git a/gnulib/import/cdefs.h b/gnulib/import/cdefs.h index d8e4a00..03e26d4 100644 --- a/gnulib/import/cdefs.h +++ b/gnulib/import/cdefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not - anymore supported. */ + supported anymore. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif @@ -34,7 +34,34 @@ #undef __P #undef __PMT -#ifdef __GNUC__ +/* Compilers that are not clang may object to + #if defined __clang__ && __has_attribute(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_attribute +# define __glibc_clang_has_attribute(name) __has_attribute (name) +#else +# define __glibc_clang_has_attribute(name) 0 +#endif + +/* Compilers that are not clang may object to + #if defined __clang__ && __has_builtin(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_builtin +# define __glibc_clang_has_builtin(name) __has_builtin (name) +#else +# define __glibc_clang_has_builtin(name) 0 +#endif + +/* Compilers that are not clang may object to + #if defined __clang__ && __has_extension(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_extension +# define __glibc_clang_has_extension(ext) __has_extension (ext) +#else +# define __glibc_clang_has_extension(ext) 0 +#endif + +#if defined __GNUC__ || defined __clang__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ @@ -47,21 +74,26 @@ # endif /* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions + to help it optimize the function calls. But this only works with + gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ -# if !defined __cplusplus && __GNUC_PREREQ (3, 3) +# if !defined __cplusplus \ + && (__GNUC_PREREQ (3, 4) || __glibc_clang_has_attribute (__nothrow__)) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# define __THROWNL throw () -# define __NTH(fct) __LEAF_ATTR fct throw () -# define __NTHNL(fct) fct throw () +# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) +# if __cplusplus >= 201103L +# define __THROW noexcept (true) +# else +# define __THROW throw () +# endif +# define __THROWNL __THROW +# define __NTH(fct) __LEAF_ATTR fct __THROW +# define __NTHNL(fct) fct __THROW # else # define __THROW # define __THROWNL @@ -70,7 +102,7 @@ # endif # endif -#else /* Not GCC. */ +#else /* Not GCC or clang. */ # if (defined __cplusplus \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) @@ -83,16 +115,7 @@ # define __THROWNL # define __NTH(fct) fct -#endif /* GCC. */ - -/* Compilers that are not clang may object to - #if defined __clang__ && __has_extension(...) - even though they do not need to evaluate the right-hand side of the &&. */ -#if defined __clang__ && defined __has_extension -# define __glibc_clang_has_extension(ext) __has_extension (ext) -#else -# define __glibc_clang_has_extension(ext) 0 -#endif +#endif /* GCC || clang. */ /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ @@ -123,14 +146,20 @@ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) +/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ +#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) +# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) +# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) +#else +# define __glibc_objsize0(__o) __bos0 (__o) +# define __glibc_objsize(__o) __bos (__o) +#endif + #if __GNUC_PREREQ (4,3) -# define __warndecl(name, msg) \ - extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else -# define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif @@ -142,8 +171,8 @@ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc # define __flexarr [] # define __glibc_c99_flexarr_available 1 -#elif __GNUC_PREREQ (2,97) -/* GCC 2.97 supports C99 flexible array members as an extension, +#elif __GNUC_PREREQ (2,97) || defined __clang__ +/* GCC 2.97 and clang support C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 @@ -169,7 +198,7 @@ Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ -#if defined __GNUC__ && __GNUC__ >= 2 +#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4) # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus @@ -194,17 +223,17 @@ */ #endif -/* GCC has various useful declarations that can be made with the - `__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !defined __GNUC__ || __GNUC__ < 2 +/* GCC and clang have various useful declarations that can be made with + the '__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !(defined __GNUC__ || defined __clang__) # define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) +#if __GNUC_PREREQ (2,96) || __glibc_clang_has_attribute (__malloc__) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # define __attribute_malloc__ /* Ignore */ @@ -222,14 +251,14 @@ /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) +#if __GNUC_PREREQ (2,96) || __glibc_clang_has_attribute (__pure__) # define __attribute_pure__ __attribute__ ((__pure__)) #else # define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) +#if __GNUC_PREREQ (2,5) || __glibc_clang_has_attribute (__const__) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ @@ -238,7 +267,7 @@ /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) +#if __GNUC_PREREQ (3,1) || __glibc_clang_has_attribute (__used__) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else @@ -247,7 +276,7 @@ #endif /* Since version 3.2, gcc allows marking deprecated functions. */ -#if __GNUC_PREREQ (3,2) +#if __GNUC_PREREQ (3,2) || __glibc_clang_has_attribute (__deprecated__) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ @@ -256,8 +285,8 @@ /* Since version 4.5, gcc also allows one to specify the message printed when a deprecated function is used. clang claims to be gcc 4.2, but may also support this feature. */ -#if __GNUC_PREREQ (4,5) || \ - __glibc_clang_has_extension (__attribute_deprecated_with_message__) +#if __GNUC_PREREQ (4,5) \ + || __glibc_clang_has_extension (__attribute_deprecated_with_message__) # define __attribute_deprecated_msg__(msg) \ __attribute__ ((__deprecated__ (msg))) #else @@ -270,7 +299,7 @@ If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) +#if __GNUC_PREREQ (2,8) || __glibc_clang_has_attribute (__format_arg__) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # define __attribute_format_arg__(x) /* Ignore */ @@ -280,7 +309,7 @@ attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,97) +#if __GNUC_PREREQ (2,97) || __glibc_clang_has_attribute (__format__) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else @@ -291,7 +320,7 @@ must not be NULL. Do not define __nonnull if it is already defined, for portability when this file is used in Gnulib. */ #ifndef __nonnull -# if __GNUC_PREREQ (3,3) +# if __GNUC_PREREQ (3,3) || __glibc_clang_has_attribute (__nonnull__) # define __nonnull(params) __attribute__ ((__nonnull__ params)) # else # define __nonnull(params) @@ -300,7 +329,7 @@ /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ -#if __GNUC_PREREQ (3,4) +#if __GNUC_PREREQ (3,4) || __glibc_clang_has_attribute (__warn_unused_result__) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 @@ -314,7 +343,7 @@ #endif /* Forces a function to be always inlined. */ -#if __GNUC_PREREQ (3,2) +#if __GNUC_PREREQ (3,2) || __glibc_clang_has_attribute (__always_inline__) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ @@ -327,7 +356,7 @@ /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ -#if __GNUC_PREREQ (4,3) +#if __GNUC_PREREQ (4,3) || __glibc_clang_has_attribute (__artificial__) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # define __attribute_artificial__ /* Ignore */ @@ -370,12 +399,14 @@ run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ -#if !__GNUC_PREREQ (2,8) +#if !(__GNUC_PREREQ (2,8) || defined __clang__) # define __extension__ /* Ignore */ #endif -/* __restrict is known in EGCS 1.2 and above. */ -#if !__GNUC_PREREQ (2,92) +/* __restrict is known in EGCS 1.2 and above, and in clang. + It works also in C++ mode (outside of arrays), but only when spelled + as '__restrict', not 'restrict'. */ +#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3) # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict restrict # else @@ -385,8 +416,9 @@ /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] - GCC 3.1 supports this. */ -#if __GNUC_PREREQ (3,1) && !defined __GNUG__ + GCC 3.1 and clang support this. + This syntax is not usable in C++ mode. */ +#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus # define __restrict_arr __restrict #else # ifdef __GNUC__ @@ -401,7 +433,7 @@ # endif #endif -#if __GNUC__ >= 3 +#if (__GNUC__ >= 3) || __glibc_clang_has_builtin (__builtin_expect) # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else @@ -417,7 +449,8 @@ #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && !__GNUC_PREREQ (4,7)) + && !(__GNUC_PREREQ (4,7) \ + || (3 < __clang_major__ + (5 <= __clang_minor__)))) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else @@ -434,9 +467,20 @@ # define __attribute_nonstring__ #endif +/* Undefine (also defined in libc-symbols.h). */ +#undef __attribute_copy__ +#if __GNUC_PREREQ (9, 0) +/* Copies attributes from the declaration or type referenced by + the argument. */ +# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) +#else +# define __attribute_copy__(arg) +#endif + #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) + && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \ + || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] @@ -449,7 +493,37 @@ # include <bits/long-double.h> #endif -#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT + +/* Alias name defined automatically. */ +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined automatically, with leading underscores. */ +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name \ + __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined manually. */ +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); + +# define __LDBL_REDIR1_NTH(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) + +/* Unused. */ +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth + +# else +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); +# endif +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) @@ -458,6 +532,8 @@ # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ @@ -468,11 +544,13 @@ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if !defined __LDBL_COMPAT || !defined __REDIRECT +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ + || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR2_DECL(name) # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) @@ -511,4 +589,23 @@ # define __HAVE_GENERIC_SELECTION 0 #endif +#if __GNUC_PREREQ (10, 0) +/* Designates a 1-based positional argument ref-index of pointer type + that can be used to access size-index elements of the pointed-to + array according to access mode, or at least one element when + size-index is not provided: + access (access-mode, <ref-index> [, <size-index>]) */ +#define __attr_access(x) __attribute__ ((__access__ x)) +#else +# define __attr_access(x) +#endif + +/* Specify that a function such as setjmp or vfork may return + twice. */ +#if __GNUC_PREREQ (4, 1) +# define __attribute_returns_twice__ __attribute__ ((__returns_twice__)) +#else +# define __attribute_returns_twice__ /* Ignore. */ +#endif + #endif /* sys/cdefs.h */ diff --git a/gnulib/import/chdir-long.c b/gnulib/import/chdir-long.c index a38d38c..0d693b0 100644 --- a/gnulib/import/chdir-long.c +++ b/gnulib/import/chdir-long.c @@ -1,5 +1,5 @@ /* provide a chdir function that tries not to fail due to ENAMETOOLONG - Copyright (C) 2004-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/chdir-long.h b/gnulib/import/chdir-long.h index 851222f..17d9aa5 100644 --- a/gnulib/import/chdir-long.h +++ b/gnulib/import/chdir-long.h @@ -1,5 +1,5 @@ /* provide a chdir function that tries not to fail due to ENAMETOOLONG - Copyright (C) 2004-2005, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2005, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/cloexec.c b/gnulib/import/cloexec.c index 510be3d..8363dda 100644 --- a/gnulib/import/cloexec.c +++ b/gnulib/import/cloexec.c @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 1991, 2004-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1991, 2004-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/cloexec.h b/gnulib/import/cloexec.h index f14a997..5ca0e64 100644 --- a/gnulib/import/cloexec.h +++ b/gnulib/import/cloexec.h @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 2004, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2004, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/close.c b/gnulib/import/close.c index 0c8780d..e1264d5 100644 --- a/gnulib/import/close.c +++ b/gnulib/import/close.c @@ -1,5 +1,5 @@ /* close replacement. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ #undef close -#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +#if defined _WIN32 && !defined __CYGWIN__ +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER static int close_nothrow (int fd) { @@ -36,7 +37,7 @@ close_nothrow (int fd) TRY_MSVC_INVAL { - result = close (fd); + result = _close (fd); } CATCH_MSVC_INVAL { @@ -47,6 +48,9 @@ close_nothrow (int fd) return result; } +# else +# define close_nothrow _close +# endif #else # define close_nothrow close #endif diff --git a/gnulib/import/closedir.c b/gnulib/import/closedir.c index 9afaa1f0..0847422 100644 --- a/gnulib/import/closedir.c +++ b/gnulib/import/closedir.c @@ -1,5 +1,5 @@ /* Stop reading the entries of a directory. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/count-one-bits.h b/gnulib/import/count-one-bits.h index 6c5b757..1a14f11 100644 --- a/gnulib/import/count-one-bits.h +++ b/gnulib/import/count-one-bits.h @@ -1,5 +1,5 @@ /* count-one-bits.h -- counts the number of 1-bits in a word. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,8 @@ extern "C" { expand to code that computes the number of 1-bits of the local variable 'x' of type TYPE (an unsigned integer type) and return it from the current function. */ -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) \ + || (__clang_major__ >= 4) # define COUNT_ONE_BITS(GCC_BUILTIN, MSC_BUILTIN, TYPE) \ return GCC_BUILTIN (x) #else diff --git a/gnulib/import/ctype.in.h b/gnulib/import/ctype.in.h index 555677a..511a362 100644 --- a/gnulib/import/ctype.in.h +++ b/gnulib/import/ctype.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/dirent-private.h b/gnulib/import/dirent-private.h index a3c6844..eaba1b9 100644 --- a/gnulib/import/dirent-private.h +++ b/gnulib/import/dirent-private.h @@ -1,5 +1,5 @@ /* Private details of the DIR type. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/dirent.in.h b/gnulib/import/dirent.in.h index 6fa44f0..2e2c511 100644 --- a/gnulib/import/dirent.in.h +++ b/gnulib/import/dirent.in.h @@ -1,5 +1,5 @@ /* A GNU-like <dirent.h>. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ typedef struct gl_directory DIR; /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ #ifndef _GL_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define _GL_ATTRIBUTE_PURE /* empty */ diff --git a/gnulib/import/dirfd.c b/gnulib/import/dirfd.c index f653977..ced7531 100644 --- a/gnulib/import/dirfd.c +++ b/gnulib/import/dirfd.c @@ -1,6 +1,6 @@ /* dirfd.c -- return the file descriptor associated with an open DIR* - Copyright (C) 2001, 2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/dirname-lgpl.c b/gnulib/import/dirname-lgpl.c index 27d4374..cfdac03 100644 --- a/gnulib/import/dirname-lgpl.c +++ b/gnulib/import/dirname-lgpl.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2020 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/dirname.h b/gnulib/import/dirname.h index 5379e8e..25116ab 100644 --- a/gnulib/import/dirname.h +++ b/gnulib/import/dirname.h @@ -1,6 +1,6 @@ /* Take file names apart into directory and base names. - Copyright (C) 1998, 2001, 2003-2006, 2009-2020 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -22,15 +22,12 @@ # include <stdbool.h> # include <stddef.h> # include "filename.h" +# include "basename-lgpl.h" # ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' # endif -# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT -# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 -# endif - #ifdef __cplusplus extern "C" { #endif @@ -41,9 +38,7 @@ char *dir_name (char const *file); # endif char *mdir_name (char const *file); -size_t base_len (char const *file) _GL_ATTRIBUTE_PURE; size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE; -char *last_component (char const *file) _GL_ATTRIBUTE_PURE; bool strip_trailing_slashes (char *file); diff --git a/gnulib/import/dup-safer-flag.c b/gnulib/import/dup-safer-flag.c index b2c345e..bba1354 100644 --- a/gnulib/import/dup-safer-flag.c +++ b/gnulib/import/dup-safer-flag.c @@ -1,7 +1,7 @@ /* Duplicate a file descriptor result, avoiding clobbering STD{IN,OUT,ERR}_FILENO, with specific flags. - Copyright (C) 2001, 2004-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2004-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/dup-safer.c b/gnulib/import/dup-safer.c index 4ada3fe..2db1520 100644 --- a/gnulib/import/dup-safer.c +++ b/gnulib/import/dup-safer.c @@ -1,6 +1,6 @@ /* Invoke dup, but avoid some glitches. - Copyright (C) 2001, 2004-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2004-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/dup.c b/gnulib/import/dup.c index 974d446..104d482 100644 --- a/gnulib/import/dup.c +++ b/gnulib/import/dup.c @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ #undef dup -#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +#if defined _WIN32 && !defined __CYGWIN__ +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER static int dup_nothrow (int fd) { @@ -36,7 +37,7 @@ dup_nothrow (int fd) TRY_MSVC_INVAL { - result = dup (fd); + result = _dup (fd); } CATCH_MSVC_INVAL { @@ -47,6 +48,9 @@ dup_nothrow (int fd) return result; } +# else +# define dup_nothrow _dup +# endif #elif defined __KLIBC__ # include <fcntl.h> # include <sys/stat.h> diff --git a/gnulib/import/dup2.c b/gnulib/import/dup2.c index 88ef259..c4a0a29 100644 --- a/gnulib/import/dup2.c +++ b/gnulib/import/dup2.c @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor to a specified file descriptor. - Copyright (C) 1999, 2004-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1999, 2004-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,28 +25,26 @@ #include <errno.h> #include <fcntl.h> -#if HAVE_DUP2 +#undef dup2 -# undef dup2 - -# if defined _WIN32 && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* Get declarations of the native Windows API functions. */ -# define WIN32_LEAN_AND_MEAN -# include <windows.h> +# define WIN32_LEAN_AND_MEAN +# include <windows.h> -# if HAVE_MSVC_INVALID_PARAMETER_HANDLER -# include "msvc-inval.h" -# endif +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +# endif /* Get _get_osfhandle. */ -# if GNULIB_MSVC_NOTHROW -# include "msvc-nothrow.h" -# else -# include <io.h> -# endif +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include <io.h> +# endif -# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER static int dup2_nothrow (int fd, int desired_fd) { @@ -54,7 +52,7 @@ dup2_nothrow (int fd, int desired_fd) TRY_MSVC_INVAL { - result = dup2 (fd, desired_fd); + result = _dup2 (fd, desired_fd); } CATCH_MSVC_INVAL { @@ -65,9 +63,9 @@ dup2_nothrow (int fd, int desired_fd) return result; } -# else -# define dup2_nothrow dup2 -# endif +# else +# define dup2_nothrow _dup2 +# endif static int ms_windows_dup2 (int fd, int desired_fd) @@ -103,11 +101,11 @@ ms_windows_dup2 (int fd, int desired_fd) return result; } -# define dup2 ms_windows_dup2 +# define dup2 ms_windows_dup2 -# elif defined __KLIBC__ +#elif defined __KLIBC__ -# include <InnoTekLIBC/backend.h> +# include <InnoTekLIBC/backend.h> static int klibc_dup2dirfd (int fd, int desired_fd) @@ -155,81 +153,37 @@ klibc_dup2 (int fd, int desired_fd) return dupfd; } -# define dup2 klibc_dup2 -# endif +# define dup2 klibc_dup2 +#endif int rpl_dup2 (int fd, int desired_fd) { int result; -# ifdef F_GETFL +#ifdef F_GETFL /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF. On Cygwin 1.5.x, dup2 (1, 1) returns 0. On Cygwin 1.7.17, dup2 (1, -1) dumps core. On Cygwin 1.7.25, dup2 (1, 256) can dump core. On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */ -# if HAVE_SETDTABLESIZE +# if HAVE_SETDTABLESIZE setdtablesize (desired_fd + 1); -# endif +# endif if (desired_fd < 0) fd = desired_fd; if (fd == desired_fd) return fcntl (fd, F_GETFL) == -1 ? -1 : fd; -# endif +#endif result = dup2 (fd, desired_fd); /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */ if (result == -1 && errno == EMFILE) errno = EBADF; -# if REPLACE_FCHDIR +#if REPLACE_FCHDIR if (fd != desired_fd && result != -1) result = _gl_register_dup (fd, result); -# endif - return result; -} - -#else /* !HAVE_DUP2 */ - -/* On older platforms, dup2 did not exist. */ - -# ifndef F_DUPFD -static int -dupfd (int fd, int desired_fd) -{ - int duplicated_fd = dup (fd); - if (duplicated_fd < 0 || duplicated_fd == desired_fd) - return duplicated_fd; - else - { - int r = dupfd (fd, desired_fd); - int e = errno; - close (duplicated_fd); - errno = e; - return r; - } -} -# endif - -int -dup2 (int fd, int desired_fd) -{ - int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd; - if (result == -1 || fd == desired_fd) - return result; - close (desired_fd); -# ifdef F_DUPFD - result = fcntl (fd, F_DUPFD, desired_fd); -# if REPLACE_FCHDIR - if (0 <= result) - result = _gl_register_dup (fd, result); -# endif -# else - result = dupfd (fd, desired_fd); -# endif - if (result == -1 && (errno == EMFILE || errno == EINVAL)) - errno = EBADF; +#endif return result; } -#endif /* !HAVE_DUP2 */ diff --git a/gnulib/import/eloop-threshold.h b/gnulib/import/eloop-threshold.h new file mode 100644 index 0000000..27d07a7 --- /dev/null +++ b/gnulib/import/eloop-threshold.h @@ -0,0 +1,83 @@ +/* Threshold at which to diagnose ELOOP. Generic version. + Copyright (C) 2012-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _ELOOP_THRESHOLD_H +#define _ELOOP_THRESHOLD_H 1 + +#include <limits.h> +#ifdef _LIBC +# include <sys/param.h> +# define _GL_ATTRIBUTE_CONST __attribute__ ((const)) +#else +# include <unistd.h> +# include "minmax.h" +# define __sysconf sysconf +# if (!defined SYMLOOP_MAX \ + && ! (defined _SC_SYMLOOP_MAX && defined _POSIX_SYMLOOP_MAX)) +# define SYMLOOP_MAX 8 +# endif +#endif + +/* POSIX specifies SYMLOOP_MAX as the "Maximum number of symbolic + links that can be reliably traversed in the resolution of a + pathname in the absence of a loop." This makes it a minimum that + we should certainly accept. But it leaves open the possibility + that more might sometimes work--just not "reliably". + + For example, Linux implements a complex policy whereby there is a + small limit on the number of direct symlink traversals (a symlink + to a symlink to a symlink), but larger limit on the total number of + symlink traversals overall. Hence the SYMLOOP_MAX number should be + the small one, but the limit library functions enforce on users + should be the larger one. + + So, we use the larger of the reported SYMLOOP_MAX (if any) and our + own constant MIN_ELOOP_THRESHOLD, below. This constant should be + large enough that it never rules out a file name and directory tree + that the underlying system (i.e. calls to 'open' et al) would + resolve successfully. It should be small enough that actual loops + are detected without a huge number of iterations. */ + +#ifndef MIN_ELOOP_THRESHOLD +# define MIN_ELOOP_THRESHOLD 40 +#endif + +/* Return the maximum number of symlink traversals to permit + before diagnosing ELOOP. */ +static inline unsigned int _GL_ATTRIBUTE_CONST +__eloop_threshold (void) +{ +#ifdef SYMLOOP_MAX + const int symloop_max = SYMLOOP_MAX; +#else + /* The function is marked 'const' even though we use memory and + call a function, because sysconf is required to return the + same value in every call and so it must always be safe to + call __eloop_threshold exactly once and reuse the value. */ + static long int sysconf_symloop_max; + if (sysconf_symloop_max == 0) + sysconf_symloop_max = __sysconf (_SC_SYMLOOP_MAX); + const unsigned int symloop_max = (sysconf_symloop_max <= 0 + ? _POSIX_SYMLOOP_MAX + : sysconf_symloop_max); +#endif + + return MAX (symloop_max, MIN_ELOOP_THRESHOLD); +} + +#endif /* eloop-threshold.h */ diff --git a/gnulib/import/errno.in.h b/gnulib/import/errno.in.h index c27e0c7..c6ab4e8 100644 --- a/gnulib/import/errno.in.h +++ b/gnulib/import/errno.in.h @@ -1,6 +1,6 @@ /* A POSIX-like <errno.h>. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/error.c b/gnulib/import/error.c index 3657b51..d17b5a6 100644 --- a/gnulib/import/error.c +++ b/gnulib/import/error.c @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2007, 2009-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify @@ -40,7 +40,7 @@ # include <wchar.h> # define mbsrtowcs __mbsrtowcs # define USE_UNLOCKED_IO 0 -# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b) +# define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(a, b) # define _GL_ARG_NONNULL(a) #else # include "getprogname.h" @@ -202,7 +202,7 @@ print_errno_message (int errnum) #endif } -static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3)) +static void _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3)) error_tail (int status, int errnum, const char *message, va_list args) { #if _LIBC diff --git a/gnulib/import/error.h b/gnulib/import/error.h index a351606..f65d072 100644 --- a/gnulib/import/error.h +++ b/gnulib/import/error.h @@ -1,5 +1,5 @@ /* Declaration for error-reporting function - Copyright (C) 1995-1997, 2003, 2006, 2008-2020 Free Software Foundation, + Copyright (C) 1995-1997, 2003, 2006, 2008-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -19,15 +19,8 @@ #ifndef _ERROR_H #define _ERROR_H 1 -/* On mingw, the flavor of printf depends on whether the extensions module - * is in use; the check for <stdio.h> determines the witness macro. */ -#ifndef _GL_ATTRIBUTE_SPEC_PRINTF -# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU -# define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__ -# else -# define _GL_ATTRIBUTE_SPEC_PRINTF __printf__ -# endif -#endif +/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */ +#include <stdio.h> #ifdef __cplusplus extern "C" { @@ -38,11 +31,21 @@ extern "C" { If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */ extern void error (int __status, int __errnum, const char *__format, ...) - _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4)); +#if GNULIB_VFPRINTF_POSIX + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4)) +#else + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 3, 4)) +#endif + ; extern void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __lineno, const char *__format, ...) - _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6)); +#if GNULIB_VFPRINTF_POSIX + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 6)) +#else + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 5, 6)) +#endif + ; /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this diff --git a/gnulib/import/exitfail.c b/gnulib/import/exitfail.c index 189fa16..15ce2e6 100644 --- a/gnulib/import/exitfail.c +++ b/gnulib/import/exitfail.c @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/exitfail.h b/gnulib/import/exitfail.h index a69a03b..571729c 100644 --- a/gnulib/import/exitfail.h +++ b/gnulib/import/exitfail.h @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/extra/update-copyright b/gnulib/import/extra/update-copyright index d9b7f68..fae3a5f 100755 --- a/gnulib/import/extra/update-copyright +++ b/gnulib/import/extra/update-copyright @@ -3,7 +3,7 @@ # Update an FSF copyright year list to include the current year. -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/fchdir.c b/gnulib/import/fchdir.c index 1fa9a7e..c6294cb 100644 --- a/gnulib/import/fchdir.c +++ b/gnulib/import/fchdir.c @@ -1,5 +1,5 @@ /* fchdir replacement. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/fcntl.c b/gnulib/import/fcntl.c index 6b9927e..9d6b10f 100644 --- a/gnulib/import/fcntl.c +++ b/gnulib/import/fcntl.c @@ -1,6 +1,6 @@ /* Provide file descriptor control. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,14 +70,14 @@ dupfd (int oldfd, int newfd, int flags) return -1; } if (old_handle == INVALID_HANDLE_VALUE - || (mode = setmode (oldfd, O_BINARY)) == -1) + || (mode = _setmode (oldfd, O_BINARY)) == -1) { /* oldfd is not open, or is an unassigned standard file descriptor. */ errno = EBADF; return -1; } - setmode (oldfd, mode); + _setmode (oldfd, mode); flags |= mode; for (;;) @@ -491,7 +491,9 @@ rpl_fcntl_DUPFD_CLOEXEC (int fd, int target) #if !HAVE_FCNTL result = dupfd (fd, target, O_CLOEXEC); #else /* HAVE_FCNTL */ -# if defined __HAIKU__ +# if defined __NetBSD__ || defined __HAIKU__ + /* On NetBSD 9.0, the system fcntl (fd, F_DUPFD_CLOEXEC, target) + has only the same effect as fcntl (fd, F_DUPFD, target). */ /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets the FD_CLOEXEC flag on fd, not on target. Therefore avoid the system fcntl in this case. */ diff --git a/gnulib/import/fcntl.in.h b/gnulib/import/fcntl.in.h index 0a21c95..0b14467 100644 --- a/gnulib/import/fcntl.in.h +++ b/gnulib/import/fcntl.in.h @@ -1,6 +1,6 @@ /* Like <fcntl.h>, but with non-working flags defined to 0. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -97,6 +97,12 @@ _GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef creat +# define creat _creat +# endif +_GL_CXXALIAS_MDA (creat, int, (const char *filename, mode_t mode)); # else _GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode)); # endif @@ -106,6 +112,21 @@ _GL_CXXALIASWARN (creat); /* Assume creat is always declared. */ _GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - " "use gnulib module creat for portability"); +#elif @GNULIB_MDA_CREAT@ +/* On native Windows, map 'creat' to '_creat', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::creat always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef creat +# define creat _creat +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (creat, int, (const char *filename, mode_t mode)); +# else +_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode)); +# endif +_GL_CXXALIASWARN (creat); #endif #if @GNULIB_FCNTL@ @@ -146,6 +167,12 @@ _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - " _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open _open +# endif +_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); # else _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); # endif @@ -159,6 +186,22 @@ _GL_CXXALIASWARN (open); /* Assume open is always declared. */ _GL_WARN_ON_USE (open, "open is not always POSIX compliant - " "use gnulib module open for portability"); +#elif @GNULIB_MDA_OPEN@ +/* On native Windows, map 'open' to '_open', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::open always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open _open +# endif +_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); +# else +_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); +# endif +# if !defined __hpux +_GL_CXXALIASWARN (open); +# endif #endif #if @GNULIB_OPENAT@ diff --git a/gnulib/import/fd-hook.c b/gnulib/import/fd-hook.c index 8840f63..d8113eb 100644 --- a/gnulib/import/fd-hook.c +++ b/gnulib/import/fd-hook.c @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/gnulib/import/fd-hook.h b/gnulib/import/fd-hook.h index ed1a15a..bf1f394 100644 --- a/gnulib/import/fd-hook.h +++ b/gnulib/import/fd-hook.h @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib/import/fd-safer-flag.c b/gnulib/import/fd-safer-flag.c index 8fdf8db..bfaef4d 100644 --- a/gnulib/import/fd-safer-flag.c +++ b/gnulib/import/fd-safer-flag.c @@ -1,7 +1,7 @@ /* Adjust a file descriptor result so that it avoids clobbering STD{IN,OUT,ERR}_FILENO, with specific flags. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/fd-safer.c b/gnulib/import/fd-safer.c index e011c00..487b039 100644 --- a/gnulib/import/fd-safer.c +++ b/gnulib/import/fd-safer.c @@ -1,6 +1,6 @@ /* Return a safer copy of a file descriptor. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/fdopendir.c b/gnulib/import/fdopendir.c index 883c0c4..451b4e1 100644 --- a/gnulib/import/fdopendir.c +++ b/gnulib/import/fdopendir.c @@ -1,5 +1,5 @@ /* provide a replacement fdopendir function - Copyright (C) 2004-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/filename.h b/gnulib/import/filename.h index 4598fb1..541ffec 100644 --- a/gnulib/import/filename.h +++ b/gnulib/import/filename.h @@ -1,18 +1,20 @@ /* Basic filename support macros. - Copyright (C) 2001-2004, 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2007-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. */ + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ /* From Paul Eggert and Jim Meyering. */ diff --git a/gnulib/import/filenamecat-lgpl.c b/gnulib/import/filenamecat-lgpl.c index d97abfa..008a640 100644 --- a/gnulib/import/filenamecat-lgpl.c +++ b/gnulib/import/filenamecat-lgpl.c @@ -1,6 +1,6 @@ /* Concatenate two arbitrary file names. - Copyright (C) 1996-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,8 @@ #include <stdlib.h> #include <string.h> -#include "dirname.h" +#include "basename-lgpl.h" +#include "filename.h" #if ! HAVE_MEMPCPY && ! defined mempcpy # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) diff --git a/gnulib/import/filenamecat.h b/gnulib/import/filenamecat.h index 13387b4..15c5cf8 100644 --- a/gnulib/import/filenamecat.h +++ b/gnulib/import/filenamecat.h @@ -1,6 +1,6 @@ /* Concatenate two arbitrary file names. - Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2020 Free Software + Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/flexmember.h b/gnulib/import/flexmember.h index 0dc77c3..9f6e1bf 100644 --- a/gnulib/import/flexmember.h +++ b/gnulib/import/flexmember.h @@ -1,6 +1,6 @@ /* Sizes of structs with flexible array members. - Copyright 2016-2020 Free Software Foundation, Inc. + Copyright 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/float+.h b/gnulib/import/float+.h index 1e19a71..97c0b0aa 100644 --- a/gnulib/import/float+.h +++ b/gnulib/import/float+.h @@ -1,5 +1,5 @@ /* Supplemental information about the floating-point formats. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2007. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/float.c b/gnulib/import/float.c index af20b0a..6ef47a4 100644 --- a/gnulib/import/float.c +++ b/gnulib/import/float.c @@ -1,5 +1,5 @@ /* Auxiliary definitions for <float.h>. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/float.in.h b/gnulib/import/float.in.h index 8e4d47d..d2ac0cd 100644 --- a/gnulib/import/float.in.h +++ b/gnulib/import/float.in.h @@ -1,6 +1,6 @@ /* A correct <float.h>. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -93,11 +93,14 @@ extern const long double LDBL_MAX; Unfortunately, this is not a constant expression. */ +# if !GNULIB_defined_long_double_union union gl_long_double_union { struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd; long double ld; }; +# define GNULIB_defined_long_double_union 1 +# endif extern const union gl_long_double_union gl_LDBL_MAX; # define LDBL_MAX (gl_LDBL_MAX.ld) /* Minimum e such that 10^e is in the range of normalized numbers. */ @@ -146,11 +149,14 @@ extern const union gl_long_double_union gl_LDBL_MAX; Unfortunately, this is not a constant expression, and the latter expression does not work well when GCC is optimizing.. */ +# if !GNULIB_defined_long_double_union union gl_long_double_union { struct { double hi; double lo; } dd; long double ld; }; +# define GNULIB_defined_long_double_union 1 +# endif extern const union gl_long_double_union gl_LDBL_MAX; # define LDBL_MAX (gl_LDBL_MAX.ld) #endif diff --git a/gnulib/import/fnmatch.c b/gnulib/import/fnmatch.c index 3937ce3..2db2a3b 100644 --- a/gnulib/import/fnmatch.c +++ b/gnulib/import/fnmatch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -64,10 +64,10 @@ extern int fnmatch (const char *pattern, const char *string, int flags); #endif #ifdef _LIBC -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else +# if (__GNUC__ >= 7) || (__clang_major__ >= 10) # define FALLTHROUGH __attribute__ ((__fallthrough__)) +# else +# define FALLTHROUGH ((void) 0) # endif #else # include "attribute.h" @@ -76,6 +76,12 @@ extern int fnmatch (const char *pattern, const char *string, int flags); #include <intprops.h> #include <flexmember.h> +#ifdef _LIBC +typedef ptrdiff_t idx_t; +#else +# include "idx.h" +#endif + /* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */ #define NO_LEADING_PERIOD(flags) \ ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD)) diff --git a/gnulib/import/fnmatch.in.h b/gnulib/import/fnmatch.in.h index 76ac721..4183d5e 100644 --- a/gnulib/import/fnmatch.in.h +++ b/gnulib/import/fnmatch.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <fnmatch.h>. - Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2020 Free + Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/fnmatch_loop.c b/gnulib/import/fnmatch_loop.c index ebd6af3..f3e5723 100644 --- a/gnulib/import/fnmatch_loop.c +++ b/gnulib/import/fnmatch_loop.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -549,7 +549,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, /* Get the collation sequence value. */ is_seqval = true; # if WIDE_CHAR_VERSION - cold = wextra[1 + wextra[idx]]; + cold = wextra[1 + wextra[0]]; # else idx += 1 + extra[idx]; /* Adjust for the alignment. */ @@ -726,7 +726,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, /* Get the collation sequence value. */ is_seqval = true; # if WIDE_CHAR_VERSION - cend = wextra[1 + wextra[idx]]; + cend = wextra[1 + wextra[0]]; # else idx += 1 + extra[idx]; /* Adjust for the alignment. */ @@ -978,12 +978,12 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, bool no_leading_period, int flags, size_t alloca_used) { const CHAR *startp; - size_t level; + ptrdiff_t level; struct patternlist { struct patternlist *next; CHAR malloced; - CHAR str[FLEXIBLE_ARRAY_MEMBER]; + CHAR str __flexarr; } *list = NULL; struct patternlist **lastp = &list; size_t pattern_len = STRLEN (pattern); @@ -994,7 +994,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, /* Parse the pattern. Store the individual parts in the list. */ level = 0; - for (startp = p = pattern + 1; ; ++p) + for (startp = p = pattern + 1; level >= 0; ++p) if (*p == L_('\0')) { /* This is an invalid pattern. */ @@ -1036,9 +1036,9 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, struct patternlist *newp; \ size_t plen = (opt == L_('?') || opt == L_('@') \ ? pattern_len : (p - startp + 1UL)); \ - ptrdiff_t slen = FLEXSIZEOF (struct patternlist, str, 0); \ - ptrdiff_t new_used = alloca_used + slen; \ - ptrdiff_t plensize; \ + idx_t slen = FLEXSIZEOF (struct patternlist, str, 0); \ + idx_t new_used = alloca_used + slen; \ + idx_t plensize; \ if (INT_MULTIPLY_WRAPV (plen, sizeof (CHAR), &plensize) \ || INT_ADD_WRAPV (new_used, plensize, &new_used)) \ { \ @@ -1065,7 +1065,6 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, *lastp = newp; \ lastp = &newp->next NEW_PATTERN; - break; } } else if (*p == L_('|')) diff --git a/gnulib/import/fpucw.h b/gnulib/import/fpucw.h index 1c6edf6..f6ed550 100644 --- a/gnulib/import/fpucw.h +++ b/gnulib/import/fpucw.h @@ -1,5 +1,5 @@ /* Manipulating the FPU control word. -*- coding: utf-8 -*- - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2007. This program is free software: you can redistribute it and/or modify @@ -61,8 +61,8 @@ 'long double' safe operation precision */ -/* Inline assembler like this works only with GNU C. */ -#if (defined __i386__ || defined __x86_64__) && defined __GNUC__ +/* Inline assembler like this works only with GNU C and clang. */ +#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__) typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */ diff --git a/gnulib/import/free.c b/gnulib/import/free.c new file mode 100644 index 0000000..5c89787 --- /dev/null +++ b/gnulib/import/free.c @@ -0,0 +1,47 @@ +/* Make free() preserve errno. + + Copyright (C) 2003, 2006, 2009-2021 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* written by Paul Eggert */ + +#include <config.h> + +#include <stdlib.h> + +#include <errno.h> + +void +rpl_free (void *p) +#undef free +{ +#if defined __GNUC__ && !defined __clang__ + /* An invalid GCC optimization + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396> + would optimize away the assignments in the code below, when link-time + optimization (LTO) is enabled. Make the code more complicated, so that + GCC does not grok how to optimize it. */ + int err[2]; + err[0] = errno; + err[1] = errno; + errno = 0; + free (p); + errno = err[errno == 0]; +#else + int err = errno; + free (p); + errno = err; +#endif +} diff --git a/gnulib/import/frexp.c b/gnulib/import/frexp.c index ad1dba7..288ca66 100644 --- a/gnulib/import/frexp.c +++ b/gnulib/import/frexp.c @@ -1,5 +1,5 @@ /* Split a double into fraction and mantissa. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/frexpl.c b/gnulib/import/frexpl.c index 49484cb..a5b1fd9 100644 --- a/gnulib/import/frexpl.c +++ b/gnulib/import/frexpl.c @@ -1,5 +1,5 @@ /* Split a 'long double' into fraction and mantissa. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/fstat.c b/gnulib/import/fstat.c index 235014a..05b9c86 100644 --- a/gnulib/import/fstat.c +++ b/gnulib/import/fstat.c @@ -1,5 +1,5 @@ /* fstat() replacement. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/fstatat.c b/gnulib/import/fstatat.c index 9da1269..640a375 100644 --- a/gnulib/import/fstatat.c +++ b/gnulib/import/fstatat.c @@ -1,6 +1,6 @@ /* Work around an fstatat bug on Solaris 9. - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/getcwd-lgpl.c b/gnulib/import/getcwd-lgpl.c index fca6bde..e8c9e08 100644 --- a/gnulib/import/getcwd-lgpl.c +++ b/gnulib/import/getcwd-lgpl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2020 Free Software Foundation, Inc. +/* Copyright (C) 2011-2021 Free Software Foundation, Inc. This file is part of gnulib. This program is free software: you can redistribute it and/or modify @@ -38,6 +38,10 @@ typedef int dummy; necessary. */ # undef getcwd +# if defined _WIN32 && !defined __CYGWIN__ +# define getcwd _getcwd +# endif + char * rpl_getcwd (char *buf, size_t size) { diff --git a/gnulib/import/getcwd.c b/gnulib/import/getcwd.c index 1a42ef1..6b2ac73 100644 --- a/gnulib/import/getcwd.c +++ b/gnulib/import/getcwd.c @@ -1,22 +1,29 @@ -/* Copyright (C) 1991-1999, 2004-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. */ + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #if !_LIBC # include <config.h> # include <unistd.h> +# include "pathmax.h" +#else +# define HAVE_OPENAT 1 +# define D_INO_IN_DIRENT 1 +# define HAVE_MSVC_INVALID_PARAMETER_HANDLER 0 +# define HAVE_MINIMALLY_WORKING_GETCWD 0 #endif #include <errno.h> @@ -65,8 +72,6 @@ # define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif -#include "pathmax.h" - /* In this file, PATH_MAX only serves as a threshold for choosing among two algorithms. */ #ifndef PATH_MAX @@ -84,11 +89,24 @@ #endif #if !_LIBC -# define __getcwd rpl_getcwd -# define __lstat lstat +# define GETCWD_RETURN_TYPE char * +# define __close_nocancel_nostatus close +# define __getcwd_generic rpl_getcwd +# undef stat64 +# define stat64 stat +# define __fstat64 fstat +# define __fstatat64 fstatat +# define __lstat64 lstat # define __closedir closedir # define __opendir opendir -# define __readdir readdir +# define __readdir64 readdir +# define __fdopendir fdopendir +# define __openat openat +# define __rewinddir rewinddir +# define __openat64 openat +# define dirent64 dirent +#else +# include <not-cancel.h> #endif /* The results of opendir() in this file are not used with dirfd and fchdir, @@ -104,7 +122,7 @@ # undef closedir #endif -#ifdef _MSC_VER +#if defined _WIN32 && !defined __CYGWIN__ # if HAVE_MSVC_INVALID_PARAMETER_HANDLER static char * getcwd_nothrow (char *buf, size_t size) @@ -138,8 +156,8 @@ getcwd_nothrow (char *buf, size_t size) if BUF is NULL, an array is allocated with 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ -char * -__getcwd (char *buf, size_t size) +GETCWD_RETURN_TYPE +__getcwd_generic (char *buf, size_t size) { /* Lengths of big file name components and entire file names, and a deep level of file name nesting. These numbers are not upper @@ -167,7 +185,7 @@ __getcwd (char *buf, size_t size) ino_t rootino, thisino; char *dir; register char *dirp; - struct stat st; + struct stat64 st; size_t allocated = size; size_t used; @@ -210,7 +228,6 @@ __getcwd (char *buf, size_t size) return NULL; # endif #endif - if (size == 0) { if (buf != NULL) @@ -234,19 +251,19 @@ __getcwd (char *buf, size_t size) dirp = dir + allocated; *--dirp = '\0'; - if (__lstat (".", &st) < 0) + if (__lstat64 (".", &st) < 0) goto lose; thisdev = st.st_dev; thisino = st.st_ino; - if (__lstat ("/", &st) < 0) + if (__lstat64 ("/", &st) < 0) goto lose; rootdev = st.st_dev; rootino = st.st_ino; while (!(thisdev == rootdev && thisino == rootino)) { - struct dirent *d; + struct dirent64 *d; dev_t dotdev; ino_t dotino; bool mount_point; @@ -257,16 +274,16 @@ __getcwd (char *buf, size_t size) /* Look at the parent directory. */ #if HAVE_OPENAT_SUPPORT - fd = openat (fd, "..", O_RDONLY); + fd = __openat64 (fd, "..", O_RDONLY); if (fd < 0) goto lose; fd_needs_closing = true; - parent_status = fstat (fd, &st); + parent_status = __fstat64 (fd, &st); #else dotlist[dotlen++] = '.'; dotlist[dotlen++] = '.'; dotlist[dotlen] = '\0'; - parent_status = __lstat (dotlist, &st); + parent_status = __lstat64 (dotlist, &st); #endif if (parent_status != 0) goto lose; @@ -284,7 +301,7 @@ __getcwd (char *buf, size_t size) /* Search for the last directory. */ #if HAVE_OPENAT_SUPPORT - dirstream = fdopendir (fd); + dirstream = __fdopendir (fd); if (dirstream == NULL) goto lose; fd_needs_closing = false; @@ -299,7 +316,7 @@ __getcwd (char *buf, size_t size) /* Clear errno to distinguish EOF from error if readdir returns NULL. */ __set_errno (0); - d = __readdir (dirstream); + d = __readdir64 (dirstream); /* When we've iterated through all directory entries without finding one with a matching d_ino, rewind the stream and consider each @@ -311,8 +328,8 @@ __getcwd (char *buf, size_t size) if (d == NULL && errno == 0 && use_d_ino) { use_d_ino = false; - rewinddir (dirstream); - d = __readdir (dirstream); + __rewinddir (dirstream); + d = __readdir64 (dirstream); } if (d == NULL) @@ -338,7 +355,7 @@ __getcwd (char *buf, size_t size) { int entry_status; #if HAVE_OPENAT_SUPPORT - entry_status = fstatat (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW); + entry_status = __fstatat64 (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW); #else /* Compute size needed for this file name, or for the file name ".." in the same directory, whichever is larger. @@ -375,7 +392,7 @@ __getcwd (char *buf, size_t size) } memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d)); - entry_status = __lstat (dotlist, &st); + entry_status = __lstat64 (dotlist, &st); #endif /* We don't fail here if we cannot stat() a directory entry. This can happen when (network) file systems fail. If this @@ -461,7 +478,7 @@ __getcwd (char *buf, size_t size) __closedir (dirstream); #if HAVE_OPENAT_SUPPORT if (fd_needs_closing) - close (fd); + __close_nocancel_nostatus (fd); #else if (dotlist != dots) free (dotlist); @@ -473,6 +490,7 @@ __getcwd (char *buf, size_t size) return NULL; } -#ifdef weak_alias +#if defined _LIBC && !defined GETCWD_RETURN_TYPE +libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) #endif diff --git a/gnulib/import/getdtablesize.c b/gnulib/import/getdtablesize.c index 0fe7092..56eaf5d 100644 --- a/gnulib/import/getdtablesize.c +++ b/gnulib/import/getdtablesize.c @@ -1,5 +1,5 @@ /* getdtablesize() function: Return maximum possible file descriptor value + 1. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/getlogin_r.c b/gnulib/import/getlogin_r.c index a461112..f926329 100644 --- a/gnulib/import/getlogin_r.c +++ b/gnulib/import/getlogin_r.c @@ -1,6 +1,6 @@ /* Provide a working getlogin_r for systems which lack it. - Copyright (C) 2005-2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2010-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/getprogname.c b/gnulib/import/getprogname.c index b9667ff..500619d 100644 --- a/gnulib/import/getprogname.c +++ b/gnulib/import/getprogname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,7 +51,13 @@ # include <sys/procfs.h> #endif -#include "dirname.h" +#if defined __SCO_VERSION__ || defined __sysv5__ +# include <fcntl.h> +# include <stdlib.h> +# include <string.h> +#endif + +#include "basename-lgpl.h" #ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */ char const * @@ -245,6 +251,38 @@ getprogname (void) } } return NULL; +# elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */ + char buf[80]; + int fd; + sprintf (buf, "/proc/%d/cmdline", getpid()); + fd = open (buf, O_RDONLY); + if (0 <= fd) + { + size_t n = read (fd, buf, 79); + if (n > 0) + { + buf[n] = '\0'; /* Guarantee null-termination */ + char *progname; + progname = strrchr (buf, '/'); + if (progname) + { + progname = progname + 1; /* Skip the '/' */ + } + else + { + progname = buf; + } + char *ret; + ret = malloc (strlen (progname) + 1); + if (ret) + { + strcpy (ret, progname); + return ret; + } + } + close (fd); + } + return "?"; # else # error "getprogname module not ported to this OS" # endif diff --git a/gnulib/import/getprogname.h b/gnulib/import/getprogname.h index 676912b..502f2cd 100644 --- a/gnulib/import/getprogname.h +++ b/gnulib/import/getprogname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/getrandom.c b/gnulib/import/getrandom.c index 030a78b..41212fb 100644 --- a/gnulib/import/getrandom.c +++ b/gnulib/import/getrandom.c @@ -1,6 +1,6 @@ /* Obtain a series of random bytes. - Copyright 2020 Free Software Foundation, Inc. + Copyright 2020-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ # if HAVE_BCRYPT_H # include <bcrypt.h> # else -# include <ntdef.h> /* NTSTATUS */ +# define NTSTATUS LONG typedef void * BCRYPT_ALG_HANDLE; # define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 # if HAVE_LIB_BCRYPT diff --git a/gnulib/import/gettext.h b/gnulib/import/gettext.h index 0bd1e13..3552157 100644 --- a/gnulib/import/gettext.h +++ b/gnulib/import/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU <libintl.h>. - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2020 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/gettimeofday.c b/gnulib/import/gettimeofday.c index 057cebd..b1c93e1 100644 --- a/gnulib/import/gettimeofday.c +++ b/gnulib/import/gettimeofday.c @@ -1,6 +1,6 @@ /* Provide gettimeofday for systems that don't have it or for which it's broken. - Copyright (C) 2001-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,8 +29,6 @@ # include <windows.h> #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/gnulib/import/glob-libc.h b/gnulib/import/glob-libc.h index 3cbe3b4..97bf1ec 100644 --- a/gnulib/import/glob-libc.h +++ b/gnulib/import/glob-libc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/glob.c b/gnulib/import/glob.c index f1b20d4..1bfcafb 100644 --- a/gnulib/import/glob.c +++ b/gnulib/import/glob.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -59,12 +59,6 @@ # define readdir(str) __readdir64 (str) # define getpwnam_r(name, bufp, buf, len, res) \ __getpwnam_r (name, bufp, buf, len, res) -# ifndef __lstat64 -# define __lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf) -# endif -# ifndef __stat64 -# define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) -# endif # define struct_stat64 struct stat64 # define FLEXIBLE_ARRAY_MEMBER # include <shlib-compat.h> @@ -72,8 +66,8 @@ # define __glob glob # define __getlogin_r(buf, len) getlogin_r (buf, len) # define __lstat64(fname, buf) lstat (fname, buf) -# ifdef __MINGW32__ - /* Avoid GCC warning. mingw has an unused __stat64 macro. */ +# if defined _WIN32 && !defined __CYGWIN__ + /* Avoid GCC or clang warning. The original __stat64 macro is unused. */ # undef __stat64 # endif # define __stat64(fname, buf) stat (fname, buf) @@ -227,7 +221,7 @@ glob_lstat (glob_t *pglob, int flags, const char *fullname) static bool size_add_wrapv (size_t a, size_t b, size_t *r) { -#if 5 <= __GNUC__ && !defined __ICC +#if 7 <= __GNUC__ && !defined __ICC return __builtin_add_overflow (a, b, r); #else *r = a + b; diff --git a/gnulib/import/glob.in.h b/gnulib/import/glob.in.h index c80abfb..f46ddcf 100644 --- a/gnulib/import/glob.in.h +++ b/gnulib/import/glob.in.h @@ -1,6 +1,6 @@ /* glob.h -- Find a path matching a pattern. - Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU> @@ -45,7 +45,9 @@ 'configure' might #define 'restrict' to those words, so pick a different name. */ #ifndef _Restrict_ -# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) +# if defined __restrict \ + || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ + || __clang_major__ >= 3 # define _Restrict_ __restrict # elif 199901L <= __STDC_VERSION__ || defined restrict # define _Restrict_ restrict diff --git a/gnulib/import/glob_internal.h b/gnulib/import/glob_internal.h index 87a187d..46df731 100644 --- a/gnulib/import/glob_internal.h +++ b/gnulib/import/glob_internal.h @@ -1,5 +1,5 @@ /* Shared definition for glob and glob_pattern_p. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/glob_pattern_p.c b/gnulib/import/glob_pattern_p.c index 1408a24..e6a3bc7 100644 --- a/gnulib/import/glob_pattern_p.c +++ b/gnulib/import/glob_pattern_p.c @@ -1,5 +1,5 @@ /* Return nonzero if PATTERN contains any metacharacters. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/globfree.c b/gnulib/import/globfree.c index c833bef..2dfdb70 100644 --- a/gnulib/import/globfree.c +++ b/gnulib/import/globfree.c @@ -1,5 +1,5 @@ /* Frees the dynamically allocated storage from an earlier call to glob. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/glthread/lock.c b/gnulib/import/glthread/lock.c index 10af6f2..83f7565 100644 --- a/gnulib/import/glthread/lock.c +++ b/gnulib/import/glthread/lock.c @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/glthread/lock.h b/gnulib/import/glthread/lock.h index 59485f2..fe43d6e 100644 --- a/gnulib/import/glthread/lock.h +++ b/gnulib/import/glthread/lock.h @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/glthread/threadlib.c b/gnulib/import/glthread/threadlib.c index 28bf3c6..373806e 100644 --- a/gnulib/import/glthread/threadlib.c +++ b/gnulib/import/glthread/threadlib.c @@ -1,5 +1,5 @@ /* Multithreading primitives. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,11 +24,44 @@ /* Use the POSIX threads library. */ +# include <errno.h> # include <pthread.h> # include <stdlib.h> # if PTHREAD_IN_USE_DETECTION_HARD +# if defined __FreeBSD__ || defined __DragonFly__ /* FreeBSD */ + +/* Test using pthread_key_create. */ + +int +glthread_in_use (void) +{ + static int tested; + static int result; /* 1: linked with -lpthread, 0: only with libc */ + + if (!tested) + { + pthread_key_t key; + int err = pthread_key_create (&key, NULL); + + if (err == ENOSYS) + result = 0; + else + { + result = 1; + if (err == 0) + pthread_key_delete (key); + } + tested = 1; + } + return result; +} + +# else /* Solaris, HP-UX */ + +/* Test using pthread_create. */ + /* The function to be executed by a dummy thread. */ static void * dummy_thread_func (void *arg) @@ -62,6 +95,8 @@ glthread_in_use (void) return result; } +# endif + # endif #endif diff --git a/gnulib/import/hard-locale.c b/gnulib/import/hard-locale.c index 730e9be..ccb75ee 100644 --- a/gnulib/import/hard-locale.c +++ b/gnulib/import/hard-locale.c @@ -1,6 +1,6 @@ /* hard-locale.c -- Determine whether a locale is hard. - Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2020 Free Software + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/hard-locale.h b/gnulib/import/hard-locale.h index 1886eaa..af09e26 100644 --- a/gnulib/import/hard-locale.h +++ b/gnulib/import/hard-locale.h @@ -1,6 +1,6 @@ /* Determine whether a locale is hard. - Copyright (C) 1999, 2003-2004, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1999, 2003-2004, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/idx.h b/gnulib/import/idx.h new file mode 100644 index 0000000..681c8c9 --- /dev/null +++ b/gnulib/import/idx.h @@ -0,0 +1,114 @@ +/* A type for indices and sizes. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _IDX_H +#define _IDX_H + +/* Get ptrdiff_t. */ +#include <stddef.h> + +/* Get PTRDIFF_MAX. */ +#include <stdint.h> + +/* The type 'idx_t' holds an (array) index or an (object) size. + Its implementation promotes to a signed integer type, + which can hold the values + 0..2^63-1 (on 64-bit platforms) or + 0..2^31-1 (on 32-bit platforms). + + Why a signed integer type? + + * Security: Signed types can be checked for overflow via + '-fsanitize=undefined', but unsigned types cannot. + + * Comparisons without surprises: ISO C99 § 6.3.1.8 specifies a few + surprising results for comparisons, such as + + (int) -3 < (unsigned long) 7 => false + (int) -3 < (unsigned int) 7 => false + and on 32-bit machines: + (long) -3 < (unsigned int) 7 => false + + This is surprising because the natural comparison order is by + value in the realm of infinite-precision signed integers (ℤ). + + The best way to get rid of such surprises is to use signed types + for numerical integer values, and use unsigned types only for + bit masks and enums. + + Why not use 'size_t' directly? + + * Because 'size_t' is an unsigned type, and a signed type is better. + See above. + + Why not use 'ptrdiff_t' directly? + + * Maintainability: When reading and modifying code, it helps to know that + a certain variable cannot have negative values. For example, when you + have a loop + + int n = ...; + for (int i = 0; i < n; i++) ... + + or + + ptrdiff_t n = ...; + for (ptrdiff_t i = 0; i < n; i++) ... + + you have to ask yourself "what if n < 0?". Whereas in + + idx_t n = ...; + for (idx_t i = 0; i < n; i++) ... + + you know that this case cannot happen. + + Similarly, when a programmer writes + + idx_t = ptr2 - ptr1; + + there is an implied assertion that ptr1 and ptr2 point into the same + object and that ptr1 <= ptr2. + + * Being future-proof: In the future, range types (integers which are + constrained to a certain range of values) may be added to C compilers + or to the C standard. Several programming languages (Ada, Haskell, + Common Lisp, Pascal) already have range types. Such range types may + help producing good code and good warnings. The type 'idx_t' could + then be typedef'ed to a range type that is signed after promotion. */ + +/* In the future, idx_t could be typedef'ed to a signed range type. + The clang "extended integer types", supported in Clang 11 or newer + <https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>, + are a special case of range types. However, these types don't support binary + operators with plain integer types (e.g. expressions such as x > 1). + Therefore, they don't behave like signed types (and not like unsigned types + either). So, we cannot use them here. */ + +/* Use the signed type 'ptrdiff_t'. */ +/* Note: ISO C does not mandate that 'size_t' and 'ptrdiff_t' have the same + size, but it is so on all platforms we have seen since 1990. */ +typedef ptrdiff_t idx_t; + +/* IDX_MAX is the maximum value of an idx_t. */ +#define IDX_MAX PTRDIFF_MAX + +/* So far no need has been found for an IDX_WIDTH macro. + Perhaps there should be another macro IDX_VALUE_BITS that does not + count the sign bit and is therefore one less than PTRDIFF_WIDTH. */ + +#endif /* _IDX_H */ diff --git a/gnulib/import/inet_ntop.c b/gnulib/import/inet_ntop.c index b380da4..9414db1 100644 --- a/gnulib/import/inet_ntop.c +++ b/gnulib/import/inet_ntop.c @@ -1,6 +1,6 @@ /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form - Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/intprops.h b/gnulib/import/intprops.h index dfbcaae..2a420ac 100644 --- a/gnulib/import/intprops.h +++ b/gnulib/import/intprops.h @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -48,7 +48,7 @@ /* Minimum and maximum values for integer types and expressions. */ /* The width in bits of the integer type or expression T. - Do not evaluate T. + Do not evaluate T. T must not be a bit-field expression. Padding bits are not supported; this is checked at compile-time below. */ #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) @@ -70,7 +70,7 @@ ? _GL_SIGNED_INT_MAXIMUM (e) \ : _GL_INT_NEGATE_CONVERT (e, 1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ - (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1) /* Work around OpenVMS incompatibility with C99. */ #if !defined LLONG_MAX && defined __INT64_MAX @@ -86,6 +86,7 @@ /* Does the __typeof__ keyword work? This could be done by 'configure', but for now it's easier to do it by hand. */ #if (2 <= __GNUC__ \ + || (4 <= __clang_major__) \ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (0x5110 <= __SUNPRO_C && !__STDC__)) # define _GL_HAVE___TYPEOF__ 1 @@ -94,8 +95,9 @@ #endif /* Return 1 if the integer type or expression T might be signed. Return 0 - if it is definitely unsigned. This macro does not evaluate its argument, - and expands to an integer constant expression. */ + if it is definitely unsigned. T must not be a bit-field expression. + This macro does not evaluate its argument, and expands to an + integer constant expression. */ #if _GL_HAVE___TYPEOF__ # define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t)) #else @@ -108,6 +110,8 @@ #define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) /* Bound on length of the string representing an integer type or expression T. + T must not be a bit-field expression. + Subtract 1 for the sign bit if T is signed, and then add 1 more for a minus sign if needed. @@ -119,7 +123,7 @@ + _GL_SIGNED_TYPE_OR_EXPR (t)) /* Bound on buffer size needed to represent an integer type or expression T, - including the terminating null. */ + including the terminating null. T must not be a bit-field expression. */ #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) @@ -222,7 +226,9 @@ /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow (A, B, P) work when P is non-null. */ -#if 5 <= __GNUC__ && !defined __ICC +/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, + see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */ +#if 7 <= __GNUC__ && !defined __ICC # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 #elif defined __has_builtin # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) @@ -239,8 +245,18 @@ #endif /* True if __builtin_add_overflow_p (A, B, C) works, and similarly for - __builtin_mul_overflow_p and __builtin_mul_overflow_p. */ -#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) + __builtin_sub_overflow_p and __builtin_mul_overflow_p. */ +#if defined __clang__ || defined __ICC +/* Clang 11 lacks __builtin_mul_overflow_p, and even if it did it + would presumably run afoul of Clang bug 16404. ICC 2021.1's + __builtin_add_overflow_p etc. are not treated as integral constant + expressions even when all arguments are. */ +# define _GL_HAS_BUILTIN_OVERFLOW_P 0 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p) +#else +# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) +#endif /* The _GL*_OVERFLOW macros have the same restrictions as the *_RANGE_OVERFLOW macros, except that they do not assume that operands @@ -373,8 +389,9 @@ _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW) #endif #if _GL_HAS_BUILTIN_MUL_OVERFLOW -# if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ - || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) +# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ + || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \ + && !defined __ICC) # define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r) # else /* Work around GCC bug 91450. */ @@ -395,7 +412,7 @@ For now, assume all versions of GCC-like compilers generate bogus warnings for _Generic. This matters only for compilers that lack relevant builtins. */ -#if __GNUC__ +#if __GNUC__ || defined __clang__ # define _GL__GENERIC_BOGUS 1 #else # define _GL__GENERIC_BOGUS 0 @@ -565,7 +582,7 @@ ? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \ ? (a) < (tmax) / (b) \ : ((INT_NEGATE_OVERFLOW (b) \ - ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (b) - 1) \ + ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (+ (b)) - 1) \ : (tmax) / -(b)) \ <= -1 - (a))) \ : INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \ @@ -581,4 +598,33 @@ : (tmin) / (a) < (b)) \ : (tmax) / (b) < (a))) +/* The following macros compute A + B, A - B, and A * B, respectively. + If no overflow occurs, they set *R to the result and return 1; + otherwise, they return 0 and may modify *R. + + Example usage: + + long int result; + if (INT_ADD_OK (a, b, &result)) + printf ("result is %ld\n", result); + else + printf ("overflow\n"); + + A, B, and *R should be integers; they need not be the same type, + and they need not be all signed or all unsigned. + + These macros work correctly on all known practical hosts, and do not rely + on undefined behavior due to signed arithmetic overflow. + + These macros are not constant expressions. + + These macros may evaluate their arguments zero or multiple times, so the + arguments should not have side effects. + + These macros are tuned for B being a constant. */ + +#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r) +#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r) +#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r) + #endif /* _GL_INTPROPS_H */ diff --git a/gnulib/import/inttypes.in.h b/gnulib/import/inttypes.in.h index 9f04a6c..e9ee500 100644 --- a/gnulib/import/inttypes.in.h +++ b/gnulib/import/inttypes.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2020 Free Software Foundation, Inc. +/* Copyright (C) 2006-2021 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. @@ -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/gnulib/import/isblank.c b/gnulib/import/isblank.c index 4899404..44a9a20 100644 --- a/gnulib/import/isblank.c +++ b/gnulib/import/isblank.c @@ -1,6 +1,6 @@ /* Test whether a character is a blank. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/isnan.c b/gnulib/import/isnan.c index 814456d..434e5df 100644 --- a/gnulib/import/isnan.c +++ b/gnulib/import/isnan.c @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/isnand-nolibm.h b/gnulib/import/isnand-nolibm.h index cbabed4..c299130 100644 --- a/gnulib/import/isnand-nolibm.h +++ b/gnulib/import/isnand-nolibm.h @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,8 +17,8 @@ #if HAVE_ISNAND_IN_LIBC /* Get declaration of isnan macro. */ # include <math.h> -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */ # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) # else diff --git a/gnulib/import/isnand.c b/gnulib/import/isnand.c index a672553..3c7e8e8 100644 --- a/gnulib/import/isnand.c +++ b/gnulib/import/isnand.c @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/isnanl-nolibm.h b/gnulib/import/isnanl-nolibm.h index 103d31a..f9f5efd 100644 --- a/gnulib/import/isnanl-nolibm.h +++ b/gnulib/import/isnanl-nolibm.h @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,13 +17,11 @@ #if HAVE_ISNANL_IN_LIBC /* Get declaration of isnan macro or (older) isnanl function. */ # include <math.h> -# ifndef __has_builtin -# define __has_builtin(name) 0 -# endif -# if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl)) - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */ # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) # elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) diff --git a/gnulib/import/isnanl.c b/gnulib/import/isnanl.c index 4532853..5dc9cb7 100644 --- a/gnulib/import/isnanl.c +++ b/gnulib/import/isnanl.c @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/itold.c b/gnulib/import/itold.c index d764003..9a6682d 100644 --- a/gnulib/import/itold.c +++ b/gnulib/import/itold.c @@ -1,5 +1,5 @@ /* Replacement for 'int' to 'long double' conversion routine. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/lc-charset-dispatch.c b/gnulib/import/lc-charset-dispatch.c index 79057d4..879f71a 100644 --- a/gnulib/import/lc-charset-dispatch.c +++ b/gnulib/import/lc-charset-dispatch.c @@ -1,5 +1,5 @@ /* Dispatching based on the current locale's character encoding. - Copyright (C) 2018-2020 Free Software Foundation, Inc. + Copyright (C) 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/lc-charset-dispatch.h b/gnulib/import/lc-charset-dispatch.h index 95c2316..9c308fe 100644 --- a/gnulib/import/lc-charset-dispatch.h +++ b/gnulib/import/lc-charset-dispatch.h @@ -1,5 +1,5 @@ /* Dispatching based on the current locale's character encoding. - Copyright (C) 2018-2020 Free Software Foundation, Inc. + Copyright (C) 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/libc-config.h b/gnulib/import/libc-config.h index 1300c3a..e3571ee 100644 --- a/gnulib/import/libc-config.h +++ b/gnulib/import/libc-config.h @@ -1,6 +1,6 @@ /* System definitions for code taken from the GNU C Library - Copyright 2017-2020 Free Software Foundation, Inc. + Copyright 2017-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public @@ -71,107 +71,114 @@ # endif #endif - -/* Prepare to include <cdefs.h>, which is our copy of glibc - <sys/cdefs.h>. */ +#ifndef __glibc_likely +/* <sys/cdefs.h> either does not exist, or predates glibc commit + 2012-12-28T06:33:01Z!siddhesh@redhat.com + (91998e449e0ce758db55aecf2abc3ee510fcbc8f) + and so does not suffice for Gnulib. Prepare to include <cdefs.h>, + which is Gnulib's copy of a more-recent glibc <sys/cdefs.h>. */ /* Define _FEATURES_H so that <cdefs.h> does not include <features.h>. */ -#ifndef _FEATURES_H -# define _FEATURES_H 1 -#endif +# ifndef _FEATURES_H +# define _FEATURES_H 1 +# endif /* Define __WORDSIZE so that <cdefs.h> does not attempt to include nonexistent files. Make it a syntax error, since Gnulib does not use __WORDSIZE now, and if Gnulib uses it later the syntax error will let us know that __WORDSIZE needs configuring. */ -#ifndef __WORDSIZE -# define __WORDSIZE %%% -#endif +# ifndef __WORDSIZE +# define __WORDSIZE %%% +# endif /* Undef the macros unconditionally defined by our copy of glibc <sys/cdefs.h>, so that they do not clash with any system-defined versions. */ -#undef _SYS_CDEFS_H -#undef __ASMNAME -#undef __ASMNAME2 -#undef __BEGIN_DECLS -#undef __CONCAT -#undef __END_DECLS -#undef __HAVE_GENERIC_SELECTION -#undef __LDBL_COMPAT -#undef __LDBL_REDIR -#undef __LDBL_REDIR1 -#undef __LDBL_REDIR1_DECL -#undef __LDBL_REDIR1_NTH -#undef __LDBL_REDIR_DECL -#undef __LDBL_REDIR_NTH -#undef __LEAF -#undef __LEAF_ATTR -#undef __NTH -#undef __NTHNL -#undef __P -#undef __PMT -#undef __REDIRECT -#undef __REDIRECT_LDBL -#undef __REDIRECT_NTH -#undef __REDIRECT_NTHNL -#undef __REDIRECT_NTH_LDBL -#undef __STRING -#undef __THROW -#undef __THROWNL -#undef __always_inline -#undef __attribute__ -#undef __attribute_alloc_size__ -#undef __attribute_artificial__ -#undef __attribute_const__ -#undef __attribute_deprecated__ -#undef __attribute_deprecated_msg__ -#undef __attribute_format_arg__ -#undef __attribute_format_strfmon__ -#undef __attribute_malloc__ -#undef __attribute_noinline__ -#undef __attribute_nonstring__ -#undef __attribute_pure__ -#undef __attribute_used__ -#undef __attribute_warn_unused_result__ -#undef __bos -#undef __bos0 -#undef __errordecl -#undef __extension__ -#undef __extern_always_inline -#undef __extern_inline -#undef __flexarr -#undef __fortify_function -#undef __glibc_c99_flexarr_available -#undef __glibc_clang_has_extension -#undef __glibc_likely -#undef __glibc_macro_warning -#undef __glibc_macro_warning1 -#undef __glibc_unlikely -#undef __inline -#undef __ptr_t -#undef __restrict -#undef __restrict_arr -#undef __va_arg_pack -#undef __va_arg_pack_len -#undef __warnattr -#undef __warndecl +# undef _SYS_CDEFS_H +# undef __ASMNAME +# undef __ASMNAME2 +# undef __BEGIN_DECLS +# undef __CONCAT +# undef __END_DECLS +# undef __HAVE_GENERIC_SELECTION +# undef __LDBL_COMPAT +# undef __LDBL_REDIR +# undef __LDBL_REDIR1 +# undef __LDBL_REDIR1_DECL +# undef __LDBL_REDIR1_NTH +# undef __LDBL_REDIR2_DECL +# undef __LDBL_REDIR_DECL +# undef __LDBL_REDIR_NTH +# undef __LEAF +# undef __LEAF_ATTR +# undef __NTH +# undef __NTHNL +# undef __REDIRECT +# undef __REDIRECT_LDBL +# undef __REDIRECT_NTH +# undef __REDIRECT_NTHNL +# undef __REDIRECT_NTH_LDBL +# undef __STRING +# undef __THROW +# undef __THROWNL +# undef __attr_access +# undef __attribute__ +# undef __attribute_alloc_size__ +# undef __attribute_artificial__ +# undef __attribute_const__ +# undef __attribute_deprecated__ +# undef __attribute_deprecated_msg__ +# undef __attribute_format_arg__ +# undef __attribute_format_strfmon__ +# undef __attribute_malloc__ +# undef __attribute_noinline__ +# undef __attribute_nonstring__ +# undef __attribute_pure__ +# undef __attribute_returns_twice__ +# undef __attribute_used__ +# undef __attribute_warn_unused_result__ +# undef __bos +# undef __bos0 +# undef __errordecl +# undef __extension__ +# undef __extern_always_inline +# undef __extern_inline +# undef __flexarr +# undef __fortify_function +# undef __glibc_c99_flexarr_available +# undef __glibc_clang_has_attribute +# undef __glibc_clang_has_builtin +# undef __glibc_clang_has_extension +# undef __glibc_macro_warning +# undef __glibc_macro_warning1 +# undef __glibc_objsize +# undef __glibc_objsize0 +# undef __glibc_unlikely +# undef __inline +# undef __ptr_t +# undef __restrict +# undef __restrict_arr +# undef __va_arg_pack +# undef __va_arg_pack_len +# undef __warnattr /* Include our copy of glibc <sys/cdefs.h>. */ -#include <cdefs.h> +# include <cdefs.h> /* <cdefs.h> __inline is too pessimistic for non-GCC. */ -#undef __inline -#ifndef HAVE___INLINE -# if 199901 <= __STDC_VERSION__ || defined inline -# define __inline inline -# else -# define __inline +# undef __inline +# ifndef HAVE___INLINE +# if 199901 <= __STDC_VERSION__ || defined inline +# define __inline inline +# else +# define __inline +# endif # endif -#endif + +#endif /* defined __glibc_likely */ /* A substitute for glibc <libc-symbols.h>, good enough for Gnulib. */ #define attribute_hidden -#define libc_hidden_proto(name, ...) +#define libc_hidden_proto(name) #define libc_hidden_def(name) #define libc_hidden_weak(name) #define libc_hidden_ver(local, name) diff --git a/gnulib/import/limits.in.h b/gnulib/import/limits.in.h index d25c523..076ab9e 100644 --- a/gnulib/import/limits.in.h +++ b/gnulib/import/limits.in.h @@ -1,6 +1,6 @@ /* A GNU-like <limits.h>. - Copyright 2016-2020 Free Software Foundation, Inc. + Copyright 2016-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/gnulib/import/localcharset.c b/gnulib/import/localcharset.c index 721c8a9..cba0e2b 100644 --- a/gnulib/import/localcharset.c +++ b/gnulib/import/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/localcharset.h b/gnulib/import/localcharset.h index aa623be..6e66494 100644 --- a/gnulib/import/localcharset.h +++ b/gnulib/import/localcharset.h @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2021 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/locale.in.h b/gnulib/import/locale.in.h index 4e9b3f3..df84747 100644 --- a/gnulib/import/locale.in.h +++ b/gnulib/import/locale.in.h @@ -1,5 +1,5 @@ /* A POSIX <locale.h>. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/localtime-buffer.c b/gnulib/import/localtime-buffer.c deleted file mode 100644 index 141849c..0000000 --- a/gnulib/import/localtime-buffer.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Provide access to the last buffer returned by localtime() or gmtime(). - - Copyright (C) 2001-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <https://www.gnu.org/licenses/>. */ - -/* written by Jim Meyering */ - -#include <config.h> - -/* Specification. */ -#include "localtime-buffer.h" - -#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME - -static struct tm tm_zero_buffer; -struct tm *localtime_buffer_addr = &tm_zero_buffer; - -/* This is a wrapper for localtime. - - On the first call, record the address of the static buffer that - localtime uses for its result. */ - -struct tm * -rpl_localtime (time_t const *timep) -#undef localtime -{ - struct tm *tm = localtime (timep); - - if (localtime_buffer_addr == &tm_zero_buffer) - localtime_buffer_addr = tm; - - return tm; -} - -/* Same as above, since gmtime and localtime use the same buffer. */ -struct tm * -rpl_gmtime (time_t const *timep) -#undef gmtime -{ - struct tm *tm = gmtime (timep); - - if (localtime_buffer_addr == &tm_zero_buffer) - localtime_buffer_addr = tm; - - return tm; -} - -#endif diff --git a/gnulib/import/localtime-buffer.h b/gnulib/import/localtime-buffer.h deleted file mode 100644 index 3801742..0000000 --- a/gnulib/import/localtime-buffer.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Provide access to the last buffer returned by localtime() or gmtime(). - - Copyright (C) 2001-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <https://www.gnu.org/licenses/>. */ - -/* written by Jim Meyering */ - -#include <time.h> - -#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME - -/* The address of the last buffer returned by localtime() or gmtime(). */ -extern struct tm *localtime_buffer_addr; - -#endif diff --git a/gnulib/import/lstat.c b/gnulib/import/lstat.c index f74392b..a584c6a 100644 --- a/gnulib/import/lstat.c +++ b/gnulib/import/lstat.c @@ -1,6 +1,6 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 1997-2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/m4/00gnulib.m4 b/gnulib/import/m4/00gnulib.m4 index 06eff4f..9ba1743 100644 --- a/gnulib/import/m4/00gnulib.m4 +++ b/gnulib/import/m4/00gnulib.m4 @@ -1,44 +1,12 @@ -# 00gnulib.m4 serial 7 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +# 00gnulib.m4 serial 8 +dnl Copyright (C) 2009-2021 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 This file must be named something that sorts before all other -dnl gnulib-provided .m4 files. The first part is needed until such time -dnl as we can assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and -dnl m4_divert semantics. The second part is needed until the clang fix -dnl has been included in Autoconf. - -# Until autoconf 2.63, handling of the diversion stack required m4_init -# to be called first; but this does not happen with aclocal. Wrapping -# the entire execution in another layer of the diversion stack fixes this. -# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4 -# for whether it was FIFO or LIFO; in order to properly balance with -# m4_init, we need to undo our push just before anything wrapped within -# the m4_init body. The way to ensure this is to wrap both sides of -# m4_init with a one-shot macro that does the pop at the right time. -m4_ifndef([_m4_divert_diversion], -[m4_divert_push([KILL]) -m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])]) -m4_define([m4_init], - [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])]) - - -# AC_DEFUN_ONCE([NAME], VALUE) -# ---------------------------- -# Define NAME to expand to VALUE on the first use (whether by direct -# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. -# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This -# definition is slower than the version in Autoconf 2.64, because it -# can only use interfaces that existed since 2.59; but it achieves the -# same effect. Quoting is necessary to avoid confusing Automake. -m4_version_prereq([2.63.263], [], -[m4_define([AC][_DEFUN_ONCE], - [AC][_DEFUN([$1], - [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], - [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl -[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) +dnl gnulib-provided .m4 files. It is needed until the clang fix has +dnl been included in Autoconf. # The following definitions arrange to use a compiler option # -Werror=implicit-function-declaration in AC_CHECK_DECL, when the diff --git a/gnulib/import/m4/__inline.m4 b/gnulib/import/m4/__inline.m4 index 520c8c4..b28cc6a 100644 --- a/gnulib/import/m4/__inline.m4 +++ b/gnulib/import/m4/__inline.m4 @@ -1,5 +1,5 @@ # Test for __inline keyword -dnl Copyright 2017-2020 Free Software Foundation, Inc. +dnl Copyright 2017-2021 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. diff --git a/gnulib/import/m4/absolute-header.m4 b/gnulib/import/m4/absolute-header.m4 index 39726ba..52d80d0 100644 --- a/gnulib/import/m4/absolute-header.m4 +++ b/gnulib/import/m4/absolute-header.m4 @@ -1,5 +1,5 @@ -# absolute-header.m4 serial 16 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# absolute-header.m4 serial 17 +dnl Copyright (C) 2006-2021 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. @@ -22,23 +22,21 @@ dnl From Derek Price. AC_DEFUN([gl_ABSOLUTE_HEADER], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PREPROC_REQUIRE()dnl -dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted -dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_absolute_header], [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], - m4_defn([gl_absolute_header]), + [gl_absolute_header], [AS_VAR_PUSHDEF([ac_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl - if test AS_VAR_GET(ac_header_exists) = yes; then + if test AS_VAR_GET([ac_header_exists]) = yes; then gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) fi AS_VAR_POPDEF([ac_header_exists])dnl ])dnl AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), - ["AS_VAR_GET(gl_absolute_header)"], + ["AS_VAR_GET([gl_absolute_header])"], [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) AS_VAR_POPDEF([gl_absolute_header])dnl ])dnl diff --git a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4 index 5922524..ba2f679 100644 --- a/gnulib/import/m4/alloca.m4 +++ b/gnulib/import/m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 15 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, +# alloca.m4 serial 20 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -50,13 +50,13 @@ AC_DEFUN([gl_FUNC_ALLOCA], # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) -# This works around a bug in autoconf <= 2.68. -# See <https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html>. +m4_version_prereq([2.70], [], [ -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 +# This works around a bug in autoconf <= 2.68 and has simplifications +# from 2.70. See: +# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a # _AC_LIBOBJ_ALLOCA # ----------------- @@ -72,26 +72,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( @@ -122,7 +102,7 @@ AH_VERBATIM([STACK_DIRECTION], STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ -@%:@undef STACK_DIRECTION])dnl +#undef STACK_DIRECTION])dnl AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) ])# _AC_LIBOBJ_ALLOCA ]) diff --git a/gnulib/import/m4/arpa_inet_h.m4 b/gnulib/import/m4/arpa_inet_h.m4 index b394494..c4e386d 100644 --- a/gnulib/import/m4/arpa_inet_h.m4 +++ b/gnulib/import/m4/arpa_inet_h.m4 @@ -1,5 +1,5 @@ # arpa_inet_h.m4 serial 14 -dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2021 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. diff --git a/gnulib/import/m4/btowc.m4 b/gnulib/import/m4/btowc.m4 index c28ccb2..d2b2fe8 100644 --- a/gnulib/import/m4/btowc.m4 +++ b/gnulib/import/m4/btowc.m4 @@ -1,5 +1,5 @@ -# btowc.m4 serial 11 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# btowc.m4 serial 12 +dnl Copyright (C) 2008-2021 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. @@ -28,14 +28,6 @@ AC_DEFUN([gl_FUNC_BTOWC], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ -#include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -79,14 +71,7 @@ changequote([,])dnl AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include <locale.h> -#include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> #include <stdio.h> -#include <time.h> #include <wchar.h> int main () { diff --git a/gnulib/import/m4/builtin-expect.m4 b/gnulib/import/m4/builtin-expect.m4 index a6e8895..c584116 100644 --- a/gnulib/import/m4/builtin-expect.m4 +++ b/gnulib/import/m4/builtin-expect.m4 @@ -1,6 +1,6 @@ dnl Check for __builtin_expect. -dnl Copyright 2016-2020 Free Software Foundation, Inc. +dnl Copyright 2016-2021 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. diff --git a/gnulib/import/m4/canonicalize.m4 b/gnulib/import/m4/canonicalize.m4 index bdc5c8f..475fa15 100644 --- a/gnulib/import/m4/canonicalize.m4 +++ b/gnulib/import/m4/canonicalize.m4 @@ -1,6 +1,6 @@ -# canonicalize.m4 serial 31 +# canonicalize.m4 serial 35 -dnl Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,7 +11,8 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([canonicalize_file_name]) + AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat]) AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) AC_REQUIRE([gl_FUNC_REALPATH_WORKS]) if test $ac_cv_func_canonicalize_file_name = no; then @@ -56,7 +57,17 @@ AC_DEFUN([gl_CANONICALIZE_LGPL], AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([canonicalize_file_name getcwd readlink]) + AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat]) + + dnl On native Windows, we use _getcwd(), regardless whether getcwd() is + dnl available through the linker option '-loldnames'. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) ;; + *) AC_CHECK_FUNCS([getcwd]) ;; + esac + AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) AC_REQUIRE([gl_FUNC_REALPATH_WORKS]) AC_CHECK_HEADERS_ONCE([sys/param.h]) @@ -70,6 +81,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS], AC_CHECK_FUNCS_ONCE([realpath]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [ + rm -rf conftest.a conftest.d touch conftest.a mkdir conftest.d AC_RUN_IFELSE([ diff --git a/gnulib/import/m4/chdir-long.m4 b/gnulib/import/m4/chdir-long.m4 index a528a5d..e5cd8df 100644 --- a/gnulib/import/m4/chdir-long.m4 +++ b/gnulib/import/m4/chdir-long.m4 @@ -1,4 +1,4 @@ -#serial 16 +#serial 17 # Use Gnulib's robust chdir function. # It can handle arbitrarily long directory names, which means @@ -6,7 +6,7 @@ # never fails with ENAMETOOLONG. # Arrange to compile chdir-long.c only on systems that define PATH_MAX. -dnl Copyright (C) 2004-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2007, 2009-2021 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. @@ -16,15 +16,15 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_CHDIR_LONG], [ AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ]) - AC_CACHE_CHECK([whether this system has an arbitrary file name length limit], - [gl_cv_have_arbitrary_file_name_length_limit], + AC_CACHE_CHECK([whether this system supports file names of any length], + [gl_cv_have_unlimited_file_name_length], [AC_EGREP_CPP([have_arbitrary_file_name_length_limit], gl_PATHMAX_SNIPPET[ #ifdef PATH_MAX have_arbitrary_file_name_length_limit #endif], - [gl_cv_have_arbitrary_file_name_length_limit=yes], - [gl_cv_have_arbitrary_file_name_length_limit=no])]) + [gl_cv_have_unlimited_file_name_length=no], + [gl_cv_have_unlimited_file_name_length=yes])]) ]) AC_DEFUN([gl_PREREQ_CHDIR_LONG], [:]) diff --git a/gnulib/import/m4/clock_time.m4 b/gnulib/import/m4/clock_time.m4 new file mode 100644 index 0000000..c3b9e7e --- /dev/null +++ b/gnulib/import/m4/clock_time.m4 @@ -0,0 +1,31 @@ +# clock_time.m4 serial 10 +dnl Copyright (C) 2002-2006, 2009-2021 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. + +# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME. +# For a program named, say foo, you should add a line like the following +# in the corresponding Makefile.am file: +# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) + +AC_DEFUN([gl_CLOCK_TIME], +[ + dnl Persuade glibc and Solaris <time.h> to declare these functions. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + LIB_CLOCK_GETTIME= + AC_SUBST([LIB_CLOCK_GETTIME]) + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([clock_gettime], [rt posix4], + [test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + AC_CHECK_FUNCS([clock_gettime clock_settime]) + LIBS=$gl_saved_libs +]) diff --git a/gnulib/import/m4/close.m4 b/gnulib/import/m4/close.m4 index 378ec4c..77a5047 100644 --- a/gnulib/import/m4/close.m4 +++ b/gnulib/import/m4/close.m4 @@ -1,5 +1,5 @@ # close.m4 serial 9 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2021 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. diff --git a/gnulib/import/m4/closedir.m4 b/gnulib/import/m4/closedir.m4 index 66f6d4e..fc55a21 100644 --- a/gnulib/import/m4/closedir.m4 +++ b/gnulib/import/m4/closedir.m4 @@ -1,5 +1,5 @@ # closedir.m4 serial 6 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/codeset.m4 b/gnulib/import/m4/codeset.m4 index 9b019cf..629f4ee 100644 --- a/gnulib/import/m4/codeset.m4 +++ b/gnulib/import/m4/codeset.m4 @@ -1,5 +1,5 @@ # codeset.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2020 Free Software +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2021 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/ctype.m4 b/gnulib/import/m4/ctype.m4 index 0b123d5..06efe61 100644 --- a/gnulib/import/m4/ctype.m4 +++ b/gnulib/import/m4/ctype.m4 @@ -1,5 +1,5 @@ # ctype_h.m4 serial 6 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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. diff --git a/gnulib/import/m4/d-ino.m4 b/gnulib/import/m4/d-ino.m4 index 64ce9ce..e4dcfeb 100644 --- a/gnulib/import/m4/d-ino.m4 +++ b/gnulib/import/m4/d-ino.m4 @@ -5,7 +5,7 @@ dnl dnl Check whether struct dirent has a member named d_ino. dnl -# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2020 Free Software +# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2021 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation diff --git a/gnulib/import/m4/d-type.m4 b/gnulib/import/m4/d-type.m4 index d40220a..534a59e 100644 --- a/gnulib/import/m4/d-type.m4 +++ b/gnulib/import/m4/d-type.m4 @@ -5,7 +5,7 @@ dnl dnl Check whether struct dirent has a member named d_type. dnl -# Copyright (C) 1997, 1999-2004, 2006, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999-2004, 2006, 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/dirent_h.m4 b/gnulib/import/m4/dirent_h.m4 index 8bef6a0..6d86142 100644 --- a/gnulib/import/m4/dirent_h.m4 +++ b/gnulib/import/m4/dirent_h.m4 @@ -1,5 +1,5 @@ # dirent_h.m4 serial 16 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2021 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. diff --git a/gnulib/import/m4/dirfd.m4 b/gnulib/import/m4/dirfd.m4 index d92445e..3c9ce5d 100644 --- a/gnulib/import/m4/dirfd.m4 +++ b/gnulib/import/m4/dirfd.m4 @@ -2,7 +2,7 @@ dnl Find out how to get the file descriptor associated with an open DIR*. -# Copyright (C) 2001-2006, 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2006, 2008-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/dirname.m4 b/gnulib/import/m4/dirname.m4 deleted file mode 100644 index 9995ff3..0000000 --- a/gnulib/import/m4/dirname.m4 +++ /dev/null @@ -1,19 +0,0 @@ -#serial 10 -*- autoconf -*- -dnl Copyright (C) 2002-2006, 2009-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. - -AC_DEFUN([gl_DIRNAME], -[ - AC_REQUIRE([gl_DIRNAME_LGPL]) -]) - -AC_DEFUN([gl_DIRNAME_LGPL], -[ - dnl Prerequisites of lib/dirname.h. - AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) - - dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c, - dnl lib/stripslash.c. -]) diff --git a/gnulib/import/m4/double-slash-root.m4 b/gnulib/import/m4/double-slash-root.m4 index c463ac4..c9bbcef 100644 --- a/gnulib/import/m4/double-slash-root.m4 +++ b/gnulib/import/m4/double-slash-root.m4 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2021 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. diff --git a/gnulib/import/m4/dup.m4 b/gnulib/import/m4/dup.m4 index 1bf0234..433a466 100644 --- a/gnulib/import/m4/dup.m4 +++ b/gnulib/import/m4/dup.m4 @@ -1,5 +1,5 @@ -# dup.m4 serial 6 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# dup.m4 serial 7 +dnl Copyright (C) 2011-2021 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. @@ -26,7 +26,8 @@ AC_DEFUN([gl_FUNC_DUP], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include <unistd.h> #include <fcntl.h> - #include <errno.h>]], + #include <errno.h> + ]GL_MDA_DEFINES], [[/* On OS/2 kLIBC, dup does not work on a directory fd. */ int fd = open (".", O_RDONLY); return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0; diff --git a/gnulib/import/m4/dup2.m4 b/gnulib/import/m4/dup2.m4 index 21b1ecc..0753a32 100644 --- a/gnulib/import/m4/dup2.m4 +++ b/gnulib/import/m4/dup2.m4 @@ -1,5 +1,5 @@ -#serial 25 -dnl Copyright (C) 2002, 2005, 2007, 2009-2020 Free Software Foundation, Inc. +#serial 27 +dnl Copyright (C) 2002, 2005, 2007, 2009-2021 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. @@ -8,107 +8,95 @@ AC_DEFUN([gl_FUNC_DUP2], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) - m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ - AC_CHECK_FUNCS_ONCE([dup2]) - if test $ac_cv_func_dup2 = no; then - HAVE_DUP2=0 - fi - ], [ - AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.]) - ]) - if test $HAVE_DUP2 = 1; then - AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], - [AC_RUN_IFELSE([ - AC_LANG_PROGRAM( - [[#include <errno.h> - #include <fcntl.h> - #include <limits.h> - #include <sys/resource.h> - #include <unistd.h> - #ifndef RLIM_SAVED_CUR - # define RLIM_SAVED_CUR RLIM_INFINITY - #endif - #ifndef RLIM_SAVED_MAX - # define RLIM_SAVED_MAX RLIM_INFINITY - #endif - ]], - [[int result = 0; - int bad_fd = INT_MAX; - struct rlimit rlim; - if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 - && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX - && rlim.rlim_cur != RLIM_INFINITY - && rlim.rlim_cur != RLIM_SAVED_MAX - && rlim.rlim_cur != RLIM_SAVED_CUR) - bad_fd = rlim.rlim_cur; - #ifdef FD_CLOEXEC - if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) - result |= 1; - #endif - if (dup2 (1, 1) != 1) - result |= 2; - #ifdef FD_CLOEXEC - if (fcntl (1, F_GETFD) != FD_CLOEXEC) - result |= 4; - #endif - close (0); - if (dup2 (0, 0) != -1) - result |= 8; - /* Many gnulib modules require POSIX conformance of EBADF. */ - if (dup2 (2, bad_fd) == -1 && errno != EBADF) - result |= 16; - /* Flush out some cygwin core dumps. */ - if (dup2 (2, -1) != -1 || errno != EBADF) - result |= 32; - dup2 (2, 255); - dup2 (2, 256); - /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ - { - int fd = open (".", O_RDONLY); - if (fd == -1) - result |= 64; - else if (dup2 (fd, fd + 1) == -1) - result |= 128; - - close (fd); - } - return result;]]) - ], - [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], - [case "$host_os" in - mingw*) # on this platform, dup2 always returns 0 for success - gl_cv_func_dup2_works="guessing no" ;; - cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 - gl_cv_func_dup2_works="guessing no" ;; - aix* | freebsd*) - # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, - # not EBADF. - gl_cv_func_dup2_works="guessing no" ;; - haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. - gl_cv_func_dup2_works="guessing no" ;; - *-android*) # implemented using dup3(), which fails if oldfd == newfd - gl_cv_func_dup2_works="guessing no" ;; - os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. - gl_cv_func_dup2_works="guessing no" ;; - *) gl_cv_func_dup2_works="guessing yes" ;; - esac]) - ]) - case "$gl_cv_func_dup2_works" in - *yes) ;; - *) - REPLACE_DUP2=1 - AC_CHECK_FUNCS([setdtablesize]) - ;; - esac - fi + AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [[#include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + ]GL_MDA_DEFINES[ + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + close (fd); + } + return result;]]) + ], + [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], + [case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac]) + ]) + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + AC_CHECK_FUNCS([setdtablesize]) + ;; + esac dnl Replace dup2() for supporting the gnulib-defined fchdir() function, dnl to keep fchdir's bookkeeping up-to-date. m4_ifdef([gl_FUNC_FCHDIR], [ gl_TEST_FCHDIR if test $HAVE_FCHDIR = 0; then - if test $HAVE_DUP2 = 1; then - REPLACE_DUP2=1 - fi + REPLACE_DUP2=1 fi ]) ]) diff --git a/gnulib/import/m4/eealloc.m4 b/gnulib/import/m4/eealloc.m4 index 236f373..002f0c8 100644 --- a/gnulib/import/m4/eealloc.m4 +++ b/gnulib/import/m4/eealloc.m4 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2021 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. diff --git a/gnulib/import/m4/environ.m4 b/gnulib/import/m4/environ.m4 index bab85f1..d971770 100644 --- a/gnulib/import/m4/environ.m4 +++ b/gnulib/import/m4/environ.m4 @@ -1,5 +1,5 @@ # environ.m4 serial 7 -dnl Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2021 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. diff --git a/gnulib/import/m4/errno_h.m4 b/gnulib/import/m4/errno_h.m4 index dd4994f..51dfe92 100644 --- a/gnulib/import/m4/errno_h.m4 +++ b/gnulib/import/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 serial 13 -dnl Copyright (C) 2004, 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2021 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. diff --git a/gnulib/import/m4/error.m4 b/gnulib/import/m4/error.m4 index 60c229d..77f67f7 100644 --- a/gnulib/import/m4/error.m4 +++ b/gnulib/import/m4/error.m4 @@ -1,6 +1,6 @@ #serial 14 -# Copyright (C) 1996-1998, 2001-2004, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/exponentd.m4 b/gnulib/import/m4/exponentd.m4 index cca8797..fb136f4 100644 --- a/gnulib/import/m4/exponentd.m4 +++ b/gnulib/import/m4/exponentd.m4 @@ -1,5 +1,5 @@ # exponentd.m4 serial 3 -dnl Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2021 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. diff --git a/gnulib/import/m4/exponentl.m4 b/gnulib/import/m4/exponentl.m4 index 0a35c11..508fe93 100644 --- a/gnulib/import/m4/exponentl.m4 +++ b/gnulib/import/m4/exponentl.m4 @@ -1,5 +1,5 @@ # exponentl.m4 serial 5 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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. diff --git a/gnulib/import/m4/extensions.m4 b/gnulib/import/m4/extensions.m4 index d7c95ef..5792a95 100644 --- a/gnulib/import/m4/extensions.m4 +++ b/gnulib/import/m4/extensions.m4 @@ -1,14 +1,19 @@ -# serial 18 -*- Autoconf -*- +# serial 22 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that +dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+. +m4_ifndef([AC_CHECK_INCLUDES_DEFAULT], + [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])]) + # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git # Autoconf. Perhaps we can remove this once we can assume Autoconf -# 2.70 or later everywhere, but since Autoconf mutates rapidly +# is recent-enough everywhere, but since Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. @@ -26,36 +31,27 @@ # its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS # invocation occurs in gl_EARLY, not in gl_INIT. +m4_version_prereq([2.70.1], [], [ + # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. -# -# Remember that #undef in AH_VERBATIM gets replaced with #define by -# AC_DEFINE. The goal here is to define all known feature-enabling -# macros, then, if reports of conflicts are made, disable macros that -# cause problems on some platforms (such as __EXTENSIONS__). +# We unconditionally define as many of the known feature-enabling +# as possible, reserving conditional behavior for macros that are +# known to cause problems on some platforms (such as __EXTENSIONS__). AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], -[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl +AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +AC_BEFORE([$0], [AC_LINK_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl - - AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) - if test "$MINIX" = yes; then - AC_DEFINE([_POSIX_SOURCE], [1], - [Define to 1 if you need to in order for 'stat' and other - things to work.]) - AC_DEFINE([_POSIX_1_SOURCE], [2], - [Define to 2 if the system does not provide POSIX.1 features - except with this defined.]) - AC_DEFINE([_MINIX], [1], - [Define to 1 if on MINIX.]) - AC_DEFINE([_NETBSD_SOURCE], [1], - [Define to 1 to make NetBSD features available. MINIX 3 needs this.]) - fi - +AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl +dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE. dnl Use a different key than __EXTENSIONS__, as that name broke existing dnl configure.ac when using autoheader 2.62. - AH_VERBATIM([USE_SYSTEM_EXTENSIONS], +dnl The macros below are in alphabetical order ignoring leading _ or __ +dnl prefixes. +AH_VERBATIM([USE_SYSTEM_EXTENSIONS], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -64,19 +60,44 @@ dnl configure.ac when using autoheader 2.62. #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif -/* Enable NetBSD extensions on NetBSD. */ +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif -/* Enable OpenBSD extensions on NetBSD. */ +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif -/* Enable threading extensions on Solaris. */ +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif @@ -112,22 +133,19 @@ dnl configure.ac when using autoheader 2.62. #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif -/* Enable X/Open extensions if necessary. HP-UX 11.11 defines - mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of - whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif -/* Enable X/Open compliant socket functions that do not require linking - with -lxnet on HP-UX 11.11. */ -#ifndef _HPUX_ALT_XOPEN_SOCKET_API -# undef _HPUX_ALT_XOPEN_SOCKET_API -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -]) +])dnl + + AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl + _AC_CHECK_HEADER_ONCE([wchar.h]) + _AC_CHECK_HEADER_ONCE([minix/config.h]) + +dnl Defining __EXTENSIONS__ may break the system headers on some systems. +dnl (FIXME: Which ones?) AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( @@ -136,11 +154,33 @@ dnl configure.ac when using autoheader 2.62. ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) - test $ac_cv_safe_to_define___extensions__ = yes && - AC_DEFINE([__EXTENSIONS__]) + +dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to +dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. +dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms +dnl not covered by turn-on-extensions macros (notably Dragonfly, Free, +dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so +dnl it should only be defined when necessary. + AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], + [ac_cv_should_define__xopen_source], + [ac_cv_should_define__xopen_source=no + AS_IF([test $ac_cv_header_wchar_h = yes], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include <wchar.h> + mbstate_t x;]])], + [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x;]])], + [ac_cv_should_define__xopen_source=yes])])])]) + AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) + AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) AC_DEFINE([_NETBSD_SOURCE]) AC_DEFINE([_OPENBSD_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) @@ -152,24 +192,18 @@ dnl configure.ac when using autoheader 2.62. AC_DEFINE([__STDC_WANT_LIB_EXT2__]) AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) AC_DEFINE([_TANDEM_SOURCE]) - AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], - [ac_cv_should_define__xopen_source], - [ac_cv_should_define__xopen_source=no - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ - #include <wchar.h> - mbstate_t x;]])], - [], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ - #define _XOPEN_SOURCE 500 - #include <wchar.h> - mbstate_t x;]])], - [ac_cv_should_define__xopen_source=yes])])]) - test $ac_cv_should_define__xopen_source = yes && - AC_DEFINE([_XOPEN_SOURCE], [500]) - AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) + AS_IF([test $ac_cv_header_minix_config_h = yes], + [MINIX=yes + AC_DEFINE([_MINIX]) + AC_DEFINE([_POSIX_SOURCE]) + AC_DEFINE([_POSIX_1_SOURCE], [2])], + [MINIX=]) + AS_IF([test $ac_cv_safe_to_define___extensions__ = yes], + [AC_DEFINE([__EXTENSIONS__])]) + AS_IF([test $ac_cv_should_define__xopen_source = yes], + [AC_DEFINE([_XOPEN_SOURCE], [500])]) ])# AC_USE_SYSTEM_EXTENSIONS +]) # gl_USE_SYSTEM_EXTENSIONS # ------------------------ @@ -177,13 +211,17 @@ dnl configure.ac when using autoheader 2.62. # typically due to standards-conformance issues. AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], [ - dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. - dnl gnulib does not need it. But if it gets required by third-party macros - dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a - dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". - dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, - dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. - AC_REQUIRE([AC_GNU_SOURCE]) - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl On OpenBSD 6.8 with GCC, the include files contain a couple of + dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE. + dnl That's because this version of GCC (4.2.1) supports the option + dnl '-std=gnu99' but not the option '-std=gnu11'. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + openbsd*) + AC_DEFINE([_ISOC11_SOURCE], [1], + [Define to enable the declarations of ISO C 11 types and functions.]) + ;; + esac ]) diff --git a/gnulib/import/m4/extern-inline.m4 b/gnulib/import/m4/extern-inline.m4 index 75c5008..a2acf12 100644 --- a/gnulib/import/m4/extern-inline.m4 +++ b/gnulib/import/m4/extern-inline.m4 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2020 Free Software Foundation, Inc. +dnl Copyright 2012-2021 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. diff --git a/gnulib/import/m4/fchdir.m4 b/gnulib/import/m4/fchdir.m4 index dc2ba25..5d2fab7 100644 --- a/gnulib/import/m4/fchdir.m4 +++ b/gnulib/import/m4/fchdir.m4 @@ -1,5 +1,5 @@ -# fchdir.m4 serial 25 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# fchdir.m4 serial 26 +dnl Copyright (C) 2006-2021 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. @@ -26,21 +26,24 @@ AC_DEFUN([gl_FUNC_FCHDIR], dnl fstatat, since no platform has fstatat but lacks fchdir. AC_CACHE_CHECK([whether open can visit directories], [gl_cv_func_open_directory_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h> -]], [return open(".", O_RDONLY) < 0;])], - [gl_cv_func_open_directory_works=yes], - [gl_cv_func_open_directory_works=no], - [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_open_directory_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; - esac - ])]) + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <fcntl.h> + ]GL_MDA_DEFINES], + [[return open(".", O_RDONLY) < 0;]])], + [gl_cv_func_open_directory_works=yes], + [gl_cv_func_open_directory_works=no], + [case "$host_os" in + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_open_directory_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; + esac + ])]) case "$gl_cv_func_open_directory_works" in *yes) ;; *) diff --git a/gnulib/import/m4/fcntl-o.m4 b/gnulib/import/m4/fcntl-o.m4 index 747b865..7c459ad 100644 --- a/gnulib/import/m4/fcntl-o.m4 +++ b/gnulib/import/m4/fcntl-o.m4 @@ -1,5 +1,5 @@ -# fcntl-o.m4 serial 6 -dnl Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. +# fcntl-o.m4 serial 7 +dnl Copyright (C) 2006, 2009-2021 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. @@ -32,6 +32,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], # defined sleep(n) _sleep ((n) * 1000) #endif #include <fcntl.h> + ]GL_MDA_DEFINES[ #ifndef O_NOATIME #define O_NOATIME 0 #endif diff --git a/gnulib/import/m4/fcntl.m4 b/gnulib/import/m4/fcntl.m4 index 562ae23..f626434 100644 --- a/gnulib/import/m4/fcntl.m4 +++ b/gnulib/import/m4/fcntl.m4 @@ -1,5 +1,5 @@ -# fcntl.m4 serial 9 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +# fcntl.m4 serial 11 +dnl Copyright (C) 2009-2021 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. @@ -34,6 +34,7 @@ AC_DEFUN([gl_FUNC_FCNTL], #include <limits.h> #include <sys/resource.h> #include <unistd.h> + ]GL_MDA_DEFINES[ #ifndef RLIM_SAVED_CUR # define RLIM_SAVED_CUR RLIM_INFINITY #endif @@ -80,15 +81,29 @@ AC_DEFUN([gl_FUNC_FCNTL], behavior does not match POSIX]) ;; esac - dnl Many systems lack F_DUPFD_CLOEXEC + dnl Many systems lack F_DUPFD_CLOEXEC. + dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD. AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC], [gl_cv_func_fcntl_f_dupfd_cloexec], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include <fcntl.h> -#ifndef F_DUPFD_CLOEXEC -choke me -#endif - ]])], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE( + [[#include <fcntl.h> + #include <unistd.h> + int main (int argc, char *argv[]) + { + if (argc == 1) + /* parent process */ + { + if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0) + return 1; + return execl ("./conftest", "./conftest", "child", NULL); + } + else + /* child process */ + return (fcntl (10, F_GETFL) < 0 ? 0 : 42); + } + ]]) + ], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef __linux__ /* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace @@ -97,12 +112,22 @@ choke me #endif ]])], [gl_cv_func_fcntl_f_dupfd_cloexec=yes], - [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])], - [gl_cv_func_fcntl_f_dupfd_cloexec=no])]) - if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then - gl_REPLACE_FCNTL - dnl No witness macro needed for this bug. - fi + [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"]) + ], + [gl_cv_func_fcntl_f_dupfd_cloexec=no], + [case "$host_os" in + # Guess no on NetBSD. + netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;; + esac + ]) + ]) + case "$gl_cv_func_fcntl_f_dupfd_cloexec" in + *yes) ;; + *) gl_REPLACE_FCNTL + dnl No witness macro needed for this bug. + ;; + esac fi dnl Replace fcntl() for supporting the gnulib-defined fchdir() function, dnl to keep fchdir's bookkeeping up-to-date. diff --git a/gnulib/import/m4/fcntl_h.m4 b/gnulib/import/m4/fcntl_h.m4 index 6b25393..e63a82f 100644 --- a/gnulib/import/m4/fcntl_h.m4 +++ b/gnulib/import/m4/fcntl_h.m4 @@ -1,6 +1,6 @@ -# serial 16 +# serial 17 # Configure fcntl.h. -dnl Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2007, 2009-2021 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. @@ -42,6 +42,9 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS], GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_CREAT=1; AC_SUBST([GNULIB_MDA_CREAT]) + GNULIB_MDA_OPEN=1; AC_SUBST([GNULIB_MDA_OPEN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) diff --git a/gnulib/import/m4/fdopendir.m4 b/gnulib/import/m4/fdopendir.m4 index d9cc1a0..d428380 100644 --- a/gnulib/import/m4/fdopendir.m4 +++ b/gnulib/import/m4/fdopendir.m4 @@ -1,7 +1,7 @@ -# serial 12 +# serial 14 # See if we need to provide fdopendir. -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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. @@ -25,10 +25,12 @@ AC_DEFUN([gl_FUNC_FDOPENDIR], else AC_CACHE_CHECK([whether fdopendir works], [gl_cv_func_fdopendir_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ #include <dirent.h> #include <fcntl.h> #include <unistd.h> +]GL_MDA_DEFINES[ #if !HAVE_DECL_FDOPENDIR extern # ifdef __cplusplus @@ -36,12 +38,14 @@ extern # endif DIR *fdopendir (int); #endif -]], [int result = 0; - int fd = open ("conftest.c", O_RDONLY); - if (fd < 0) result |= 1; - if (fdopendir (fd)) result |= 2; - if (close (fd)) result |= 4; - return result;])], +]], + [[int result = 0; + int fd = open ("conftest.c", O_RDONLY); + if (fd < 0) result |= 1; + if (fdopendir (fd)) result |= 2; + if (close (fd)) result |= 4; + return result; + ]])], [gl_cv_func_fdopendir_works=yes], [gl_cv_func_fdopendir_works=no], [case "$host_os" in diff --git a/gnulib/import/m4/filenamecat.m4 b/gnulib/import/m4/filenamecat.m4 index 7eff5b9..e6eac12 100644 --- a/gnulib/import/m4/filenamecat.m4 +++ b/gnulib/import/m4/filenamecat.m4 @@ -1,5 +1,5 @@ # filenamecat.m4 serial 11 -dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2021 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. diff --git a/gnulib/import/m4/flexmember.m4 b/gnulib/import/m4/flexmember.m4 index 90f3ddd..49b1c75 100644 --- a/gnulib/import/m4/flexmember.m4 +++ b/gnulib/import/m4/flexmember.m4 @@ -1,7 +1,7 @@ # serial 5 # Check for flexible array member support. -# Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/float_h.m4 b/gnulib/import/m4/float_h.m4 index 3ef0bb7..ba38a28 100644 --- a/gnulib/import/m4/float_h.m4 +++ b/gnulib/import/m4/float_h.m4 @@ -1,5 +1,5 @@ # float_h.m4 serial 12 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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. diff --git a/gnulib/import/m4/fnmatch.m4 b/gnulib/import/m4/fnmatch.m4 index 2f8e4a8..81589ca 100644 --- a/gnulib/import/m4/fnmatch.m4 +++ b/gnulib/import/m4/fnmatch.m4 @@ -1,6 +1,6 @@ # Check for fnmatch - serial 15. -*- coding: utf-8 -*- -# Copyright (C) 2000-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2000-2007, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/fnmatch_h.m4 b/gnulib/import/m4/fnmatch_h.m4 index a21ec2c..7840b4a 100644 --- a/gnulib/import/m4/fnmatch_h.m4 +++ b/gnulib/import/m4/fnmatch_h.m4 @@ -1,5 +1,5 @@ # fnmatch_h.m4 serial 4 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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. diff --git a/gnulib/import/m4/fpieee.m4 b/gnulib/import/m4/fpieee.m4 index d5c9aef..3f16957 100644 --- a/gnulib/import/m4/fpieee.m4 +++ b/gnulib/import/m4/fpieee.m4 @@ -1,5 +1,5 @@ # fpieee.m4 serial 2 -*- coding: utf-8 -*- -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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. diff --git a/gnulib/import/m4/free.m4 b/gnulib/import/m4/free.m4 new file mode 100644 index 0000000..d671376 --- /dev/null +++ b/gnulib/import/m4/free.m4 @@ -0,0 +1,49 @@ +# free.m4 serial 5 +# Copyright (C) 2003-2005, 2009-2021 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert and Bruno Haible. + +AC_DEFUN([gl_FUNC_FREE], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + dnl In the next release of POSIX, free must preserve errno. + dnl https://www.austingroupbugs.net/view.php?id=385 + dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924 + dnl So far, we know of three platforms that do this: + dnl * glibc >= 2.33, thanks to the fix for this bug: + dnl <https://sourceware.org/bugzilla/show_bug.cgi?id=17924> + dnl * OpenBSD >= 4.5, thanks to this commit: + dnl <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h> + dnl * Solaris, because its malloc() implementation is based on brk(), + dnl not mmap(); hence its free() implementation makes no system calls. + dnl For other platforms, you can only be sure if they state it in their + dnl documentation, or by code inspection of the free() implementation in libc. + AC_CACHE_CHECK([whether free is known to preserve errno], + [gl_cv_func_free_preserves_errno], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdlib.h> + ]], + [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__) + #elif defined __OpenBSD__ + #elif defined __sun + #else + #error "'free' is not known to preserve errno" + #endif + ]])], + [gl_cv_func_free_preserves_errno=yes], + [gl_cv_func_free_preserves_errno=no]) + ]) + + case $gl_cv_func_free_preserves_errno in + *yes) ;; + *) REPLACE_FREE=1 ;; + esac +]) + +# Prerequisites of lib/free.c. +AC_DEFUN([gl_PREREQ_FREE], [:]) diff --git a/gnulib/import/m4/frexp.m4 b/gnulib/import/m4/frexp.m4 index 5d977d4..04248b0 100644 --- a/gnulib/import/m4/frexp.m4 +++ b/gnulib/import/m4/frexp.m4 @@ -1,5 +1,5 @@ # frexp.m4 serial 16 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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. diff --git a/gnulib/import/m4/frexpl.m4 b/gnulib/import/m4/frexpl.m4 index e79fa5c..32f1eac 100644 --- a/gnulib/import/m4/frexpl.m4 +++ b/gnulib/import/m4/frexpl.m4 @@ -1,5 +1,5 @@ -# frexpl.m4 serial 21 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# frexpl.m4 serial 22 +dnl Copyright (C) 2007-2021 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. @@ -150,6 +150,7 @@ extern "C" #endif long double frexpl (long double, int *); +long double zero = 0.0L; int main() { int result = 0; @@ -207,7 +208,8 @@ int main() } } /* Test on infinite numbers. */ - x = 1.0L / 0.0L; + /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ + x = 1.0L / zero; { int exp; long double y = frexpl (x, &exp); diff --git a/gnulib/import/m4/fstat.m4 b/gnulib/import/m4/fstat.m4 index 53c0896..3b5b238 100644 --- a/gnulib/import/m4/fstat.m4 +++ b/gnulib/import/m4/fstat.m4 @@ -1,5 +1,5 @@ -# fstat.m4 serial 6 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# fstat.m4 serial 7 +dnl Copyright (C) 2011-2021 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. @@ -35,5 +35,6 @@ AC_DEFUN([gl_FUNC_FSTAT], # Prerequisites of lib/fstat.c and lib/stat-w32.c. AC_DEFUN([gl_PREREQ_FSTAT], [ AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + AC_REQUIRE([gl_PREREQ_STAT_W32]) : ]) diff --git a/gnulib/import/m4/fstatat.m4 b/gnulib/import/m4/fstatat.m4 index 19583ed..d730e46 100644 --- a/gnulib/import/m4/fstatat.m4 +++ b/gnulib/import/m4/fstatat.m4 @@ -1,5 +1,5 @@ # fstatat.m4 serial 4 -dnl Copyright (C) 2004-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2021 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. diff --git a/gnulib/import/m4/getcwd-abort-bug.m4 b/gnulib/import/m4/getcwd-abort-bug.m4 index 2715f0a..89d0689 100644 --- a/gnulib/import/m4/getcwd-abort-bug.m4 +++ b/gnulib/import/m4/getcwd-abort-bug.m4 @@ -1,16 +1,16 @@ -# serial 11 +# serial 15 # Determine whether getcwd aborts when the length of the working directory # name is unusually large. Any length between 4k and 16k trigger the bug # when using glibc-2.4.90-9 or older. -# Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # From Jim Meyering -# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-BUGGY[, ACTION-IF-WORKS]]) AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles @@ -24,8 +24,8 @@ AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], [Define to 1 if the system has the 'getpagesize' function.]) fi - AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k], - [gl_cv_func_getcwd_abort_bug], + AC_CACHE_CHECK([whether getcwd succeeds when 4k < cwd_length < 16k], + [gl_cv_func_getcwd_succeeds_beyond_4k], [# Remove any remnants of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. @@ -45,9 +45,7 @@ AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], #include <sys/stat.h> ]gl_PATHMAX_SNIPPET[ - -/* Don't get link errors because mkdir is redefined to rpl_mkdir. */ -#undef mkdir +]GL_MDA_DEFINES[ #ifndef S_IRWXU # define S_IRWXU 0700 @@ -128,30 +126,30 @@ main () return fail; } ]])], - [gl_cv_func_getcwd_abort_bug=no], + [gl_cv_func_getcwd_succeeds_beyond_4k=yes], [dnl An abort will provoke an exit code of something like 134 (128 + 6). - dnl An exit code of 4 can also occur (in OpenBSD 4.9, NetBSD 5.1 for + dnl An exit code of 4 can also occur (in OpenBSD 6.7, NetBSD 5.1 for dnl example): getcwd (NULL, 0) fails rather than returning a string dnl longer than PATH_MAX. This may be POSIX compliant (in some dnl interpretations of POSIX). But gnulib's getcwd module wants to dnl provide a non-NULL value in this case. ret=$? if test $ret -ge 128 || test $ret = 4; then - gl_cv_func_getcwd_abort_bug=yes + gl_cv_func_getcwd_succeeds_beyond_4k=no else - gl_cv_func_getcwd_abort_bug=no + gl_cv_func_getcwd_succeeds_beyond_4k=yes fi ], [case "$host_os" in - # Guess no on musl systems. - *-musl*) gl_cv_func_getcwd_abort_bug="guessing no" ;; - # Guess yes otherwise, even on glibc systems. - *) gl_cv_func_getcwd_abort_bug="guessing yes" + # Guess yes on musl systems. + *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;; + # Guess no otherwise, even on glibc systems. + *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no" esac ]) ]) - case "$gl_cv_func_getcwd_abort_bug" in - *yes) + case "$gl_cv_func_getcwd_succeeds_beyond_4k" in + *no) $1 ;; *) diff --git a/gnulib/import/m4/getcwd-path-max.m4 b/gnulib/import/m4/getcwd-path-max.m4 index 1ff3f25..4238ae7 100644 --- a/gnulib/import/m4/getcwd-path-max.m4 +++ b/gnulib/import/m4/getcwd-path-max.m4 @@ -1,4 +1,4 @@ -# serial 23 +# serial 25 # Check for several getcwd bugs with long file names. # If so, arrange to compile the wrapper function. @@ -6,7 +6,7 @@ # I've heard that this is due to a Linux kernel bug, and that it has # been fixed between 2.4.21-pre3 and 2.4.21-pre4. -# Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -55,8 +55,7 @@ AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX], /* Use the getcwd function, not any macro. */ #undef getcwd -/* Don't get link errors because mkdir is redefined to rpl_mkdir. */ -#undef mkdir +]GL_MDA_DEFINES[ #ifndef S_IRWXU # define S_IRWXU 0700 diff --git a/gnulib/import/m4/getcwd.m4 b/gnulib/import/m4/getcwd.m4 index ba68c5f..6ec7a94 100644 --- a/gnulib/import/m4/getcwd.m4 +++ b/gnulib/import/m4/getcwd.m4 @@ -1,12 +1,12 @@ # getcwd.m4 - check for working getcwd that is compatible with glibc -# Copyright (C) 2001, 2003-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. -# serial 18 +# serial 19 AC_DEFUN([gl_FUNC_GETCWD_NULL], [ @@ -21,12 +21,13 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], # else /* on Windows with MSVC */ # include <direct.h> # endif + ]GL_MDA_DEFINES[ # ifndef getcwd char *getcwd (); # endif ]], [[ #if defined _WIN32 && ! defined __CYGWIN__ -/* mingw cwd does not start with '/', but getcwd does allocate. +/* mingw cwd does not start with '/', but _getcwd does allocate. However, mingw fails to honor non-zero size. */ #else if (chdir ("/") != 0) @@ -66,7 +67,8 @@ AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE], [gl_cv_func_getcwd_posix_signature], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include <unistd.h>]], + [[#include <unistd.h> + ]GL_MDA_DEFINES], [[extern #ifdef __cplusplus "C" diff --git a/gnulib/import/m4/getdtablesize.m4 b/gnulib/import/m4/getdtablesize.m4 index ab2e3fe..8fbc941 100644 --- a/gnulib/import/m4/getdtablesize.m4 +++ b/gnulib/import/m4/getdtablesize.m4 @@ -1,5 +1,5 @@ -# getdtablesize.m4 serial 7 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# getdtablesize.m4 serial 8 +dnl Copyright (C) 2008-2021 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. @@ -29,13 +29,16 @@ AC_DEFUN([gl_FUNC_GETDTABLESIZE], dnl correctly require setrlimit before getdtablesize() can report dnl a larger value. AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[#include <unistd.h>]], - [int size = getdtablesize(); - if (dup2 (0, getdtablesize()) != -1) - return 1; - if (size != getdtablesize()) - return 2; - ])], + AC_LANG_PROGRAM( + [[#include <unistd.h>] + GL_MDA_DEFINES + ], + [[int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + ]])], [gl_cv_func_getdtablesize_works=yes], [gl_cv_func_getdtablesize_works=no], [case "$host_os" in diff --git a/gnulib/import/m4/getlogin.m4 b/gnulib/import/m4/getlogin.m4 index a0678d0..c5b7f1a 100644 --- a/gnulib/import/m4/getlogin.m4 +++ b/gnulib/import/m4/getlogin.m4 @@ -1,5 +1,5 @@ # getlogin.m4 serial 5 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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. diff --git a/gnulib/import/m4/getlogin_r.m4 b/gnulib/import/m4/getlogin_r.m4 index 3ec7692..3e8a2f0 100644 --- a/gnulib/import/m4/getlogin_r.m4 +++ b/gnulib/import/m4/getlogin_r.m4 @@ -1,6 +1,6 @@ -#serial 12 +#serial 13 -# Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -30,7 +30,7 @@ AC_DEFUN([gl_FUNC_GETLOGIN_R], HAVE_GETLOGIN_R=0 else HAVE_GETLOGIN_R=1 - dnl On Mac OS X 10.12 and OSF/1 5.1, getlogin_r returns a truncated result + dnl On Mac OS X 10.13 and OSF/1 5.1, getlogin_r returns a truncated result dnl if the buffer is not large enough. AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether getlogin_r works with small buffers], diff --git a/gnulib/import/m4/getpagesize.m4 b/gnulib/import/m4/getpagesize.m4 index 8f0f046..7e61801 100644 --- a/gnulib/import/m4/getpagesize.m4 +++ b/gnulib/import/m4/getpagesize.m4 @@ -1,5 +1,5 @@ # getpagesize.m4 serial 10 -dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/getprogname.m4 b/gnulib/import/m4/getprogname.m4 index 6baefc9..65917d6 100644 --- a/gnulib/import/m4/getprogname.m4 +++ b/gnulib/import/m4/getprogname.m4 @@ -1,6 +1,6 @@ # getprogname.m4 - check for getprogname or replacements for it -# Copyright (C) 2016-2020 Free Software Foundation, Inc. +# Copyright (C) 2016-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/getrandom.m4 b/gnulib/import/m4/getrandom.m4 index 2a0034b..5f174dc 100644 --- a/gnulib/import/m4/getrandom.m4 +++ b/gnulib/import/m4/getrandom.m4 @@ -1,5 +1,5 @@ -# getrandom.m4 serial 6 -dnl Copyright 2020 Free Software Foundation, Inc. +# getrandom.m4 serial 8 +dnl Copyright 2020-2021 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. @@ -18,7 +18,8 @@ AC_DEFUN([gl_FUNC_GETRANDOM], [gl_cv_func_getrandom_ok], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[/* Additional includes are needed before <sys/random.h> on Mac OS X. */ + [[/* Additional includes are needed before <sys/random.h> on uClibc + and Mac OS X. */ #include <sys/types.h> #include <stdlib.h> #include <sys/random.h> @@ -36,7 +37,9 @@ AC_DEFUN([gl_FUNC_GETRANDOM], case "$host_os" in mingw*) - AC_CHECK_HEADERS([bcrypt.h]) + AC_CHECK_HEADERS([bcrypt.h], [], [], + [[#include <windows.h> + ]]) AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present], [gl_cv_lib_assume_bcrypt], [AC_COMPILE_IFELSE( diff --git a/gnulib/import/m4/gettimeofday.m4 b/gnulib/import/m4/gettimeofday.m4 index c72b3ea..3c20081 100644 --- a/gnulib/import/m4/gettimeofday.m4 +++ b/gnulib/import/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ -# serial 27 +# serial 28 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -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 <string.h> - #include <sys/time.h> - #include <time.h> - #include <stdlib.h> - ]], - [[ - 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/gnulib/import/m4/glob.m4 b/gnulib/import/m4/glob.m4 index d4cd03f..232136e 100644 --- a/gnulib/import/m4/glob.m4 +++ b/gnulib/import/m4/glob.m4 @@ -1,5 +1,5 @@ # glob.m4 serial 24 -dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2021 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. diff --git a/gnulib/import/m4/glob_h.m4 b/gnulib/import/m4/glob_h.m4 index 7ecc0fd..ef4c9cc 100644 --- a/gnulib/import/m4/glob_h.m4 +++ b/gnulib/import/m4/glob_h.m4 @@ -1,5 +1,5 @@ # glob_h.m4 serial 5 -dnl Copyright (C) 2018-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2018-2021 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. diff --git a/gnulib/import/m4/gnulib-cache.m4 b/gnulib/import/m4/gnulib-cache.m4 index db95504..4087382 100644 --- a/gnulib/import/m4/gnulib-cache.m4 +++ b/gnulib/import/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # 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 diff --git a/gnulib/import/m4/gnulib-common.m4 b/gnulib/import/m4/gnulib-common.m4 index f4ba5e3..535359b 100644 --- a/gnulib/import/m4/gnulib-common.m4 +++ b/gnulib/import/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 50 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# gnulib-common.m4 serial 63 +dnl Copyright (C) 2007-2021 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. @@ -45,7 +45,7 @@ AC_DEFUN([gl_COMMON_BODY], [ ? 6000000 <= __apple_build_version__ \ : 3 < __clang_major__ + (5 <= __clang_minor__)))) /* _Noreturn works as-is. */ -# elif _GL_GNUC_PREREQ (2, 8) || 0x5110 <= __SUNPRO_C +# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) @@ -76,6 +76,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) # define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_diagnose_if 0 # define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) # define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) @@ -120,9 +121,14 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif /* Avoid __attribute__ ((cold)) on MinGW; see thread starting at - <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */ + <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. + 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 @@ -144,6 +150,9 @@ AC_DEFUN([gl_COMMON_BODY], [ #if _GL_HAS_ATTRIBUTE (error) # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg))) # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg))) +#elif _GL_HAS_ATTRIBUTE (diagnose_if) +# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error"))) +# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning"))) #else # define _GL_ATTRIBUTE_ERROR(msg) # define _GL_ATTRIBUTE_WARNING(msg) @@ -176,7 +185,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 @@ -293,6 +303,22 @@ AC_DEFUN([gl_COMMON_BODY], [ errno. */ #define _GL_ASYNC_SAFE ]) + AH_VERBATIM([micro_optimizations], +[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where + n1 and n2 are expressions without side effects, that evaluate to real + numbers (excluding NaN). + 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 dnl familiar with, --enable-cross-guesses=conservative is the appropriate @@ -454,34 +480,20 @@ AC_DEFUN([gl_FEATURES_H], AC_SUBST([HAVE_FEATURES_H]) ]) -# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) -# ---------------------------------------------------- -# Backport of autoconf-2.63b's macro. -# Remove this macro when we can assume autoconf >= 2.64. -m4_ifndef([AS_VAR_IF], -[m4_define([AS_VAR_IF], -[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) - # gl_PROG_CC_C99 # Modifies the value of the shell variable CC in an attempt to make $CC # understand ISO C99 source code. -# This is like AC_PROG_CC_C99, except that -# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC -# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>, -# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 -# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00441.html>. -# Remaining problems: -# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options -# to CC twice -# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00431.html>. -# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. AC_DEFUN([gl_PROG_CC_C99], [ - dnl Change that version number to the minimum Autoconf version that supports - dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. - m4_version_prereq([9.0], - [AC_REQUIRE([AC_PROG_CC_C99])], - [AC_REQUIRE([AC_PROG_CC_STDC])]) + dnl Just use AC_PROG_CC_C99. + dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted + dnl value of CC will contain the C99 enabling options twice. But this is only + dnl a cosmetic problem. + dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99; + dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete." + m4_version_prereq([2.70], + [AC_REQUIRE([AC_PROG_CC])], + [AC_REQUIRE([AC_PROG_CC_C99])]) ]) # gl_PROG_AR_RANLIB @@ -555,16 +567,16 @@ Amsterdam ]) # AC_C_RESTRICT -# This definition is copied from post-2.69 Autoconf and overrides the -# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed -# once autoconf >= 2.70 can be assumed. It's painful to check version -# numbers, and in practice this macro is more up-to-date than Autoconf -# is, so override Autoconf unconditionally. +# This definition is copied from post-2.70 Autoconf and overrides the +# AC_C_RESTRICT macro from autoconf 2.60..2.70. +m4_version_prereq([2.70.1], [], [ AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - for ac_kw in __restrict __restrict__ _Restrict restrict; do + # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: + # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html + # Put 'restrict' last, because C++ lacks it. + for ac_kw in __restrict__ __restrict _Restrict restrict; do AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[typedef int *int_ptr; @@ -584,7 +596,7 @@ AC_DEFUN([AC_C_RESTRICT], AH_VERBATIM([restrict], [/* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is - supported directly. */ + supported only directly. */ #undef restrict /* Work around a bug in older versions of Sun C++, which did not #define __restrict__ or support _Restrict or __restrict__ @@ -602,6 +614,7 @@ AC_DEFUN([AC_C_RESTRICT], *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ])# AC_C_RESTRICT +]) # gl_BIGENDIAN # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. @@ -612,6 +625,22 @@ AC_DEFUN([gl_BIGENDIAN], AC_C_BIGENDIAN ]) +# A temporary file descriptor. +# Must be less than 10, because dash 0.5.8 does not support redirections +# with multi-digit file descriptors. +m4_define([GL_TMP_FD], 9) + +# gl_SILENT(command) +# executes command, but without the normal configure output. +# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.) +# inside another AC_CACHE_CHECK. +AC_DEFUN([gl_SILENT], +[ + exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null + $1 + exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&- +]) + # 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. @@ -619,12 +648,77 @@ AC_DEFUN([gl_BIGENDIAN], # by an AC_MSG_CHECKING/AC_MSG_RESULT pair. AC_DEFUN([gl_CACHE_VAL_SILENT], [ - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - AC_CACHE_VAL([$1], [$2]) - as_echo_n="$saved_as_echo_n" + gl_SILENT([ + AC_CACHE_VAL([$1], [$2]) + ]) ]) -# AS_VAR_COPY was added in autoconf 2.63b -m4_define_default([AS_VAR_COPY], -[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) +dnl Expands to some code for use in .c programs that, on native Windows, defines +dnl the Microsoft deprecated alias function names to the underscore-prefixed +dnl actual function names. With this macro, these function names are available +dnl without linking with '-loldnames' and without generating warnings. +dnl Usage: Use it after all system header files are included. +dnl #include <...> +dnl #include <...> +dnl ]GL_MDA_DEFINES[ +dnl ... +AC_DEFUN([GL_MDA_DEFINES],[ +AC_REQUIRE([_GL_MDA_DEFINES]) +[$gl_mda_defines] +]) +AC_DEFUN([_GL_MDA_DEFINES], +[gl_mda_defines=' +#if defined _WIN32 && !defined __CYGWIN__ +#define access _access +#define chdir _chdir +#define chmod _chmod +#define close _close +#define creat _creat +#define dup _dup +#define dup2 _dup2 +#define ecvt _ecvt +#define execl _execl +#define execle _execle +#define execlp _execlp +#define execv _execv +#define execve _execve +#define execvp _execvp +#define execvpe _execvpe +#define fcloseall _fcloseall +#define fcvt _fcvt +#define fdopen _fdopen +#define fileno _fileno +#define gcvt _gcvt +#define getcwd _getcwd +#define getpid _getpid +#define getw _getw +#define isatty _isatty +#define j0 _j0 +#define j1 _j1 +#define jn _jn +#define lfind _lfind +#define lsearch _lsearch +#define lseek _lseek +#define memccpy _memccpy +#define mkdir _mkdir +#define mktemp _mktemp +#define open _open +#define putenv _putenv +#define putw _putw +#define read _read +#define rmdir _rmdir +#define strdup _strdup +#define swab _swab +#define tempnam _tempnam +#define tzset _tzset +#define umask _umask +#define unlink _unlink +#define utime _utime +#define wcsdup _wcsdup +#define write _write +#define y0 _y0 +#define y1 _y1 +#define yn _yn +#endif +' +]) diff --git a/gnulib/import/m4/gnulib-comp.m4 b/gnulib/import/m4/gnulib-comp.m4 index 8c2c28e..682bfc8 100644 --- a/gnulib/import/m4/gnulib-comp.m4 +++ b/gnulib/import/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # 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 @@ -50,12 +50,14 @@ AC_DEFUN([gl_EARLY], # Code from module assure: # Code from module at-internal: # Code from module attribute: + # Code from module basename-lgpl: # Code from module btowc: # Code from module builtin-expect: # Code from module c99: # Code from module canonicalize-lgpl: # Code from module chdir: # Code from module chdir-long: + # Code from module clock-time: # Code from module cloexec: # Code from module close: # Code from module closedir: @@ -69,6 +71,7 @@ AC_DEFUN([gl_EARLY], # Code from module double-slash-root: # Code from module dup: # Code from module dup2: + # Code from module eloop-threshold: # Code from module environ: # Code from module errno: # Code from module error: @@ -91,6 +94,7 @@ AC_DEFUN([gl_EARLY], # Code from module fpieee: AC_REQUIRE([gl_FP_IEEE]) # Code from module fpucw: + # Code from module free-posix: # Code from module frexp: # Code from module frexpl: # Code from module fstat: @@ -106,6 +110,7 @@ AC_DEFUN([gl_EARLY], # Code from module glob: # Code from module glob-h: # Code from module hard-locale: + # Code from module idx: # Code from module include_next: # Code from module inet_ntop: # Code from module intprops: @@ -120,7 +125,6 @@ AC_DEFUN([gl_EARLY], # Code from module limits-h: # Code from module localcharset: # Code from module locale: - # Code from module localtime-buffer: # Code from module lock: # Code from module lstat: # Code from module malloc-posix: @@ -150,6 +154,7 @@ AC_DEFUN([gl_EARLY], # Code from module openat-h: # Code from module opendir: # Code from module pathmax: + # Code from module pipe-posix: # Code from module rawmemchr: # Code from module readdir: # Code from module readlink: @@ -253,10 +258,11 @@ AC_DEFUN([gl_INIT], gl_STDLIB_MODULE_INDICATOR([realpath]) gl_UNISTD_MODULE_INDICATOR([chdir]) gl_FUNC_CHDIR_LONG - if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then + if test $gl_cv_have_unlimited_file_name_length = no; then AC_LIBOBJ([chdir-long]) gl_PREREQ_CHDIR_LONG fi + gl_CLOCK_TIME gl_MODULE_INDICATOR_FOR_TESTS([cloexec]) gl_FUNC_CLOSE if test $REPLACE_CLOSE = 1; then @@ -279,7 +285,6 @@ AC_DEFUN([gl_INIT], gl_PREREQ_DIRFD fi gl_DIRENT_MODULE_INDICATOR([dirfd]) - gl_DIRNAME_LGPL gl_DOUBLE_SLASH_ROOT gl_FUNC_DUP if test $REPLACE_DUP = 1; then @@ -288,7 +293,7 @@ AC_DEFUN([gl_INIT], fi gl_UNISTD_MODULE_INDICATOR([dup]) gl_FUNC_DUP2 - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + if test $REPLACE_DUP2 = 1; then AC_LIBOBJ([dup2]) gl_PREREQ_DUP2 fi @@ -342,6 +347,12 @@ AC_DEFUN([gl_INIT], fi gl_MODULE_INDICATOR([fnmatch-gnu]) gl_FNMATCH_H + gl_FUNC_FREE + if test $REPLACE_FREE = 1; then + AC_LIBOBJ([free]) + gl_PREREQ_FREE + fi + gl_STDLIB_MODULE_INDICATOR([free-posix]) AC_REQUIRE([gl_FUNC_FREXP]) if test $gl_func_frexp != yes; then AC_LIBOBJ([frexp]) @@ -454,8 +465,6 @@ AC_DEFUN([gl_INIT], LOCALCHARSET_TESTS_ENVIRONMENT= AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) gl_LOCALE_H - AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) - AC_LIBOBJ([localtime-buffer]) gl_LOCK gl_MODULE_INDICATOR([lock]) gl_FUNC_LSTAT @@ -502,7 +511,7 @@ AC_DEFUN([gl_INIT], fi gl_STDLIB_MODULE_INDICATOR([mbtowc]) gl_FUNC_MEMCHR - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + if test $REPLACE_MEMCHR = 1; then AC_LIBOBJ([memchr]) gl_PREREQ_MEMCHR fi @@ -533,6 +542,7 @@ AC_DEFUN([gl_INIT], if test $REPLACE_MKDIR = 1; then AC_LIBOBJ([mkdir]) fi + gl_SYS_STAT_MODULE_INDICATOR([mkdir]) gl_FUNC_MKDTEMP if test $HAVE_MKDTEMP = 0; then AC_LIBOBJ([mkdtemp]) @@ -577,6 +587,11 @@ AC_DEFUN([gl_INIT], fi gl_DIRENT_MODULE_INDICATOR([opendir]) gl_PATHMAX + gl_FUNC_PIPE + if test $HAVE_PIPE = 0; then + AC_LIBOBJ([pipe]) + fi + gl_UNISTD_MODULE_INDICATOR([pipe]) gl_FUNC_RAWMEMCHR if test $HAVE_RAWMEMCHR = 0; then AC_LIBOBJ([rawmemchr]) @@ -655,7 +670,7 @@ AC_DEFUN([gl_INIT], fi gl_STRING_MODULE_INDICATOR([strchrnul]) gl_FUNC_STRDUP_POSIX - if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then + if test $REPLACE_STRDUP = 1; then AC_LIBOBJ([strdup]) gl_PREREQ_STRDUP fi @@ -715,6 +730,7 @@ AC_DEFUN([gl_INIT], gl_HEADER_SYS_UIO AC_PROG_MKDIR_P gl_FUNC_GEN_TEMPNAME + gl_MODULE_INDICATOR([tempname]) AC_REQUIRE([gl_THREADLIB]) gl_HEADER_TIME_H gl_TIME_R @@ -917,6 +933,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/at-func.c lib/attribute.h lib/basename-lgpl.c + lib/basename-lgpl.h lib/btowc.c lib/c++defs.h lib/canonicalize-lgpl.c @@ -939,6 +956,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/dup-safer.c lib/dup.c lib/dup2.c + lib/eloop-threshold.h lib/errno.in.h lib/error.c lib/error.h @@ -963,6 +981,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/fnmatch.in.h lib/fnmatch_loop.c lib/fpucw.h + lib/free.c lib/frexp.c lib/frexpl.c lib/fstat.c @@ -987,6 +1006,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/glthread/threadlib.c lib/hard-locale.c lib/hard-locale.h + lib/idx.h lib/inet_ntop.c lib/intprops.h lib/inttypes.in.h @@ -1004,11 +1024,10 @@ AC_DEFUN([gl_FILE_LIST], [ lib/localcharset.c lib/localcharset.h lib/locale.in.h - lib/localtime-buffer.c - lib/localtime-buffer.h lib/lstat.c lib/malloc.c lib/malloc/scratch_buffer.h + lib/malloc/scratch_buffer_dupfree.c lib/malloc/scratch_buffer_grow.c lib/malloc/scratch_buffer_grow_preserve.c lib/malloc/scratch_buffer_set_array_size.c @@ -1050,6 +1069,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/opendir.c lib/pathmax.h lib/pipe-safer.c + lib/pipe.c lib/rawmemchr.c lib/rawmemchr.valgrind lib/readdir.c @@ -1137,6 +1157,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/builtin-expect.m4 m4/canonicalize.m4 m4/chdir-long.m4 + m4/clock_time.m4 m4/close.m4 m4/closedir.m4 m4/codeset.m4 @@ -1145,7 +1166,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/d-type.m4 m4/dirent_h.m4 m4/dirfd.m4 - m4/dirname.m4 m4/double-slash-root.m4 m4/dup.m4 m4/dup2.m4 @@ -1168,6 +1188,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/fnmatch.m4 m4/fnmatch_h.m4 m4/fpieee.m4 + m4/free.m4 m4/frexp.m4 m4/frexpl.m4 m4/fstat.m4 @@ -1187,7 +1208,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/gnulib-common.m4 m4/include_next.m4 m4/inet_ntop.m4 - m4/inttypes-pri.m4 m4/inttypes.m4 m4/isblank.m4 m4/isnand.m4 @@ -1199,7 +1219,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/locale-ja.m4 m4/locale-zh.m4 m4/locale_h.m4 - m4/localtime-buffer.m4 m4/lock.m4 m4/lstat.m4 m4/malloc.m4 @@ -1232,6 +1251,8 @@ AC_DEFUN([gl_FILE_LIST], [ m4/openat.m4 m4/opendir.m4 m4/pathmax.m4 + m4/pid_t.m4 + m4/pipe.m4 m4/pthread_rwlock_rdlock.m4 m4/rawmemchr.m4 m4/readdir.m4 diff --git a/gnulib/import/m4/gnulib-tool.m4 b/gnulib/import/m4/gnulib-tool.m4 index 9e1744f..3d56d83 100644 --- a/gnulib/import/m4/gnulib-tool.m4 +++ b/gnulib/import/m4/gnulib-tool.m4 @@ -1,5 +1,5 @@ # gnulib-tool.m4 serial 2 -dnl Copyright (C) 2004-2005, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2005, 2009-2021 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. diff --git a/gnulib/import/m4/include_next.m4 b/gnulib/import/m4/include_next.m4 index 9009e29..bdd542b 100644 --- a/gnulib/import/m4/include_next.m4 +++ b/gnulib/import/m4/include_next.m4 @@ -1,5 +1,5 @@ -# include_next.m4 serial 24 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# include_next.m4 serial 26 +dnl Copyright (C) 2006-2021 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. @@ -106,19 +106,21 @@ dnl We intentionally avoid using AC_LANG_SOURCE here. AC_SUBST([INCLUDE_NEXT]) AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) - AC_CACHE_CHECK([whether system header files limit the line length], - [gl_cv_pragma_columns], - [dnl HP NonStop systems, which define __TANDEM, have this misfeature. - AC_EGREP_CPP([choke me], + + dnl HP NonStop systems, which define __TANDEM, limit the line length + dnl after including some system header files. + AC_CACHE_CHECK([whether source code line length is unlimited], + [gl_cv_source_line_length_unlimited], + [AC_EGREP_CPP([choke me], [ #ifdef __TANDEM choke me #endif ], - [gl_cv_pragma_columns=yes], - [gl_cv_pragma_columns=no]) + [gl_cv_source_line_length_unlimited=no], + [gl_cv_source_line_length_unlimited=yes]) ]) - if test $gl_cv_pragma_columns = yes; then + if test $gl_cv_source_line_length_unlimited = no; then PRAGMA_COLUMNS="#pragma COLUMNS 10000" else PRAGMA_COLUMNS= @@ -176,42 +178,40 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], [AC_CHECK_HEADERS_ONCE([$1]) ]) -dnl FIXME: gl_next_header and gl_header_exists must be used unquoted -dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_defn([gl_HEADER_NAME])) if test $gl_cv_have_include_next = yes; then - AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) else AC_CACHE_CHECK( [absolute name of <]m4_defn([gl_HEADER_NAME])[>], - m4_defn([gl_next_header]), + [gl_next_header], [m4_if([$2], [check], [AS_VAR_PUSHDEF([gl_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME])) - if test AS_VAR_GET(gl_header_exists) = yes; then + if test AS_VAR_GET([gl_header_exists]) = yes; then AS_VAR_POPDEF([gl_header_exists]) ]) gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) - AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) + AS_VAR_SET([gl_next_header], ['"'$gl_header'"']) m4_if([$2], [check], [else - AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) fi ]) ]) fi AC_SUBST( AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), - [AS_VAR_GET(gl_next_header)]) + [AS_VAR_GET([gl_next_header])]) if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' gl_next_as_first_directive='<'gl_HEADER_NAME'>' else # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=AS_VAR_GET(gl_next_header) + gl_next_as_first_directive=AS_VAR_GET([gl_next_header]) fi AC_SUBST( AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), diff --git a/gnulib/import/m4/inet_ntop.m4 b/gnulib/import/m4/inet_ntop.m4 index 39a6a9b..171f53e 100644 --- a/gnulib/import/m4/inet_ntop.m4 +++ b/gnulib/import/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ # inet_ntop.m4 serial 21 -dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2006, 2008-2021 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. diff --git a/gnulib/import/m4/inttypes-pri.m4 b/gnulib/import/m4/inttypes-pri.m4 deleted file mode 100644 index ac40a05..0000000 --- a/gnulib/import/m4/inttypes-pri.m4 +++ /dev/null @@ -1,42 +0,0 @@ -# inttypes-pri.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1997-2002, 2006, 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, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ([2.53]) - -# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* -# macros to non-string values. This is the case on AIX 4.3.3. - -AC_DEFUN([gt_INTTYPES_PRI], -[ - AC_CHECK_HEADERS([inttypes.h]) - if test $ac_cv_header_inttypes_h = yes; then - AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], - [gt_cv_inttypes_pri_broken], - [ - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -#include <inttypes.h> -#ifdef PRId32 -char *p = PRId32; -#endif - ]], - [[]])], - [gt_cv_inttypes_pri_broken=no], - [gt_cv_inttypes_pri_broken=yes]) - ]) - fi - if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], - [Define if <inttypes.h> exists and defines unusable PRI* macros.]) - PRI_MACROS_BROKEN=1 - else - PRI_MACROS_BROKEN=0 - fi - AC_SUBST([PRI_MACROS_BROKEN]) -]) diff --git a/gnulib/import/m4/inttypes.m4 b/gnulib/import/m4/inttypes.m4 index 224d0cd..f56e94a 100644 --- a/gnulib/import/m4/inttypes.m4 +++ b/gnulib/import/m4/inttypes.m4 @@ -1,5 +1,5 @@ -# inttypes.m4 serial 29 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# inttypes.m4 serial 32 +dnl Copyright (C) 2006-2021 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. @@ -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 <stdint.h>. It always defines intptr_t to 'long'. - PRIPTR_PREFIX='"l"' + dnl Using the gnulib <stdint.h>. 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 <stdint.h>. 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/gnulib/import/m4/isblank.m4 b/gnulib/import/m4/isblank.m4 index 5e1b783..e77e1a8 100644 --- a/gnulib/import/m4/isblank.m4 +++ b/gnulib/import/m4/isblank.m4 @@ -1,5 +1,5 @@ # isblank.m4 serial 3 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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. diff --git a/gnulib/import/m4/isnand.m4 b/gnulib/import/m4/isnand.m4 index c74795e..fc79f0b 100644 --- a/gnulib/import/m4/isnand.m4 +++ b/gnulib/import/m4/isnand.m4 @@ -1,5 +1,5 @@ -# isnand.m4 serial 11 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# isnand.m4 serial 12 +dnl Copyright (C) 2007-2021 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. @@ -58,7 +58,7 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM], AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include <math.h> - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #elif defined isnan @@ -81,7 +81,7 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM], AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include <math.h> - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #else diff --git a/gnulib/import/m4/isnanl.m4 b/gnulib/import/m4/isnanl.m4 index 75d5462..1ef16f5 100644 --- a/gnulib/import/m4/isnanl.m4 +++ b/gnulib/import/m4/isnanl.m4 @@ -1,5 +1,5 @@ -# isnanl.m4 serial 21 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# isnanl.m4 serial 22 +dnl Copyright (C) 2007-2021 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. @@ -68,12 +68,9 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM], AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include <math.h> - #ifndef __has_builtin - # define __has_builtin(name) 0 - #endif - #if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl)) + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -96,12 +93,9 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM], AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include <math.h> - #ifndef __has_builtin - # define __has_builtin(name) 0 - #endif - #if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl)) + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -129,12 +123,9 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS], #include <float.h> #include <limits.h> #include <math.h> -#ifndef __has_builtin -# define __has_builtin(name) 0 -#endif -#if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl)) +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) diff --git a/gnulib/import/m4/largefile.m4 b/gnulib/import/m4/largefile.m4 index 8017ca7..cadb16d 100644 --- a/gnulib/import/m4/largefile.m4 +++ b/gnulib/import/m4/largefile.m4 @@ -1,7 +1,7 @@ # Enable large files on systems where this is not the default. # Enable support for files on Linux file systems with 64-bit inode numbers. -# Copyright 1992-1996, 1998-2020 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -25,17 +25,17 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE], # The following implementation works around a problem in autoconf <= 2.69; # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, # or configures them incorrectly in some cases. -m4_version_prereq([2.70], [] ,[ +m4_version_prereq([2.70], [], [ # _AC_SYS_LARGEFILE_TEST_INCLUDES # ------------------------------- m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], -[@%:@include <sys/types.h> +[#include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]];[]dnl @@ -54,7 +54,7 @@ m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], [AC_LANG_PROGRAM([$5], [$6])], [$3=no; break]) m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([@%:@define $1 $2 + [AC_LANG_PROGRAM([#define $1 $2 $5], [$6])], [$3=$2; break]) $3=unknown diff --git a/gnulib/import/m4/limits-h.m4 b/gnulib/import/m4/limits-h.m4 index 0b4f092..70dbb7d 100644 --- a/gnulib/import/m4/limits-h.m4 +++ b/gnulib/import/m4/limits-h.m4 @@ -1,6 +1,6 @@ dnl Check whether limits.h has needed features. -dnl Copyright 2016-2020 Free Software Foundation, Inc. +dnl Copyright 2016-2021 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. diff --git a/gnulib/import/m4/localcharset.m4 b/gnulib/import/m4/localcharset.m4 index 9d21c4f..04389fc 100644 --- a/gnulib/import/m4/localcharset.m4 +++ b/gnulib/import/m4/localcharset.m4 @@ -1,5 +1,5 @@ # localcharset.m4 serial 8 -dnl Copyright (C) 2002, 2004, 2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2021 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. diff --git a/gnulib/import/m4/locale-fr.m4 b/gnulib/import/m4/locale-fr.m4 index 5abe052..b61df7e 100644 --- a/gnulib/import/m4/locale-fr.m4 +++ b/gnulib/import/m4/locale-fr.m4 @@ -1,5 +1,5 @@ -# locale-fr.m4 serial 19 -dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc. +# locale-fr.m4 serial 20 +dnl Copyright (C) 2003, 2005-2021 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. @@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_FR], AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include <locale.h> #include <time.h> #if HAVE_LANGINFO_CODESET @@ -78,8 +77,7 @@ int main () { return 0; #endif } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets @@ -143,8 +141,7 @@ AC_DEFUN([gt_LOCALE_FR_UTF8], [ AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include <locale.h> #include <time.h> #if HAVE_LANGINFO_CODESET @@ -206,8 +203,7 @@ int main () { #endif return 0; } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets diff --git a/gnulib/import/m4/locale-ja.m4 b/gnulib/import/m4/locale-ja.m4 index 0982ab1..cd94288 100644 --- a/gnulib/import/m4/locale-ja.m4 +++ b/gnulib/import/m4/locale-ja.m4 @@ -1,5 +1,5 @@ -# locale-ja.m4 serial 14 -dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc. +# locale-ja.m4 serial 15 +dnl Copyright (C) 2003, 2005-2021 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. @@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_JA], AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include <locale.h> #include <time.h> #if HAVE_LANGINFO_CODESET @@ -82,8 +81,7 @@ int main () return 0; #endif } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets diff --git a/gnulib/import/m4/locale-zh.m4 b/gnulib/import/m4/locale-zh.m4 index cde5140..1228be8 100644 --- a/gnulib/import/m4/locale-zh.m4 +++ b/gnulib/import/m4/locale-zh.m4 @@ -1,5 +1,5 @@ -# locale-zh.m4 serial 14 -dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc. +# locale-zh.m4 serial 15 +dnl Copyright (C) 2003, 2005-2021 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. @@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_ZH_CN], AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include <locale.h> #include <stdlib.h> #include <time.h> @@ -83,8 +82,7 @@ int main () return 0; #endif } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets diff --git a/gnulib/import/m4/locale_h.m4 b/gnulib/import/m4/locale_h.m4 index 32494cf..a95379a 100644 --- a/gnulib/import/m4/locale_h.m4 +++ b/gnulib/import/m4/locale_h.m4 @@ -1,5 +1,5 @@ # locale_h.m4 serial 24 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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. diff --git a/gnulib/import/m4/localtime-buffer.m4 b/gnulib/import/m4/localtime-buffer.m4 deleted file mode 100644 index 09df3c9..0000000 --- a/gnulib/import/m4/localtime-buffer.m4 +++ /dev/null @@ -1,21 +0,0 @@ -# localtime-buffer.m4 serial 1 -dnl Copyright (C) 2017-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. - -AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], -[ - NEED_LOCALTIME_BUFFER=0 -]) - -dnl Macro invoked from other modules, to signal that the compilation of -dnl module 'localtime-buffer' is needed. -AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], -[ - AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) - AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) - NEED_LOCALTIME_BUFFER=1 - REPLACE_GMTIME=1 - REPLACE_LOCALTIME=1 -]) diff --git a/gnulib/import/m4/lock.m4 b/gnulib/import/m4/lock.m4 index 1c39591..d68c12d 100644 --- a/gnulib/import/m4/lock.m4 +++ b/gnulib/import/m4/lock.m4 @@ -1,5 +1,5 @@ # lock.m4 serial 14 -dnl Copyright (C) 2005-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2021 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. diff --git a/gnulib/import/m4/lstat.m4 b/gnulib/import/m4/lstat.m4 index 3c2b214..62e9db2 100644 --- a/gnulib/import/m4/lstat.m4 +++ b/gnulib/import/m4/lstat.m4 @@ -1,6 +1,6 @@ # serial 33 -# Copyright (C) 1997-2001, 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/malloc.m4 b/gnulib/import/m4/malloc.m4 index c1f8ea3..514d19a 100644 --- a/gnulib/import/m4/malloc.m4 +++ b/gnulib/import/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 20 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# malloc.m4 serial 21 +dnl Copyright (C) 2007, 2009-2021 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. @@ -8,18 +8,12 @@ dnl with or without modifications, as long as this notice is preserved. # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_MALLOC_IF], [ - AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles - AC_CHECK_HEADERS([stdlib.h]) AC_CACHE_CHECK([for GNU libc compatible malloc], [ac_cv_func_malloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include <stdlib.h> - #else - char *malloc (); - #endif + [[#include <stdlib.h> ]], [[char *p = malloc (0); int result = !p; diff --git a/gnulib/import/m4/malloca.m4 b/gnulib/import/m4/malloca.m4 index 930199d..06ed2c6 100644 --- a/gnulib/import/m4/malloca.m4 +++ b/gnulib/import/m4/malloca.m4 @@ -1,5 +1,5 @@ # malloca.m4 serial 2 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/math_h.m4 b/gnulib/import/m4/math_h.m4 index 1d0169f..a9ba5e6 100644 --- a/gnulib/import/m4/math_h.m4 +++ b/gnulib/import/m4/math_h.m4 @@ -1,5 +1,5 @@ -# math_h.m4 serial 119 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# math_h.m4 serial 122 +dnl Copyright (C) 2007-2021 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. @@ -10,7 +10,7 @@ AC_DEFUN([gl_MATH_H], gl_CHECK_NEXT_HEADERS([math.h]) AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[/* Solaris 10 has a broken definition of NAN. Other platforms fail to provide NAN, or provide it only in C99 mode; this test only needs to fail when NAN is provided but wrong. */ @@ -25,7 +25,7 @@ AC_DEFUN([gl_MATH_H], REPLACE_NAN=1 fi AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[/* Solaris 10 has a broken definition of HUGE_VAL. */ double d = HUGE_VAL; return d == 0;]])], @@ -159,182 +159,189 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_J0=1; AC_SUBST([GNULIB_MDA_J0]) + GNULIB_MDA_J1=1; AC_SUBST([GNULIB_MDA_J1]) + GNULIB_MDA_JN=1; AC_SUBST([GNULIB_MDA_JN]) + GNULIB_MDA_Y0=1; AC_SUBST([GNULIB_MDA_Y0]) + GNULIB_MDA_Y1=1; AC_SUBST([GNULIB_MDA_Y1]) + GNULIB_MDA_YN=1; AC_SUBST([GNULIB_MDA_YN]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) - HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) - HAVE_ASINF=1; AC_SUBST([HAVE_ASINF]) - HAVE_ASINL=1; AC_SUBST([HAVE_ASINL]) - HAVE_ATANF=1; AC_SUBST([HAVE_ATANF]) - HAVE_ATANL=1; AC_SUBST([HAVE_ATANL]) - HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F]) - HAVE_CBRT=1; AC_SUBST([HAVE_CBRT]) - HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) - HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) - HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) - HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) - HAVE_COSF=1; AC_SUBST([HAVE_COSF]) - HAVE_COSL=1; AC_SUBST([HAVE_COSL]) - HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) - HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) - HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) - HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) - HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) - HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) - HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) - HAVE_FMA=1; AC_SUBST([HAVE_FMA]) - HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) - HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) - HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) - HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) - HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) - HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) - HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) - HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) - HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF]) - HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL]) - HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) - HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) - HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) - HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF]) - HAVE_LOGF=1; AC_SUBST([HAVE_LOGF]) - HAVE_LOGL=1; AC_SUBST([HAVE_LOGL]) - HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F]) - HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L]) - HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) - HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) - HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) - HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) - HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) - HAVE_MODFF=1; AC_SUBST([HAVE_MODFF]) - HAVE_MODFL=1; AC_SUBST([HAVE_MODFL]) - HAVE_POWF=1; AC_SUBST([HAVE_POWF]) - HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) - HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) - HAVE_RINT=1; AC_SUBST([HAVE_RINT]) - HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) - HAVE_SINF=1; AC_SUBST([HAVE_SINF]) - HAVE_SINL=1; AC_SUBST([HAVE_SINL]) - HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) - HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF]) - HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL]) - HAVE_TANF=1; AC_SUBST([HAVE_TANF]) - HAVE_TANL=1; AC_SUBST([HAVE_TANL]) - HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) - HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) - HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) - HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) - HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF]) - HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL]) - HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) - HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) - HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) - HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) - HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) - HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2]) - HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F]) - HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L]) - HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) - HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) - HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) - HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) - HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) - HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) - HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) - HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2]) - HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F]) - HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L]) - HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) - HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) - HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) - HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) - HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) - HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF]) - HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL]) - HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) - HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) - HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) - HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) - HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) - HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) - REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF]) - REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF]) - REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF]) - REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F]) - REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF]) - REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL]) - REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) - REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) - REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) - REPLACE_COSF=0; AC_SUBST([REPLACE_COSF]) - REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF]) - REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF]) - REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL]) - REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) - REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) - REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L]) - REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) - REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L]) - REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL]) - REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) - REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) - REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) - REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) - REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) - REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) - REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD]) - REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF]) - REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL]) - REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) - REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) - REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) - REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) - REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) - REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) - REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) - REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) - REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) - REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL]) - REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) - REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) - REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) - REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) - REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) - REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) - REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL]) - REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10]) - REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F]) - REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L]) - REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P]) - REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF]) - REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL]) - REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2]) - REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F]) - REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L]) - REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB]) - REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF]) - REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL]) - REPLACE_MODF=0; AC_SUBST([REPLACE_MODF]) - REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF]) - REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL]) - REPLACE_NAN=0; AC_SUBST([REPLACE_NAN]) - REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER]) - REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF]) - REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL]) - REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL]) - REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) - REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) - REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) - REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) - REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) - REPLACE_SINF=0; AC_SUBST([REPLACE_SINF]) - REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF]) - REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF]) - REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) - REPLACE_TANF=0; AC_SUBST([REPLACE_TANF]) - REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF]) - REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) - REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) - REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) + HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) + HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) + HAVE_ASINF=1; AC_SUBST([HAVE_ASINF]) + HAVE_ASINL=1; AC_SUBST([HAVE_ASINL]) + HAVE_ATANF=1; AC_SUBST([HAVE_ATANF]) + HAVE_ATANL=1; AC_SUBST([HAVE_ATANL]) + HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F]) + HAVE_CBRT=1; AC_SUBST([HAVE_CBRT]) + HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) + HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) + HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) + HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) + HAVE_COSF=1; AC_SUBST([HAVE_COSF]) + HAVE_COSL=1; AC_SUBST([HAVE_COSL]) + HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) + HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) + HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) + HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) + HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) + HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) + HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) + HAVE_FMA=1; AC_SUBST([HAVE_FMA]) + HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) + HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) + HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) + HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) + HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) + HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) + HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) + HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) + HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF]) + HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL]) + HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) + HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) + HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) + HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF]) + HAVE_LOGF=1; AC_SUBST([HAVE_LOGF]) + HAVE_LOGL=1; AC_SUBST([HAVE_LOGL]) + HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F]) + HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L]) + HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) + HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) + HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) + HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) + HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) + HAVE_MODFF=1; AC_SUBST([HAVE_MODFF]) + HAVE_MODFL=1; AC_SUBST([HAVE_MODFL]) + HAVE_POWF=1; AC_SUBST([HAVE_POWF]) + HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) + HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) + HAVE_RINT=1; AC_SUBST([HAVE_RINT]) + HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) + HAVE_SINF=1; AC_SUBST([HAVE_SINF]) + HAVE_SINL=1; AC_SUBST([HAVE_SINL]) + HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) + HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF]) + HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL]) + HAVE_TANF=1; AC_SUBST([HAVE_TANF]) + HAVE_TANL=1; AC_SUBST([HAVE_TANL]) + HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) + HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) + HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) + HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) + HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF]) + HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL]) + HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) + HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) + HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) + HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) + HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) + HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2]) + HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F]) + HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L]) + HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) + HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) + HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) + HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) + HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) + HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) + HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) + HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2]) + HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F]) + HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L]) + HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) + HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) + HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) + HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) + HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) + HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF]) + HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL]) + HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) + HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) + HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) + HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) + HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) + HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) + REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF]) + REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF]) + REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF]) + REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F]) + REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF]) + REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL]) + REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) + REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) + REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) + REPLACE_COSF=0; AC_SUBST([REPLACE_COSF]) + REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF]) + REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF]) + REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL]) + REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) + REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) + REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L]) + REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) + REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L]) + REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL]) + REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) + REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) + REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) + REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) + REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) + REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) + REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD]) + REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF]) + REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL]) + REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) + REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) + REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) + REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) + REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) + REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) + REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) + REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) + REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) + REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL]) + REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) + REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) + REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) + REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) + REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) + REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) + REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL]) + REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10]) + REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F]) + REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L]) + REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P]) + REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF]) + REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL]) + REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2]) + REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F]) + REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L]) + REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB]) + REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF]) + REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL]) + REPLACE_MODF=0; AC_SUBST([REPLACE_MODF]) + REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF]) + REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL]) + REPLACE_NAN=0; AC_SUBST([REPLACE_NAN]) + REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER]) + REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF]) + REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL]) + REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL]) + REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) + REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) + REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) + REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) + REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS]) + REPLACE_SINF=0; AC_SUBST([REPLACE_SINF]) + REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF]) + REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF]) + REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) + REPLACE_TANF=0; AC_SUBST([REPLACE_TANF]) + REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF]) + REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) + REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) + REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) ]) # gl_LONG_DOUBLE_VS_DOUBLE diff --git a/gnulib/import/m4/mbrtowc.m4 b/gnulib/import/m4/mbrtowc.m4 index 755f8c9..1d4e73d 100644 --- a/gnulib/import/m4/mbrtowc.m4 +++ b/gnulib/import/m4/mbrtowc.m4 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 37 -*- coding: utf-8 -*- -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2020 Free Software Foundation, +# mbrtowc.m4 serial 38 -*- coding: utf-8 -*- +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,15 +18,8 @@ AC_DEFUN([gl_FUNC_MBRTOWC], if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 AC_CHECK_DECLS([mbrtowc],,, [[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -]]) + #include <wchar.h> + ]]) if test $ac_cv_have_decl_mbrtowc = yes; then dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although dnl it does not have the function. Avoid a collision with gnulib's @@ -181,13 +174,6 @@ changequote([,])dnl [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -213,13 +199,6 @@ int main () [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -271,13 +250,6 @@ changequote([,])dnl #include <locale.h> #include <stdlib.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -331,13 +303,6 @@ changequote([,])dnl #include <locale.h> #include <stdlib.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -400,13 +365,6 @@ changequote([,])dnl [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -462,13 +420,6 @@ changequote([,])dnl [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -590,13 +541,6 @@ changequote([,])dnl [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -644,13 +588,6 @@ changequote([,])dnl [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -708,13 +645,6 @@ int main () [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { @@ -845,14 +775,7 @@ AC_DEFUN([AC_FUNC_MBRTOWC], [gl_cv_func_mbrtowc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be - included before <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> - must be included before <wchar.h>. */ - #include <stddef.h> - #include <stdio.h> - #include <time.h> - #include <wchar.h>]], + [[#include <wchar.h>]], [[wchar_t wc; char const s[] = ""; size_t n = 1; diff --git a/gnulib/import/m4/mbsinit.m4 b/gnulib/import/m4/mbsinit.m4 index 8c26b6b..dc6e10d 100644 --- a/gnulib/import/m4/mbsinit.m4 +++ b/gnulib/import/m4/mbsinit.m4 @@ -1,5 +1,5 @@ -# mbsinit.m4 serial 8 -dnl Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc. +# mbsinit.m4 serial 9 +dnl Copyright (C) 2008, 2010-2021 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. @@ -16,15 +16,8 @@ AC_DEFUN([gl_FUNC_MBSINIT], if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 AC_CHECK_DECLS([mbsinit],,, [[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -]]) + #include <wchar.h> + ]]) if test $ac_cv_have_decl_mbsinit = yes; then dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although dnl it does not have the function. Avoid a collision with gnulib's diff --git a/gnulib/import/m4/mbsrtowcs.m4 b/gnulib/import/m4/mbsrtowcs.m4 index e0bc229..cf8e962 100644 --- a/gnulib/import/m4/mbsrtowcs.m4 +++ b/gnulib/import/m4/mbsrtowcs.m4 @@ -1,5 +1,5 @@ -# mbsrtowcs.m4 serial 13 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# mbsrtowcs.m4 serial 14 +dnl Copyright (C) 2008-2021 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. @@ -15,15 +15,8 @@ AC_DEFUN([gl_FUNC_MBSRTOWCS], if test $ac_cv_func_mbsrtowcs = no; then HAVE_MBSRTOWCS=0 AC_CHECK_DECLS([mbsrtowcs],,, [[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -]]) + #include <wchar.h> + ]]) if test $ac_cv_have_decl_mbsrtowcs = yes; then dnl On Minix 3.1.8, the system's <wchar.h> declares mbsrtowcs() although dnl it does not have the function. Avoid a collision with gnulib's @@ -72,13 +65,6 @@ changequote([,])dnl [AC_LANG_SOURCE([[ #include <locale.h> #include <string.h> -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> #include <wchar.h> int main () { diff --git a/gnulib/import/m4/mbstate_t.m4 b/gnulib/import/m4/mbstate_t.m4 index 057ce12..e7fe358 100644 --- a/gnulib/import/m4/mbstate_t.m4 +++ b/gnulib/import/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 13 -dnl Copyright (C) 2000-2002, 2008-2020 Free Software Foundation, Inc. +# mbstate_t.m4 serial 14 +dnl Copyright (C) 2000-2002, 2008-2021 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. @@ -20,14 +20,7 @@ AC_DEFUN([AC_TYPE_MBSTATE_T], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h>]], + #include <wchar.h>]], [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) diff --git a/gnulib/import/m4/mbtowc.m4 b/gnulib/import/m4/mbtowc.m4 index befcffa..7fc74c9 100644 --- a/gnulib/import/m4/mbtowc.m4 +++ b/gnulib/import/m4/mbtowc.m4 @@ -1,5 +1,5 @@ # mbtowc.m4 serial 3 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/memchr.m4 b/gnulib/import/m4/memchr.m4 index 91eec88..64470de 100644 --- a/gnulib/import/m4/memchr.m4 +++ b/gnulib/import/m4/memchr.m4 @@ -1,5 +1,5 @@ -# memchr.m4 serial 15 -dnl Copyright (C) 2002-2004, 2009-2020 Free Software Foundation, Inc. +# memchr.m4 serial 17 +dnl Copyright (C) 2002-2004, 2009-2021 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. @@ -14,26 +14,17 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], AC_CHECK_FUNCS_ONCE([mprotect]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ - dnl These days, we assume memchr is present. But if support for old - dnl platforms is desired: - AC_CHECK_FUNCS_ONCE([memchr]) - if test $ac_cv_func_memchr = no; then - HAVE_MEMCHR=0 - fi - ]) - if test $HAVE_MEMCHR = 1; then - # Detect platform-specific bugs in some versions of glibc: - # memchr should not dereference anything with length 0 - # https://bugzilla.redhat.com/show_bug.cgi?id=499689 - # memchr should not dereference overestimated length after a match - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 - # memchr should cast the second argument to 'unsigned char'. - # This bug exists in Android 4.3. - # Assume that memchr works on platforms that lack mprotect. - AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # https://bugzilla.redhat.com/show_bug.cgi?id=499689 + # memchr should not dereference overestimated length after a match + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # memchr should cast the second argument to 'unsigned char'. + # This bug exists in Android 4.3. + # Assume that memchr works on platforms that lack mprotect. + AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> #if HAVE_SYS_MMAN_H # include <fcntl.h> @@ -68,6 +59,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], #endif if (fence) { + /* Test against bugs on glibc systems. */ if (memchr (fence, 0, 0)) result |= 1; strcpy (fence - 9, "12345678"); @@ -75,6 +67,9 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], result |= 2; if (memchr (fence - 1, 0, 3) != fence - 1) result |= 4; + /* Test against bug on AIX 7.2. */ + if (memchr (fence - 4, '6', 16) != fence - 4) + result |= 8; } /* Test against bug on Android 4.3. */ { @@ -83,27 +78,26 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], input[1] = 'b'; input[2] = 'c'; if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) - result |= 8; + result |= 16; } return result; ]])], - [gl_cv_func_memchr_works=yes], - [gl_cv_func_memchr_works=no], - [case "$host_os" in - # Guess no on Android. - linux*-android*) gl_cv_func_memchr_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_memchr_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; - esac - ]) - ]) - case "$gl_cv_func_memchr_works" in - *yes) ;; - *) REPLACE_MEMCHR=1 ;; - esac - fi + [gl_cv_func_memchr_works=yes], + [gl_cv_func_memchr_works=no], + [case "$host_os" in + # Guess no on Android. + linux*-android*) gl_cv_func_memchr_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_memchr_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; + esac + ]) + ]) + case "$gl_cv_func_memchr_works" in + *yes) ;; + *) REPLACE_MEMCHR=1 ;; + esac ]) # Prerequisites of lib/memchr.c. diff --git a/gnulib/import/m4/memmem.m4 b/gnulib/import/m4/memmem.m4 index 35a5bb1..e2a785f 100644 --- a/gnulib/import/m4/memmem.m4 +++ b/gnulib/import/m4/memmem.m4 @@ -1,5 +1,5 @@ # memmem.m4 serial 27 -dnl Copyright (C) 2002-2004, 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2021 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. diff --git a/gnulib/import/m4/mempcpy.m4 b/gnulib/import/m4/mempcpy.m4 index 899f12a..c5ee2af 100644 --- a/gnulib/import/m4/mempcpy.m4 +++ b/gnulib/import/m4/mempcpy.m4 @@ -1,5 +1,5 @@ # mempcpy.m4 serial 11 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/memrchr.m4 b/gnulib/import/m4/memrchr.m4 index 95990ed..d0c0589 100644 --- a/gnulib/import/m4/memrchr.m4 +++ b/gnulib/import/m4/memrchr.m4 @@ -1,5 +1,5 @@ # memrchr.m4 serial 10 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/minmax.m4 b/gnulib/import/m4/minmax.m4 index e5b28b0..e21a687 100644 --- a/gnulib/import/m4/minmax.m4 +++ b/gnulib/import/m4/minmax.m4 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2021 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. diff --git a/gnulib/import/m4/mkdir.m4 b/gnulib/import/m4/mkdir.m4 index 99212d9..031fd29 100644 --- a/gnulib/import/m4/mkdir.m4 +++ b/gnulib/import/m4/mkdir.m4 @@ -1,6 +1,6 @@ -# serial 16 +# serial 17 -# Copyright (C) 2001, 2003-2004, 2006, 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,33 +16,34 @@ AC_DEFUN([gl_FUNC_MKDIR], AC_CACHE_CHECK([whether mkdir handles trailing slash], [gl_cv_func_mkdir_trailing_slash_works], [rm -rf conftest.dir - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ -# include <sys/types.h> -# include <sys/stat.h> -]], [return mkdir ("conftest.dir/", 0700);])], - [gl_cv_func_mkdir_trailing_slash_works=yes], - [gl_cv_func_mkdir_trailing_slash_works=no], - [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; - # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ + #include <sys/types.h> + #include <sys/stat.h> + ]GL_MDA_DEFINES], + [[return mkdir ("conftest.dir/", 0700);]])], + [gl_cv_func_mkdir_trailing_slash_works=yes], + [gl_cv_func_mkdir_trailing_slash_works=no], + [case "$host_os" in + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif - ], - [gl_cv_func_mkdir_trailing_slash_works="guessing yes"], - [gl_cv_func_mkdir_trailing_slash_works="guessing no"]) - ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; - esac - ]) - rm -rf conftest.dir - ] - ) + ], + [gl_cv_func_mkdir_trailing_slash_works="guessing yes"], + [gl_cv_func_mkdir_trailing_slash_works="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; + esac + ]) + rm -rf conftest.dir + ]) case "$gl_cv_func_mkdir_trailing_slash_works" in *yes) ;; *) @@ -53,24 +54,26 @@ AC_DEFUN([gl_FUNC_MKDIR], AC_CACHE_CHECK([whether mkdir handles trailing dot], [gl_cv_func_mkdir_trailing_dot_works], [rm -rf conftest.dir - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ -# include <sys/types.h> -# include <sys/stat.h> -]], [return !mkdir ("conftest.dir/./", 0700);])], - [gl_cv_func_mkdir_trailing_dot_works=yes], - [gl_cv_func_mkdir_trailing_dot_works=no], - [case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; - # Guess yes on musl systems. - *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; - esac - ]) - rm -rf conftest.dir + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ + #include <sys/types.h> + #include <sys/stat.h> + ]GL_MDA_DEFINES], + [[return !mkdir ("conftest.dir/./", 0700);]])], + [gl_cv_func_mkdir_trailing_dot_works=yes], + [gl_cv_func_mkdir_trailing_dot_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; + # Guess yes on musl systems. + *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; + esac + ]) + rm -rf conftest.dir ] ) case "$gl_cv_func_mkdir_trailing_dot_works" in diff --git a/gnulib/import/m4/mkdtemp.m4 b/gnulib/import/m4/mkdtemp.m4 index da7b2ac..9f4816c 100644 --- a/gnulib/import/m4/mkdtemp.m4 +++ b/gnulib/import/m4/mkdtemp.m4 @@ -1,5 +1,5 @@ # mkdtemp.m4 serial 8 -dnl Copyright (C) 2001-2003, 2006-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2001-2003, 2006-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/mkostemp.m4 b/gnulib/import/m4/mkostemp.m4 index 3e5b555..46534d4 100644 --- a/gnulib/import/m4/mkostemp.m4 +++ b/gnulib/import/m4/mkostemp.m4 @@ -1,5 +1,5 @@ # mkostemp.m4 serial 2 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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. diff --git a/gnulib/import/m4/mmap-anon.m4 b/gnulib/import/m4/mmap-anon.m4 index d5c69df..5a9f968 100644 --- a/gnulib/import/m4/mmap-anon.m4 +++ b/gnulib/import/m4/mmap-anon.m4 @@ -1,5 +1,5 @@ -# mmap-anon.m4 serial 10 -dnl Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. +# mmap-anon.m4 serial 11 +dnl Copyright (C) 2005, 2007, 2009-2021 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. @@ -9,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved. # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS # and MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. -# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. +# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists. # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be # used. diff --git a/gnulib/import/m4/mode_t.m4 b/gnulib/import/m4/mode_t.m4 index f190951..3bd4b89 100644 --- a/gnulib/import/m4/mode_t.m4 +++ b/gnulib/import/m4/mode_t.m4 @@ -1,5 +1,5 @@ # mode_t.m4 serial 2 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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. diff --git a/gnulib/import/m4/msvc-inval.m4 b/gnulib/import/m4/msvc-inval.m4 index dcf398d..3ba5b4e 100644 --- a/gnulib/import/m4/msvc-inval.m4 +++ b/gnulib/import/m4/msvc-inval.m4 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/msvc-nothrow.m4 b/gnulib/import/m4/msvc-nothrow.m4 index 13198d8..aae25ce 100644 --- a/gnulib/import/m4/msvc-nothrow.m4 +++ b/gnulib/import/m4/msvc-nothrow.m4 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/multiarch.m4 b/gnulib/import/m4/multiarch.m4 index 3c2034c..f1678d9 100644 --- a/gnulib/import/m4/multiarch.m4 +++ b/gnulib/import/m4/multiarch.m4 @@ -1,5 +1,5 @@ -# multiarch.m4 serial 7 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# multiarch.m4 serial 9 +dnl Copyright (C) 2008-2021 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. @@ -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/gnulib/import/m4/netinet_in_h.m4 b/gnulib/import/m4/netinet_in_h.m4 index df9f383..c555596 100644 --- a/gnulib/import/m4/netinet_in_h.m4 +++ b/gnulib/import/m4/netinet_in_h.m4 @@ -1,5 +1,5 @@ # netinet_in_h.m4 serial 5 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2021 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. diff --git a/gnulib/import/m4/nocrash.m4 b/gnulib/import/m4/nocrash.m4 index 637a0ea..27412cd 100644 --- a/gnulib/import/m4/nocrash.m4 +++ b/gnulib/import/m4/nocrash.m4 @@ -1,5 +1,5 @@ # nocrash.m4 serial 5 -dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2021 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. diff --git a/gnulib/import/m4/off_t.m4 b/gnulib/import/m4/off_t.m4 index 6e19af8..bdec43c 100644 --- a/gnulib/import/m4/off_t.m4 +++ b/gnulib/import/m4/off_t.m4 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2021 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. diff --git a/gnulib/import/m4/open-cloexec.m4 b/gnulib/import/m4/open-cloexec.m4 index 11652d5..542a90f 100644 --- a/gnulib/import/m4/open-cloexec.m4 +++ b/gnulib/import/m4/open-cloexec.m4 @@ -1,6 +1,6 @@ # Test whether O_CLOEXEC is defined. -dnl Copyright 2017-2020 Free Software Foundation, Inc. +dnl Copyright 2017-2021 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. diff --git a/gnulib/import/m4/open-slash.m4 b/gnulib/import/m4/open-slash.m4 index 1e57c96..e619039 100644 --- a/gnulib/import/m4/open-slash.m4 +++ b/gnulib/import/m4/open-slash.m4 @@ -1,5 +1,5 @@ -# open-slash.m4 serial 1 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# open-slash.m4 serial 2 +dnl Copyright (C) 2007-2021 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. @@ -25,6 +25,7 @@ AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG], #if HAVE_UNISTD_H # include <unistd.h> #endif +]GL_MDA_DEFINES[ int main () { int result = 0; diff --git a/gnulib/import/m4/open.m4 b/gnulib/import/m4/open.m4 index 552eedf..c634386 100644 --- a/gnulib/import/m4/open.m4 +++ b/gnulib/import/m4/open.m4 @@ -1,5 +1,5 @@ # open.m4 serial 15 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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. diff --git a/gnulib/import/m4/openat.m4 b/gnulib/import/m4/openat.m4 index cf9f717..eba0f51 100644 --- a/gnulib/import/m4/openat.m4 +++ b/gnulib/import/m4/openat.m4 @@ -1,7 +1,7 @@ # serial 46 # See if we need to use our replacement for Solaris' openat et al functions. -dnl Copyright (C) 2004-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2021 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. diff --git a/gnulib/import/m4/opendir.m4 b/gnulib/import/m4/opendir.m4 index fd3c1ec..517edae 100644 --- a/gnulib/import/m4/opendir.m4 +++ b/gnulib/import/m4/opendir.m4 @@ -1,5 +1,5 @@ # opendir.m4 serial 5 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/pathmax.m4 b/gnulib/import/m4/pathmax.m4 index bb4fdeb..e67c656 100644 --- a/gnulib/import/m4/pathmax.m4 +++ b/gnulib/import/m4/pathmax.m4 @@ -1,5 +1,5 @@ # pathmax.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/pid_t.m4 b/gnulib/import/m4/pid_t.m4 new file mode 100644 index 0000000..b7650a1 --- /dev/null +++ b/gnulib/import/m4/pid_t.m4 @@ -0,0 +1,38 @@ +# pid_t.m4 serial 4 +dnl Copyright (C) 2020-2021 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. + +# The following implementation works around a problem in autoconf <= 2.69. +m4_version_prereq([2.70], [], [ + +dnl Define pid_t if the headers don't define it. +AC_DEFUN([AC_TYPE_PID_T], +[ + AC_CHECK_TYPE([pid_t], + [], + [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t' + dnl (= 'long long' = '__int64'), because that is the return type + dnl of the _spawnv* functions + dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvp-wspawnvp> + dnl and the argument type of the _cwait function + dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait>. + dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it + dnl to 'int'. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + ]]) + ], + [gl_pid_type='int'], + [gl_pid_type='__int64']) + AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type], + [Define as a signed integer type capable of holding a process identifier.]) + ], + [AC_INCLUDES_DEFAULT]) +]) + +])# m4_version_prereq 2.70 diff --git a/gnulib/import/m4/pipe.m4 b/gnulib/import/m4/pipe.m4 new file mode 100644 index 0000000..89d666d --- /dev/null +++ b/gnulib/import/m4/pipe.m4 @@ -0,0 +1,15 @@ +# pipe.m4 serial 2 +dnl Copyright (C) 2010-2021 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. + +AC_DEFUN([gl_FUNC_PIPE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([pipe]) + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi +]) diff --git a/gnulib/import/m4/pthread_rwlock_rdlock.m4 b/gnulib/import/m4/pthread_rwlock_rdlock.m4 index 049af50..a5fbead 100644 --- a/gnulib/import/m4/pthread_rwlock_rdlock.m4 +++ b/gnulib/import/m4/pthread_rwlock_rdlock.m4 @@ -1,5 +1,5 @@ # pthread_rwlock_rdlock.m4 serial 4 -dnl Copyright (C) 2017-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2017-2021 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. diff --git a/gnulib/import/m4/rawmemchr.m4 b/gnulib/import/m4/rawmemchr.m4 index c5bf041..f928465 100644 --- a/gnulib/import/m4/rawmemchr.m4 +++ b/gnulib/import/m4/rawmemchr.m4 @@ -1,5 +1,5 @@ # rawmemchr.m4 serial 2 -dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2021 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. diff --git a/gnulib/import/m4/readdir.m4 b/gnulib/import/m4/readdir.m4 index ca4e741..94dc99c 100644 --- a/gnulib/import/m4/readdir.m4 +++ b/gnulib/import/m4/readdir.m4 @@ -1,5 +1,5 @@ # readdir.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/readlink.m4 b/gnulib/import/m4/readlink.m4 index 9aa9e46..352788c 100644 --- a/gnulib/import/m4/readlink.m4 +++ b/gnulib/import/m4/readlink.m4 @@ -1,5 +1,5 @@ -# readlink.m4 serial 15 -dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc. +# readlink.m4 serial 16 +dnl Copyright (C) 2003, 2007, 2009-2021 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. @@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_READLINK], dnl Solaris 9 ignores trailing slash. dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. AC_CACHE_CHECK([whether readlink handles trailing slash correctly], - [gl_cv_func_readlink_works], + [gl_cv_func_readlink_trailing_slash], [# We have readlink, so assume ln -s works. ln -s conftest.no-such conftest.link ln -s conftest.link conftest.lnk2 @@ -32,18 +32,22 @@ AC_DEFUN([gl_FUNC_READLINK], [[#include <unistd.h> ]], [[char buf[20]; return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], - [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], + [gl_cv_func_readlink_trailing_slash=yes], + [gl_cv_func_readlink_trailing_slash=no], [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux or glibc systems. + linux-* | linux | *-gnu* | gnu*) + gl_cv_func_readlink_trailing_slash="guessing yes" ;; + # Guess no on AIX or HP-UX. + aix* | hpux*) + gl_cv_func_readlink_trailing_slash="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) + gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.link conftest.lnk2]) - case "$gl_cv_func_readlink_works" in + case "$gl_cv_func_readlink_trailing_slash" in *yes) if test "$gl_cv_decl_readlink_works" != yes; then REPLACE_READLINK=1 @@ -55,6 +59,43 @@ AC_DEFUN([gl_FUNC_READLINK], REPLACE_READLINK=1 ;; esac + + AC_CACHE_CHECK([whether readlink truncates results correctly], + [gl_cv_func_readlink_truncate], + [# We have readlink, so assume ln -s works. + ln -s ab conftest.link + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> +]], [[char c; + return readlink ("conftest.link", &c, 1) != 1;]])], + [gl_cv_func_readlink_truncate=yes], + [gl_cv_func_readlink_truncate=no], + [case "$host_os" in + # Guess yes on Linux or glibc systems. + linux-* | linux | *-gnu* | gnu*) + gl_cv_func_readlink_truncate="guessing yes" ;; + # Guess no on AIX or HP-UX. + aix* | hpux*) + gl_cv_func_readlink_truncate="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) + gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;; + esac + ]) + rm -f conftest.link conftest.lnk2]) + case $gl_cv_func_readlink_truncate in + *yes) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + fi + ;; + *) + AC_DEFINE([READLINK_TRUNCATE_BUG], [1], [Define to 1 if readlink + sets errno instead of truncating a too-long link.]) + REPLACE_READLINK=1 + ;; + esac fi ]) diff --git a/gnulib/import/m4/realloc.m4 b/gnulib/import/m4/realloc.m4 index 85b8f87..6f4461d 100644 --- a/gnulib/import/m4/realloc.m4 +++ b/gnulib/import/m4/realloc.m4 @@ -1,5 +1,5 @@ -# realloc.m4 serial 18 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# realloc.m4 serial 19 +dnl Copyright (C) 2007, 2009-2021 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. @@ -8,18 +8,12 @@ dnl with or without modifications, as long as this notice is preserved. # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_REALLOC_IF], [ - AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles - AC_CHECK_HEADERS([stdlib.h]) AC_CACHE_CHECK([for GNU libc compatible realloc], [ac_cv_func_realloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include <stdlib.h> - #else - char *realloc (); - #endif + [[#include <stdlib.h> ]], [[char *p = realloc (0, 0); int result = !p; diff --git a/gnulib/import/m4/rename.m4 b/gnulib/import/m4/rename.m4 index a1bd705..8a95b8a 100644 --- a/gnulib/import/m4/rename.m4 +++ b/gnulib/import/m4/rename.m4 @@ -1,6 +1,6 @@ -# serial 32 +# serial 33 -# Copyright (C) 2001, 2003, 2005-2006, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005-2006, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -150,7 +150,7 @@ AC_DEFUN([gl_FUNC_RENAME], # include <stdio.h> # include <stdlib.h> # include <unistd.h> - ]], + ]GL_MDA_DEFINES], [[int result = 0; if (rename ("conftest.f", "conftest.f1")) result |= 1; diff --git a/gnulib/import/m4/rewinddir.m4 b/gnulib/import/m4/rewinddir.m4 index 51f476b..ed25456 100644 --- a/gnulib/import/m4/rewinddir.m4 +++ b/gnulib/import/m4/rewinddir.m4 @@ -1,5 +1,5 @@ # rewinddir.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/rmdir.m4 b/gnulib/import/m4/rmdir.m4 index ad1b192..82b9ccc 100644 --- a/gnulib/import/m4/rmdir.m4 +++ b/gnulib/import/m4/rmdir.m4 @@ -1,5 +1,5 @@ -# rmdir.m4 serial 17 -dnl Copyright (C) 2002, 2005, 2009-2020 Free Software Foundation, Inc. +# rmdir.m4 serial 18 +dnl Copyright (C) 2002, 2005, 2009-2021 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. @@ -22,15 +22,16 @@ AC_DEFUN([gl_FUNC_RMDIR], #else /* on Windows with MSVC */ # include <direct.h> #endif -]], [[int result = 0; - if (!rmdir ("conftest.file/")) - result |= 1; - else if (errno != ENOTDIR) - result |= 2; - if (!rmdir ("conftest.dir/./")) - result |= 4; - return result; - ]])], + ]GL_MDA_DEFINES], + [[int result = 0; + if (!rmdir ("conftest.file/")) + result |= 1; + else if (errno != ENOTDIR) + result |= 2; + if (!rmdir ("conftest.dir/./")) + result |= 4; + return result; + ]])], [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no], [case "$host_os" in # Guess yes on Linux systems. diff --git a/gnulib/import/m4/save-cwd.m4 b/gnulib/import/m4/save-cwd.m4 index a401b1f..74cfe96 100644 --- a/gnulib/import/m4/save-cwd.m4 +++ b/gnulib/import/m4/save-cwd.m4 @@ -1,5 +1,5 @@ # serial 10 -dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2021 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. diff --git a/gnulib/import/m4/setenv.m4 b/gnulib/import/m4/setenv.m4 index ef03673..f79a278 100644 --- a/gnulib/import/m4/setenv.m4 +++ b/gnulib/import/m4/setenv.m4 @@ -1,5 +1,5 @@ -# setenv.m4 serial 29 -dnl Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc. +# setenv.m4 serial 30 +dnl Copyright (C) 2001-2004, 2006-2021 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. @@ -106,35 +106,39 @@ int unsetenv (const char *name); dnl OpenBSD 4.7 unsetenv("") does not fail. AC_CACHE_CHECK([whether unsetenv obeys POSIX], [gl_cv_func_unsetenv_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ - #include <stdlib.h> - #include <errno.h> - extern char **environ; - ]], [[ - char entry1[] = "a=1"; - char entry2[] = "b=2"; - char *env[] = { entry1, entry2, NULL }; - if (putenv ((char *) "a=1")) return 1; - if (putenv (entry2)) return 2; - entry2[0] = 'a'; - unsetenv ("a"); - if (getenv ("a")) return 3; - if (!unsetenv ("") || errno != EINVAL) return 4; - entry2[0] = 'b'; - environ = env; - if (!getenv ("a")) return 5; - entry2[0] = 'a'; - unsetenv ("a"); - if (getenv ("a")) return 6; - ]])], - [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no], - [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;; - esac - ])]) + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ + #include <stdlib.h> + #include <errno.h> + extern char **environ; + ]GL_MDA_DEFINES], + [[ + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + ]])], + [gl_cv_func_unsetenv_works=yes], + [gl_cv_func_unsetenv_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;; + esac + ]) + ]) case "$gl_cv_func_unsetenv_works" in *yes) ;; *) diff --git a/gnulib/import/m4/setlocale_null.m4 b/gnulib/import/m4/setlocale_null.m4 index c1ee1f7..c486ca8 100644 --- a/gnulib/import/m4/setlocale_null.m4 +++ b/gnulib/import/m4/setlocale_null.m4 @@ -1,5 +1,5 @@ -# setlocale_null.m4 serial 2 -dnl Copyright (C) 2019-2020 Free Software Foundation, Inc. +# setlocale_null.m4 serial 4 +dnl Copyright (C) 2019-2021 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. diff --git a/gnulib/import/m4/signal_h.m4 b/gnulib/import/m4/signal_h.m4 index b262980..ff9f025 100644 --- a/gnulib/import/m4/signal_h.m4 +++ b/gnulib/import/m4/signal_h.m4 @@ -1,5 +1,5 @@ # signal_h.m4 serial 19 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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. diff --git a/gnulib/import/m4/socklen.m4 b/gnulib/import/m4/socklen.m4 index 251960b..eca1d1b 100644 --- a/gnulib/import/m4/socklen.m4 +++ b/gnulib/import/m4/socklen.m4 @@ -1,5 +1,5 @@ # socklen.m4 serial 11 -dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2021 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. diff --git a/gnulib/import/m4/sockpfaf.m4 b/gnulib/import/m4/sockpfaf.m4 index 495a355..edae5d8 100644 --- a/gnulib/import/m4/sockpfaf.m4 +++ b/gnulib/import/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ # sockpfaf.m4 serial 9 -dnl Copyright (C) 2004, 2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2021 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. diff --git a/gnulib/import/m4/ssize_t.m4 b/gnulib/import/m4/ssize_t.m4 index 6c0a588..f0ed509 100644 --- a/gnulib/import/m4/ssize_t.m4 +++ b/gnulib/import/m4/ssize_t.m4 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2021 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. diff --git a/gnulib/import/m4/stat-time.m4 b/gnulib/import/m4/stat-time.m4 index 0ac3f72..df1c2a7 100644 --- a/gnulib/import/m4/stat-time.m4 +++ b/gnulib/import/m4/stat-time.m4 @@ -1,6 +1,6 @@ # Checks for stat-related time functions. -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2020 Free Software +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2021 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation diff --git a/gnulib/import/m4/stat.m4 b/gnulib/import/m4/stat.m4 index 8ef355f..08cdbea 100644 --- a/gnulib/import/m4/stat.m4 +++ b/gnulib/import/m4/stat.m4 @@ -1,6 +1,6 @@ -# serial 16 +# serial 17 -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -70,5 +70,16 @@ AC_DEFUN([gl_FUNC_STAT], # Prerequisites of lib/stat.c and lib/stat-w32.c. AC_DEFUN([gl_PREREQ_STAT], [ AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + AC_REQUIRE([gl_PREREQ_STAT_W32]) : ]) + +# Prerequisites of lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_STAT_W32], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_CHECK_HEADERS([sdkddkver.h]) + ;; + esac +]) diff --git a/gnulib/import/m4/std-gnu11.m4 b/gnulib/import/m4/std-gnu11.m4 index c1ec624..7b1a042 100644 --- a/gnulib/import/m4/std-gnu11.m4 +++ b/gnulib/import/m4/std-gnu11.m4 @@ -6,8 +6,10 @@ # This implementation will be obsolete once we can assume Autoconf 2.70 # or later is installed everywhere a Gnulib program might be developed. +m4_version_prereq([2.70], [], [ -# Copyright (C) 2001-2020 Free Software Foundation, Inc. + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -70,7 +72,7 @@ _AS_ECHO_LOG([checking for _AC_LANG compiler version]) set X $ac_compile ac_compiler=$[2] for ac_option in --version -v -V -qversion -version; do - m4_ifdef([_AC_DO_LIMIT],[_AC_DO_LIMIT],[_AC_DO])([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) done m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl @@ -135,7 +137,7 @@ _AS_ECHO_LOG([checking for _AC_LANG compiler version]) set X $ac_compile ac_compiler=$[2] for ac_option in --version -v -V -qversion; do - m4_ifdef([_AC_DO_LIMIT],[_AC_DO_LIMIT],[_AC_DO])([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) done m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl @@ -822,3 +824,6 @@ dnl Tru64 N/A (no support) dnl with extended modes being tried first. [[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl ])# _AC_PROG_CXX_CXX11 + + +])# m4_version_prereq diff --git a/gnulib/import/m4/stdalign.m4 b/gnulib/import/m4/stdalign.m4 index dcf778e..8dcb634 100644 --- a/gnulib/import/m4/stdalign.m4 +++ b/gnulib/import/m4/stdalign.m4 @@ -1,6 +1,6 @@ # Check for stdalign.h that conforms to C11. -dnl Copyright 2011-2020 Free Software Foundation, Inc. +dnl Copyright 2011-2021 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. diff --git a/gnulib/import/m4/stdbool.m4 b/gnulib/import/m4/stdbool.m4 index 6bb087e..3169779 100644 --- a/gnulib/import/m4/stdbool.m4 +++ b/gnulib/import/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2021 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. diff --git a/gnulib/import/m4/stddef_h.m4 b/gnulib/import/m4/stddef_h.m4 index 6bcfadb..cd666c4 100644 --- a/gnulib/import/m4/stddef_h.m4 +++ b/gnulib/import/m4/stddef_h.m4 @@ -1,14 +1,19 @@ -dnl A placeholder for <stddef.h>, for platforms that have issues. -# stddef_h.m4 serial 6 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +# stddef_h.m4 serial 9 +dnl Copyright (C) 2009-2021 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 A placeholder for <stddef.h>, for platforms that have issues. + AC_DEFUN([gl_STDDEF_H], [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) + + dnl Persuade OpenBSD <stddef.h> to declare max_align_t. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + STDDEF_H= dnl Test whether the type max_align_t exists and whether its alignment @@ -19,10 +24,17 @@ AC_DEFUN([gl_STDDEF_H], [AC_LANG_PROGRAM( [[#include <stddef.h> unsigned int s = sizeof (max_align_t); - #if defined __GNUC__ || defined __IBM__ALIGNOF__ + #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; #endif + typedef struct { char a; max_align_t b; } max_helper; + typedef struct { char a; long b; } long_helper; + typedef struct { char a; double b; } double_helper; + typedef struct { char a; long double b; } long_double_helper; + int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; + int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; + int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; ]])], [gl_cv_type_max_align_t=yes], [gl_cv_type_max_align_t=no]) diff --git a/gnulib/import/m4/stdint.m4 b/gnulib/import/m4/stdint.m4 index 29ad826..a785b44 100644 --- a/gnulib/import/m4/stdint.m4 +++ b/gnulib/import/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 54 -dnl Copyright (C) 2001-2020 Free Software Foundation, Inc. +# stdint.m4 serial 58 +dnl Copyright (C) 2001-2021 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. @@ -34,7 +34,7 @@ AC_DEFUN_ONCE([gl_STDINT_H], AC_SUBST([HAVE_WCHAR_H]) dnl Check for <inttypes.h>. - dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + AC_CHECK_HEADERS_ONCE([inttypes.h]) if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else @@ -43,7 +43,7 @@ AC_DEFUN_ONCE([gl_STDINT_H], AC_SUBST([HAVE_INTTYPES_H]) dnl Check for <sys/types.h>. - dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. + AC_CHECK_HEADERS_ONCE([sys/types.h]) if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else @@ -152,7 +152,7 @@ uintmax_t j = UINTMAX_MAX; /* Check that SIZE_MAX has the correct type, if possible. */ #if 201112 <= __STDC_VERSION__ int k = _Generic (SIZE_MAX, size_t: 0); -#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ +#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ || (0x5110 <= __SUNPRO_C && !__STDC__)) extern size_t k; extern __typeof__ (SIZE_MAX) k; @@ -302,9 +302,10 @@ static const char *macro_values[] = HAVE_C99_STDINT_H=1 dnl Now see whether the system <stdint.h> works without dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. - AC_CACHE_CHECK([whether stdint.h predates C++11], - [gl_cv_header_stdint_predates_cxx11_h], - [gl_cv_header_stdint_predates_cxx11_h=yes + dnl If not, there would be problems when stdint.h is included from C++. + AC_CACHE_CHECK([whether stdint.h works without ISO C predefines], + [gl_cv_header_stdint_without_STDC_macros], + [gl_cv_header_stdint_without_STDC_macros=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ @@ -315,13 +316,14 @@ gl_STDINT_INCLUDES intmax_t im = INTMAX_MAX; int32_t i32 = INT32_C (0x7fffffff); ]])], - [gl_cv_header_stdint_predates_cxx11_h=no])]) + [gl_cv_header_stdint_without_STDC_macros=yes]) + ]) - if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + if test $gl_cv_header_stdint_without_STDC_macros = no; then AC_DEFINE([__STDC_CONSTANT_MACROS], [1], - [Define to 1 if the system <stdint.h> predates C++11.]) + [Define to 1 if the system <stdint.h> predates C++11.]) AC_DEFINE([__STDC_LIMIT_MACROS], [1], - [Define to 1 if the system <stdint.h> predates C++11.]) + [Define to 1 if the system <stdint.h> predates C++11.]) fi AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], [gl_cv_header_stdint_width], @@ -491,13 +493,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ #include <stddef.h> #include <signal.h> #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> # include <wchar.h> #endif ]]) diff --git a/gnulib/import/m4/stdio_h.m4 b/gnulib/import/m4/stdio_h.m4 index 5f968bc..4c3f24a 100644 --- a/gnulib/import/m4/stdio_h.m4 +++ b/gnulib/import/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 50 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# stdio_h.m4 serial 52 +dnl Copyright (C) 2007-2021 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. @@ -109,6 +109,11 @@ AC_DEFUN([gl_STDIO_H], renameat snprintf tmpfile vdprintf vsnprintf]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS_ONCE([fcloseall]) + if test $ac_cv_have_decl_fcloseall = no; then + HAVE_DECL_FCLOSEALL=0 + fi ]) AC_DEFUN([gl_STDIO_MODULE_INDICATOR], @@ -175,7 +180,15 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_FCLOSEALL=1; AC_SUBST([GNULIB_MDA_FCLOSEALL]) + GNULIB_MDA_FDOPEN=1; AC_SUBST([GNULIB_MDA_FDOPEN]) + GNULIB_MDA_FILENO=1; AC_SUBST([GNULIB_MDA_FILENO]) + GNULIB_MDA_GETW=1; AC_SUBST([GNULIB_MDA_GETW]) + GNULIB_MDA_PUTW=1; AC_SUBST([GNULIB_MDA_PUTW]) + GNULIB_MDA_TEMPNAM=1; AC_SUBST([GNULIB_MDA_TEMPNAM]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_FCLOSEALL=1; AC_SUBST([HAVE_DECL_FCLOSEALL]) HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) diff --git a/gnulib/import/m4/stdlib_h.m4 b/gnulib/import/m4/stdlib_h.m4 index 743066a..5a02972 100644 --- a/gnulib/import/m4/stdlib_h.m4 +++ b/gnulib/import/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 49 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# stdlib_h.m4 serial 55 +dnl Copyright (C) 2007-2021 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. @@ -22,13 +22,28 @@ AC_DEFUN([gl_STDLIB_H], #if HAVE_RANDOM_H # include <random.h> #endif - ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + ]], [_Exit aligned_alloc atoll canonicalize_file_name free + getloadavg getsubopt grantpt initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps - posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray - realpath rpmatch secure_getenv setenv setstate setstate_r srandom - srandom_r strtod strtold strtoll strtoull unlockpt unsetenv]) + posix_memalign posix_openpt ptsname ptsname_r qsort_r + random random_r reallocarray realpath rpmatch secure_getenv setenv + setstate setstate_r srandom srandom_r + strtod strtold strtoll strtoull unlockpt unsetenv]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS_ONCE([ecvt]) + if test $ac_cv_have_decl_ecvt = no; then + HAVE_DECL_ECVT=0 + fi + AC_CHECK_DECLS_ONCE([fcvt]) + if test $ac_cv_have_decl_fcvt = no; then + HAVE_DECL_FCVT=0 + fi + AC_CHECK_DECLS_ONCE([gcvt]) + if test $ac_cv_have_decl_gcvt = no; then + HAVE_DECL_GCVT=0 + fi ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -43,9 +58,11 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) + GNULIB_ALIGNED_ALLOC=0; AC_SUBST([GNULIB_ALIGNED_ALLOC]) GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) + GNULIB_FREE_POSIX=0; AC_SUBST([GNULIB_FREE_POSIX]) GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) @@ -56,6 +73,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) + GNULIB_POSIX_MEMALIGN=0;AC_SUBST([GNULIB_POSIX_MEMALIGN]) GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) @@ -77,10 +95,20 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_ECVT=1; AC_SUBST([GNULIB_MDA_ECVT]) + GNULIB_MDA_FCVT=1; AC_SUBST([GNULIB_MDA_FCVT]) + GNULIB_MDA_GCVT=1; AC_SUBST([GNULIB_MDA_GCVT]) + GNULIB_MDA_MKTEMP=1; AC_SUBST([GNULIB_MDA_MKTEMP]) + GNULIB_MDA_PUTENV=1; AC_SUBST([GNULIB_MDA_PUTENV]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) + HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) + HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT]) + HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT]) + HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) @@ -92,6 +120,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) + HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN]) HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) @@ -115,12 +144,15 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) + REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC]) REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) + REPLACE_FREE=0; AC_SUBST([REPLACE_FREE]) REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE]) REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN]) REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) diff --git a/gnulib/import/m4/strchrnul.m4 b/gnulib/import/m4/strchrnul.m4 index a18f093..76c9a04 100644 --- a/gnulib/import/m4/strchrnul.m4 +++ b/gnulib/import/m4/strchrnul.m4 @@ -1,5 +1,5 @@ # strchrnul.m4 serial 9 -dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007, 2009-2021 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. diff --git a/gnulib/import/m4/strdup.m4 b/gnulib/import/m4/strdup.m4 index 2d1fcc4..f6f421d 100644 --- a/gnulib/import/m4/strdup.m4 +++ b/gnulib/import/m4/strdup.m4 @@ -1,6 +1,6 @@ -# strdup.m4 serial 13 +# strdup.m4 serial 14 -dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,6 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRDUP], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([strdup]) AC_CHECK_DECLS_ONCE([strdup]) if test $ac_cv_have_decl_strdup = no; then HAVE_DECL_STRDUP=0 @@ -20,11 +19,8 @@ AC_DEFUN([gl_FUNC_STRDUP_POSIX], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) - AC_CHECK_FUNCS_ONCE([strdup]) - if test $ac_cv_func_strdup = yes; then - if test $gl_cv_func_malloc_posix != yes; then - REPLACE_STRDUP=1 - fi + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 fi AC_CHECK_DECLS_ONCE([strdup]) if test $ac_cv_have_decl_strdup = no; then diff --git a/gnulib/import/m4/strerror.m4 b/gnulib/import/m4/strerror.m4 index fd84ce8..48c56ae 100644 --- a/gnulib/import/m4/strerror.m4 +++ b/gnulib/import/m4/strerror.m4 @@ -1,5 +1,5 @@ # strerror.m4 serial 21 -dnl Copyright (C) 2002, 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2021 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. diff --git a/gnulib/import/m4/strerror_r.m4 b/gnulib/import/m4/strerror_r.m4 index d431f23..b0b2ed0 100644 --- a/gnulib/import/m4/strerror_r.m4 +++ b/gnulib/import/m4/strerror_r.m4 @@ -1,5 +1,5 @@ # strerror_r.m4 serial 20 -dnl Copyright (C) 2002, 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2021 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. diff --git a/gnulib/import/m4/string_h.m4 b/gnulib/import/m4/string_h.m4 index cc51337..a4cc5b4 100644 --- a/gnulib/import/m4/string_h.m4 +++ b/gnulib/import/m4/string_h.m4 @@ -1,11 +1,11 @@ # Configure a GNU-like replacement for <string.h>. -# Copyright (C) 2007-2020 Free Software Foundation, Inc. +# Copyright (C) 2007-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 23 +# serial 29 # Written by Paul Eggert. @@ -28,7 +28,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY], ]], [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r - strerror_r strsignal strverscmp]) + strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp]) AC_REQUIRE([AC_C_RESTRICT]) ]) @@ -44,50 +44,55 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR], AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ - GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) - GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) - GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) - GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) - GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) - GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) - GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) - GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) - GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) - GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) - GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) - GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) - GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) - GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) - GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) - GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) - GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) - GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) - GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) - GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) - GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) - GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) - GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) - GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) - GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) - GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) - GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) - GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) - GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) - GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) - GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) - GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) - GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) - GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) - GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) - GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) - GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) - GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) - HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) + GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) + GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) + GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) + GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) + GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) + GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) + GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) + GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) + GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) + GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) + GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) + GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) + GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) + GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) + GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) + GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) + GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) + GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) + GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) + GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) + GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) + GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) + GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) + GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) + GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) + GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) + GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) + GNULIB_STRERRORNAME_NP=0; AC_SUBST([GNULIB_STRERRORNAME_NP]) + GNULIB_SIGABBREV_NP=0; AC_SUBST([GNULIB_SIGABBREV_NP]) + GNULIB_SIGDESCR_NP=0; AC_SUBST([GNULIB_SIGDESCR_NP]) + GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_MEMCCPY=1; AC_SUBST([GNULIB_MDA_MEMCCPY]) + GNULIB_MDA_STRDUP=1; AC_SUBST([GNULIB_MDA_STRDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) - HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) @@ -103,8 +108,12 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) + HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP]) + HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP]) + HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) + REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL]) REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) @@ -118,6 +127,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) + REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) diff --git a/gnulib/import/m4/strnlen.m4 b/gnulib/import/m4/strnlen.m4 index 71b8e1b..bb9a680 100644 --- a/gnulib/import/m4/strnlen.m4 +++ b/gnulib/import/m4/strnlen.m4 @@ -1,5 +1,5 @@ # strnlen.m4 serial 13 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/strstr.m4 b/gnulib/import/m4/strstr.m4 index a2ec337..1226b05 100644 --- a/gnulib/import/m4/strstr.m4 +++ b/gnulib/import/m4/strstr.m4 @@ -1,5 +1,5 @@ -# strstr.m4 serial 21 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# strstr.m4 serial 22 +dnl Copyright (C) 2008-2021 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. @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MEMCHR]) - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + if test $REPLACE_MEMCHR = 1; then REPLACE_STRSTR=1 else dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092 diff --git a/gnulib/import/m4/strtok_r.m4 b/gnulib/import/m4/strtok_r.m4 index 2da132c..b8e2f68 100644 --- a/gnulib/import/m4/strtok_r.m4 +++ b/gnulib/import/m4/strtok_r.m4 @@ -1,5 +1,5 @@ # strtok_r.m4 serial 15 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gnulib/import/m4/sys_random_h.m4 b/gnulib/import/m4/sys_random_h.m4 index a964b15..45e0469 100644 --- a/gnulib/import/m4/sys_random_h.m4 +++ b/gnulib/import/m4/sys_random_h.m4 @@ -1,5 +1,5 @@ -# sys_random_h.m4 serial 4 -dnl Copyright (C) 2020 Free Software Foundation, Inc. +# sys_random_h.m4 serial 5 +dnl Copyright (C) 2020-2021 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. @@ -25,7 +25,8 @@ AC_DEFUN([gl_HEADER_SYS_RANDOM], dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if HAVE_SYS_RANDOM_H -/* Additional includes are needed before <sys/random.h> on Mac OS X. */ +/* Additional includes are needed before <sys/random.h> on uClibc + and Mac OS X. */ # include <sys/types.h> # include <stdlib.h> # include <sys/random.h> diff --git a/gnulib/import/m4/sys_socket_h.m4 b/gnulib/import/m4/sys_socket_h.m4 index bf902f0..503cb96 100644 --- a/gnulib/import/m4/sys_socket_h.m4 +++ b/gnulib/import/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 25 -dnl Copyright (C) 2005-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2021 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. diff --git a/gnulib/import/m4/sys_stat_h.m4 b/gnulib/import/m4/sys_stat_h.m4 index 3efba5a..23cbdd2 100644 --- a/gnulib/import/m4/sys_stat_h.m4 +++ b/gnulib/import/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ -# sys_stat_h.m4 serial 33 -*- Autoconf -*- -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# sys_stat_h.m4 serial 38 -*- Autoconf -*- +dnl Copyright (C) 2006-2021 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. @@ -46,8 +46,8 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h> - ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat - mknod mknodat stat utimensat]) + ]], [fchmodat fstat fstatat futimens getumask lchmod lstat + mkdirat mkfifo mkfifoat mknod mknodat stat utimensat]) AC_REQUIRE([AC_C_RESTRICT]) ]) @@ -68,8 +68,10 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) + GNULIB_GETUMASK=0; AC_SUBST([GNULIB_GETUMASK]) GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + GNULIB_MKDIR=0; AC_SUBST([GNULIB_MKDIR]) GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) @@ -78,10 +80,15 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_CHMOD=1; AC_SUBST([GNULIB_MDA_CHMOD]) + GNULIB_MDA_MKDIR=1; AC_SUBST([GNULIB_MDA_MKDIR]) + GNULIB_MDA_UMASK=1; AC_SUBST([GNULIB_MDA_UMASK]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) + HAVE_GETUMASK=1; AC_SUBST([HAVE_GETUMASK]) HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) @@ -97,7 +104,9 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) + REPLACE_MKFIFOAT=0; AC_SUBST([REPLACE_MKFIFOAT]) REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) + REPLACE_MKNODAT=0; AC_SUBST([REPLACE_MKNODAT]) REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) ]) diff --git a/gnulib/import/m4/sys_time_h.m4 b/gnulib/import/m4/sys_time_h.m4 index 8fc8599..64f133d 100644 --- a/gnulib/import/m4/sys_time_h.m4 +++ b/gnulib/import/m4/sys_time_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for <sys/time.h>. # serial 9 -# Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/sys_types_h.m4 b/gnulib/import/m4/sys_types_h.m4 index be918dc..2172c83 100644 --- a/gnulib/import/m4/sys_types_h.m4 +++ b/gnulib/import/m4/sys_types_h.m4 @@ -1,5 +1,5 @@ -# sys_types_h.m4 serial 9 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# sys_types_h.m4 serial 11 +dnl Copyright (C) 2011-2021 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. @@ -36,25 +36,23 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], # This works around a buggy version in autoconf <= 2.69. # See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html> +# The 2.70 version isn't quoted properly, so override it too. -m4_version_prereq([2.70], [], [ - -# This is taken from the following Autoconf patch: -# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e987d7ee695fb4294a82d987ec3dc9b974 +m4_version_prereq([2.70.1], [], [ m4_undefine([AC_HEADER_MAJOR]) AC_DEFUN([AC_HEADER_MAJOR], [AC_CHECK_HEADERS_ONCE([sys/types.h]) AC_CHECK_HEADER([sys/mkdev.h], - [AC_DEFINE([MAJOR_IN_MKDEV], [1], - [Define to 1 if `major', `minor', and `makedev' are declared in - <mkdev.h>.])]) + [AC_DEFINE([MAJOR_IN_MKDEV], [1], + [Define to 1 if `major', `minor', and `makedev' are + declared in <mkdev.h>.])]) if test $ac_cv_header_sys_mkdev_h = no; then AC_CHECK_HEADER([sys/sysmacros.h], - [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], - [Define to 1 if `major', `minor', and `makedev' are declared in - <sysmacros.h>.])]) + [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], + [Define to 1 if `major', `minor', and `makedev' + are declared in <sysmacros.h>.])]) fi -]) +])# AC_HEADER_MAJOR ]) diff --git a/gnulib/import/m4/sys_uio_h.m4 b/gnulib/import/m4/sys_uio_h.m4 index a255dea..503de4d 100644 --- a/gnulib/import/m4/sys_uio_h.m4 +++ b/gnulib/import/m4/sys_uio_h.m4 @@ -1,5 +1,5 @@ # sys_uio_h.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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. diff --git a/gnulib/import/m4/tempname.m4 b/gnulib/import/m4/tempname.m4 index da439f0..14c796d 100644 --- a/gnulib/import/m4/tempname.m4 +++ b/gnulib/import/m4/tempname.m4 @@ -1,6 +1,6 @@ #serial 5 -# Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/threadlib.m4 b/gnulib/import/m4/threadlib.m4 index 94441f6..20b383a 100644 --- a/gnulib/import/m4/threadlib.m4 +++ b/gnulib/import/m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 27 -dnl Copyright (C) 2005-2020 Free Software Foundation, Inc. +# threadlib.m4 serial 29 +dnl Copyright (C) 2005-2021 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. @@ -398,8 +398,8 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=]) AC_ARG_ENABLE([threads], -AC_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ -AC_HELP_STRING([--disable-threads], [build without multithread safety])]), +AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ +AS_HELP_STRING([--disable-threads], [build without multithread safety])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" @@ -486,6 +486,17 @@ AC_DEFUN([gl_THREADLIB_BODY], AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= + else + case "$host_os" in + freebsd* | dragonfly*) + if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then + dnl If weak symbols can't tell whether pthread_create(), pthread_key_create() + dnl etc. will succeed, we need a runtime test. + AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], + [Define if the pthread_in_use() detection is hard.]) + fi + ;; + esac fi fi fi diff --git a/gnulib/import/m4/time_h.m4 b/gnulib/import/m4/time_h.m4 index d0f8932..b6a1aa3 100644 --- a/gnulib/import/m4/time_h.m4 +++ b/gnulib/import/m4/time_h.m4 @@ -1,8 +1,8 @@ # Configure a more-standard replacement for <time.h>. -# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc. -# serial 12 +# serial 15 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -25,6 +25,22 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY], AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CACHE_CHECK([for TIME_UTC in <time.h>], + [gl_cv_time_h_has_TIME_UTC], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <time.h> + ]], + [[static int x = TIME_UTC; x++;]])], + [gl_cv_time_h_has_TIME_UTC=yes], + [gl_cv_time_h_has_TIME_UTC=no])]) + if test $gl_cv_time_h_has_TIME_UTC = yes; then + TIME_H_DEFINES_TIME_UTC=1 + else + TIME_H_DEFINES_TIME_UTC=0 + fi + AC_SUBST([TIME_H_DEFINES_TIME_UTC]) ]) dnl Check whether 'struct timespec' is declared @@ -113,15 +129,18 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], GNULIB_STRFTIME=0; AC_SUBST([GNULIB_STRFTIME]) GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) + GNULIB_TIMESPEC_GET=0; AC_SUBST([GNULIB_TIMESPEC_GET]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_TZSET=1; AC_SUBST([GNULIB_MDA_TZSET]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) - HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) + HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET]) dnl Even GNU libc does not have timezone_t yet. HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) dnl If another module says to replace or to not replace, do that. diff --git a/gnulib/import/m4/time_r.m4 b/gnulib/import/m4/time_r.m4 index 0e86d44..713e93a 100644 --- a/gnulib/import/m4/time_r.m4 +++ b/gnulib/import/m4/time_r.m4 @@ -1,6 +1,6 @@ dnl Reentrant time functions: localtime_r, gmtime_r. -dnl Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006-2021 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. diff --git a/gnulib/import/m4/unistd-safer.m4 b/gnulib/import/m4/unistd-safer.m4 index 65dfdf2..c205446 100644 --- a/gnulib/import/m4/unistd-safer.m4 +++ b/gnulib/import/m4/unistd-safer.m4 @@ -1,5 +1,5 @@ #serial 9 -dnl Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2021 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. diff --git a/gnulib/import/m4/unistd_h.m4 b/gnulib/import/m4/unistd_h.m4 index dfa38f8..0f26fb9 100644 --- a/gnulib/import/m4/unistd_h.m4 +++ b/gnulib/import/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 80 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# unistd_h.m4 serial 85 +dnl Copyright (C) 2006-2021 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. @@ -41,7 +41,9 @@ AC_DEFUN([gl_UNISTD_H], # include <io.h> # endif #endif - ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir + ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess + execl execle execlp execv execve execvp execvpe + faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass getusershell setusershell endusershell @@ -50,6 +52,11 @@ AC_DEFUN([gl_UNISTD_H], truncate ttyname_r unlink unlinkat usleep]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS_ONCE([execvpe]) + if test $ac_cv_have_decl_execvpe = no; then + HAVE_DECL_EXECVPE=0 + fi ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -73,6 +80,13 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_EXECL=0; AC_SUBST([GNULIB_EXECL]) + GNULIB_EXECLE=0; AC_SUBST([GNULIB_EXECLE]) + GNULIB_EXECLP=0; AC_SUBST([GNULIB_EXECLP]) + GNULIB_EXECV=0; AC_SUBST([GNULIB_EXECV]) + GNULIB_EXECVE=0; AC_SUBST([GNULIB_EXECVE]) + GNULIB_EXECVP=0; AC_SUBST([GNULIB_EXECVP]) + GNULIB_EXECVPE=0; AC_SUBST([GNULIB_EXECVPE]) GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) @@ -117,12 +131,34 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_ACCESS=1; AC_SUBST([GNULIB_MDA_ACCESS]) + GNULIB_MDA_CHDIR=1; AC_SUBST([GNULIB_MDA_CHDIR]) + GNULIB_MDA_CLOSE=1; AC_SUBST([GNULIB_MDA_CLOSE]) + GNULIB_MDA_DUP=1; AC_SUBST([GNULIB_MDA_DUP]) + GNULIB_MDA_DUP2=1; AC_SUBST([GNULIB_MDA_DUP2]) + GNULIB_MDA_EXECL=1; AC_SUBST([GNULIB_MDA_EXECL]) + GNULIB_MDA_EXECLE=1; AC_SUBST([GNULIB_MDA_EXECLE]) + GNULIB_MDA_EXECLP=1; AC_SUBST([GNULIB_MDA_EXECLP]) + GNULIB_MDA_EXECV=1; AC_SUBST([GNULIB_MDA_EXECV]) + GNULIB_MDA_EXECVE=1; AC_SUBST([GNULIB_MDA_EXECVE]) + GNULIB_MDA_EXECVP=1; AC_SUBST([GNULIB_MDA_EXECVP]) + GNULIB_MDA_EXECVPE=1; AC_SUBST([GNULIB_MDA_EXECVPE]) + GNULIB_MDA_GETCWD=1; AC_SUBST([GNULIB_MDA_GETCWD]) + GNULIB_MDA_GETPID=1; AC_SUBST([GNULIB_MDA_GETPID]) + GNULIB_MDA_ISATTY=1; AC_SUBST([GNULIB_MDA_ISATTY]) + GNULIB_MDA_LSEEK=1; AC_SUBST([GNULIB_MDA_LSEEK]) + GNULIB_MDA_READ=1; AC_SUBST([GNULIB_MDA_READ]) + GNULIB_MDA_RMDIR=1; AC_SUBST([GNULIB_MDA_RMDIR]) + GNULIB_MDA_SWAB=1; AC_SUBST([GNULIB_MDA_SWAB]) + GNULIB_MDA_UNLINK=1; AC_SUBST([GNULIB_MDA_UNLINK]) + GNULIB_MDA_WRITE=1; AC_SUBST([GNULIB_MDA_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE]) - HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) + HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE]) HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) @@ -153,6 +189,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE]) HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) @@ -170,6 +207,13 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) + REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) + REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE]) + REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP]) + REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV]) + REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE]) + REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) + REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) diff --git a/gnulib/import/m4/visibility.m4 b/gnulib/import/m4/visibility.m4 index 9f493ba..6e4b461 100644 --- a/gnulib/import/m4/visibility.m4 +++ b/gnulib/import/m4/visibility.m4 @@ -1,5 +1,5 @@ # visibility.m4 serial 6 -dnl Copyright (C) 2005, 2008, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2021 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. diff --git a/gnulib/import/m4/warn-on-use.m4 b/gnulib/import/m4/warn-on-use.m4 index 5c8ee45..04edfe8 100644 --- a/gnulib/import/m4/warn-on-use.m4 +++ b/gnulib/import/m4/warn-on-use.m4 @@ -1,5 +1,5 @@ -# warn-on-use.m4 serial 6 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +# warn-on-use.m4 serial 9 +dnl Copyright (C) 2010-2021 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. @@ -30,17 +30,15 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl -dnl FIXME: gl_Symbol must be used unquoted until we can assume -dnl autoconf 2.64 or newer. for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AC_CACHE_CHECK([whether $gl_func is declared without a macro], - gl_Symbol, + [gl_Symbol], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], -[@%:@undef $gl_func - (void) $gl_func;])], - [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) - AS_VAR_IF(gl_Symbol, [yes], +[[#undef $gl_func + (void) $gl_func;]])], + [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) + AS_VAR_IF([gl_Symbol], [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl shortcut - if the raw declaration exists, then set a cache dnl variable to allow skipping any later AC_CHECK_DECL efforts diff --git a/gnulib/import/m4/wchar_h.m4 b/gnulib/import/m4/wchar_h.m4 index 6c4e8a6..59c55fc 100644 --- a/gnulib/import/m4/wchar_h.m4 +++ b/gnulib/import/m4/wchar_h.m4 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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 Written by Eric Blake. -# wchar_h.m4 serial 46 +# wchar_h.m4 serial 50 AC_DEFUN([gl_WCHAR_H], [ @@ -40,16 +40,7 @@ AC_DEFUN([gl_WCHAR_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include <stddef.h> -# include <stdio.h> -# include <time.h> -#endif -#include <wchar.h> + #include <wchar.h> ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth @@ -60,6 +51,13 @@ AC_DEFUN([gl_WCHAR_H], ]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS([wcsdup], [], [], [[ + #include <wchar.h> + ]]) + if test $ac_cv_have_decl_wcsdup = no; then + HAVE_DECL_WCSDUP=0 + fi ]) dnl Check whether <wchar.h> is usable at all. @@ -70,56 +68,49 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK], dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary, dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>. + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly], [gl_cv_header_wchar_h_correct_inline], [gl_cv_header_wchar_h_correct_inline=yes - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([[#define wcstod renamed_wcstod -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -extern int zero (void); -int main () { return zero(); } -]])]) - dnl Do not rename the object file from conftest.$ac_objext to - dnl conftest1.$ac_objext, as this will cause the link to fail on - dnl z/OS when using the XPLINK object format (due to duplicate - dnl CSECT names). Instead, temporarily redefine $ac_compile so - dnl that the object file has the latter name from the start. - save_ac_compile="$ac_compile" - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` - if echo '#include "conftest.c"' >conftest1.c && - AC_TRY_EVAL([ac_compile]); then - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([[#define wcstod renamed_wcstod -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -int zero (void) { return 0; } -]])]) - dnl See note above about renaming object files. - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` - if echo '#include "conftest.c"' >conftest2.c && - AC_TRY_EVAL([ac_compile]); then - if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then - : - else - gl_cv_header_wchar_h_correct_inline=no + case "$host_os" in + *-gnu* | gnu*) + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[ + #define wcstod renamed_wcstod + #include <wchar.h> + extern int zero (void); + int main () { return zero(); } + ]])]) + dnl Do not rename the object file from conftest.$ac_objext to + dnl conftest1.$ac_objext, as this will cause the link to fail on + dnl z/OS when using the XPLINK object format (due to duplicate + dnl CSECT names). Instead, temporarily redefine $ac_compile so + dnl that the object file has the latter name from the start. + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if echo '#include "conftest.c"' >conftest1.c \ + && AC_TRY_EVAL([ac_compile]); then + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[ + #define wcstod renamed_wcstod + #include <wchar.h> + int zero (void) { return 0; } + ]])]) + dnl See note above about renaming object files. + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if echo '#include "conftest.c"' >conftest2.c \ + && AC_TRY_EVAL([ac_compile]); then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi fi - fi - fi - ac_compile="$save_ac_compile" - rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext + ac_compile="$save_ac_compile" + rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext + ;; + esac ]) if test $gl_cv_header_wchar_h_correct_inline = no; then AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). @@ -186,6 +177,8 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) GNULIB_WCSFTIME=0; AC_SUBST([GNULIB_WCSFTIME]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_WCSDUP=1; AC_SUBST([GNULIB_MDA_WCSDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) @@ -227,6 +220,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) + HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) diff --git a/gnulib/import/m4/wchar_t.m4 b/gnulib/import/m4/wchar_t.m4 index e48d464..34db10e 100644 --- a/gnulib/import/m4/wchar_t.m4 +++ b/gnulib/import/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2021 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. diff --git a/gnulib/import/m4/wctype_h.m4 b/gnulib/import/m4/wctype_h.m4 index 5c844b6..1ab0bc9 100644 --- a/gnulib/import/m4/wctype_h.m4 +++ b/gnulib/import/m4/wctype_h.m4 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 24 +# wctype_h.m4 serial 26 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2021 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. @@ -41,13 +41,6 @@ AC_DEFUN([gl_WCTYPE_H], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ - /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be - included before <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> - must be included before <wchar.h>. */ - #include <stddef.h> - #include <stdio.h> - #include <time.h> #include <wchar.h> #include <wctype.h> int main () { return iswprint ('x') == 0; } @@ -57,7 +50,7 @@ AC_DEFUN([gl_WCTYPE_H], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. - #endif]], [])], + #endif]], [[]])], [gl_cv_func_iswcntrl_works="guessing yes"], [gl_cv_func_iswcntrl_works="guessing no"]) ]) @@ -92,14 +85,7 @@ AC_DEFUN([gl_WCTYPE_H], REPLACE_TOWLOWER=0 else AC_CHECK_DECLS([towlower],,, - [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be - included before <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> - must be included before <wchar.h>. */ - #include <stddef.h> - #include <stdio.h> - #include <time.h> - #include <wchar.h> + [[#include <wchar.h> #if HAVE_WCTYPE_H # include <wctype.h> #endif @@ -128,14 +114,7 @@ AC_DEFUN([gl_WCTYPE_H], AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be - included before <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> - must be included before <wchar.h>. */ - #include <stddef.h> - #include <stdio.h> - #include <time.h> - #include <wchar.h> + [[#include <wchar.h> #if HAVE_WCTYPE_H # include <wctype.h> #endif @@ -154,14 +133,7 @@ AC_DEFUN([gl_WCTYPE_H], AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be - included before <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> - must be included before <wchar.h>. */ - #include <stddef.h> - #include <stdio.h> - #include <time.h> - #include <wchar.h> + [[#include <wchar.h> #include <wctype.h> wctrans_t a; ]], @@ -176,14 +148,7 @@ AC_DEFUN([gl_WCTYPE_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) -# include <stddef.h> -# include <stdio.h> -# include <time.h> # include <wchar.h> #endif #include <wctype.h> diff --git a/gnulib/import/m4/wint_t.m4 b/gnulib/import/m4/wint_t.m4 index 5e6c178..2fc7467 100644 --- a/gnulib/import/m4/wint_t.m4 +++ b/gnulib/import/m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 8 -dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc. +# wint_t.m4 serial 10 +dnl Copyright (C) 2003, 2007-2021 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. @@ -14,15 +14,7 @@ AC_DEFUN([gt_TYPE_WINT_T], AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included - before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> + [[#include <wchar.h> wint_t foo = (wchar_t)'\0';]], [[]])], [gt_cv_c_wint_t=yes], @@ -32,25 +24,16 @@ AC_DEFUN([gt_TYPE_WINT_T], dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present, dnl override 'wint_t'. - AC_CACHE_CHECK([whether wint_t is too small], - [gl_cv_type_wint_t_too_small], + AC_CACHE_CHECK([whether wint_t is large enough], + [gl_cv_type_wint_t_large_enough], [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include <stddef.h> -# include <stdio.h> -# include <time.h> -#endif -#include <wchar.h> - int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + [AC_LANG_PROGRAM( + [[#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; ]])], - [gl_cv_type_wint_t_too_small=no], - [gl_cv_type_wint_t_too_small=yes])]) - if test $gl_cv_type_wint_t_too_small = yes; then + [gl_cv_type_wint_t_large_enough=yes], + [gl_cv_type_wint_t_large_enough=no])]) + if test $gl_cv_type_wint_t_large_enough = no; then GNULIB_OVERRIDES_WINT_T=1 else GNULIB_OVERRIDES_WINT_T=0 diff --git a/gnulib/import/m4/wmemchr.m4 b/gnulib/import/m4/wmemchr.m4 index 62bd89c..a5b4eb7 100644 --- a/gnulib/import/m4/wmemchr.m4 +++ b/gnulib/import/m4/wmemchr.m4 @@ -1,5 +1,5 @@ -# wmemchr.m4 serial 4 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# wmemchr.m4 serial 5 +dnl Copyright (C) 2011-2021 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. @@ -11,16 +11,9 @@ AC_DEFUN([gl_FUNC_WMEMCHR], dnl provide this function as an inline function definition. AC_CACHE_CHECK([for wmemchr], [gl_cv_func_wmemchr], [AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included - before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -]], + [AC_LANG_PROGRAM( + [[#include <wchar.h> + ]], [[return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);]]) ], [gl_cv_func_wmemchr=yes], diff --git a/gnulib/import/m4/wmempcpy.m4 b/gnulib/import/m4/wmempcpy.m4 index 1795fc8..9d774ae 100644 --- a/gnulib/import/m4/wmempcpy.m4 +++ b/gnulib/import/m4/wmempcpy.m4 @@ -1,5 +1,5 @@ # wmempcpy.m4 serial 1 -dnl Copyright (C) 2020 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2021 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. diff --git a/gnulib/import/m4/zzgnulib.m4 b/gnulib/import/m4/zzgnulib.m4 index 98fa68f..b953384 100644 --- a/gnulib/import/m4/zzgnulib.m4 +++ b/gnulib/import/m4/zzgnulib.m4 @@ -1,5 +1,5 @@ # zzgnulib.m4 serial 1 -dnl Copyright (C) 2020 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2021 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. diff --git a/gnulib/import/malloc.c b/gnulib/import/malloc.c index 7232f1e..b59e64b 100644 --- a/gnulib/import/malloc.c +++ b/gnulib/import/malloc.c @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/malloc/scratch_buffer.h b/gnulib/import/malloc/scratch_buffer.h index b404786..26e3062 100644 --- a/gnulib/import/malloc/scratch_buffer.h +++ b/gnulib/import/malloc/scratch_buffer.h @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2020 Free Software Foundation, Inc. + Copyright (C) 2015-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -132,4 +132,20 @@ scratch_buffer_set_array_size (struct scratch_buffer *buffer, (buffer, nelem, size)); } +/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block, + deallocating *BUFFER if it was heap-allocated. SIZE must be at + most *BUFFER's size. Return NULL (setting errno) on memory + exhaustion. */ +void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, + size_t size); +libc_hidden_proto (__libc_scratch_buffer_dupfree) + +/* Alias for __libc_scratch_dupfree. */ +static __always_inline void * +scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size) +{ + void *r = __libc_scratch_buffer_dupfree (buffer, size); + return __glibc_likely (r != NULL) ? r : NULL; +} + #endif /* _SCRATCH_BUFFER_H */ diff --git a/gnulib/import/malloc/scratch_buffer_dupfree.c b/gnulib/import/malloc/scratch_buffer_dupfree.c new file mode 100644 index 0000000..775bff5 --- /dev/null +++ b/gnulib/import/malloc/scratch_buffer_dupfree.c @@ -0,0 +1,41 @@ +/* Variable-sized buffer with on-stack default allocation. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _LIBC +# include <libc-config.h> +#endif + +#include <scratch_buffer.h> +#include <string.h> + +void * +__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size) +{ + void *data = buffer->data; + if (data == buffer->__space.__c) + { + void *copy = malloc (size); + return copy != NULL ? memcpy (copy, data, size) : NULL; + } + else + { + void *copy = realloc (data, size); + return copy != NULL ? copy : data; + } +} +libc_hidden_def (__libc_scratch_buffer_dupfree) diff --git a/gnulib/import/malloc/scratch_buffer_grow.c b/gnulib/import/malloc/scratch_buffer_grow.c index 41befe3..e7606d8 100644 --- a/gnulib/import/malloc/scratch_buffer_grow.c +++ b/gnulib/import/malloc/scratch_buffer_grow.c @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2020 Free Software Foundation, Inc. + Copyright (C) 2015-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/malloc/scratch_buffer_grow_preserve.c b/gnulib/import/malloc/scratch_buffer_grow_preserve.c index aef2329..59f8c71 100644 --- a/gnulib/import/malloc/scratch_buffer_grow_preserve.c +++ b/gnulib/import/malloc/scratch_buffer_grow_preserve.c @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2020 Free Software Foundation, Inc. + Copyright (C) 2015-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/malloc/scratch_buffer_set_array_size.c b/gnulib/import/malloc/scratch_buffer_set_array_size.c index 5f5e4c2..e2b9f31 100644 --- a/gnulib/import/malloc/scratch_buffer_set_array_size.c +++ b/gnulib/import/malloc/scratch_buffer_set_array_size.c @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2020 Free Software Foundation, Inc. + Copyright (C) 2015-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnulib/import/malloca.c b/gnulib/import/malloca.c index 975b166..7131cb7 100644 --- a/gnulib/import/malloca.c +++ b/gnulib/import/malloca.c @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003, 2018. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/malloca.h b/gnulib/import/malloca.h index cfcd4de..a04e545 100644 --- a/gnulib/import/malloca.h +++ b/gnulib/import/malloca.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software; you can redistribute it and/or modify @@ -89,7 +89,7 @@ extern void freea (void *p); /* ------------------- Auxiliary, non-public definitions ------------------- */ /* Determine the alignment of a type at compile time. */ -#if defined __GNUC__ || defined __IBM__ALIGNOF__ +#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ # define sa_alignof __alignof__ #elif defined __cplusplus template <class type> struct sa_alignof_helper { char __slot1; type __slot2; }; diff --git a/gnulib/import/math.in.h b/gnulib/import/math.in.h index 30465f8..6208a01 100644 --- a/gnulib/import/math.in.h +++ b/gnulib/import/math.in.h @@ -1,6 +1,6 @@ /* A GNU-like <math.h>. - Copyright (C) 2002-2003, 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,8 +22,23 @@ #endif @PRAGMA_COLUMNS@ +#if defined _GL_INCLUDING_MATH_H +/* Special invocation convention: + - On FreeBSD 12.2 we have a sequence of nested includes + <math.h> -> <stdlib.h> -> <sys/wait.h> -> <sys/types.h> -> <sys/select.h> + -> <signal.h> -> <pthread.h> -> <stdlib.h> -> <math.h> + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ + +#else +/* Normal invocation convention. */ + /* The include_next requires a split double-inclusion guard. */ +#define _GL_INCLUDING_MATH_H #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ +#undef _GL_INCLUDING_MATH_H #ifndef _@GUARD_PREFIX@_MATH_H #define _@GUARD_PREFIX@_MATH_H @@ -127,12 +142,6 @@ static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq; #endif -/* For clang: Use __has_builtin to determine whether a builtin is available. */ -#ifndef __has_builtin -# define __has_builtin(name) 0 -#endif - - /* POSIX allows platforms that don't support NAN. But all major machines in the past 15 years have supported something close to IEEE NaN, so we define this unconditionally. We also must define @@ -261,7 +270,9 @@ _GL_WARN_ON_USE (acosf, "acosf is unportable - " _GL_FUNCDECL_SYS (acosl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (acosl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (acosl); +# endif #elif defined GNULIB_POSIXCHECK # undef acosl # if HAVE_RAW_DECL_ACOSL @@ -301,7 +312,9 @@ _GL_WARN_ON_USE (asinf, "asinf is unportable - " _GL_FUNCDECL_SYS (asinl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (asinl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (asinl); +# endif #elif defined GNULIB_POSIXCHECK # undef asinl # if HAVE_RAW_DECL_ASINL @@ -341,7 +354,9 @@ _GL_WARN_ON_USE (atanf, "atanf is unportable - " _GL_FUNCDECL_SYS (atanl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (atanl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (atanl); +# endif #elif defined GNULIB_POSIXCHECK # undef atanl # if HAVE_RAW_DECL_ATANL @@ -405,7 +420,7 @@ _GL_FUNCDECL_SYS (cbrt, double, (double x)); # endif _GL_CXXALIAS_SYS (cbrt, double, (double x)); # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (cbrt); +_GL_CXXALIASWARN1 (cbrt, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef cbrt @@ -475,7 +490,7 @@ _GL_CXXALIAS_RPL (ceil, double, (double x)); _GL_CXXALIAS_SYS (ceil, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (ceil); +_GL_CXXALIASWARN1 (ceil, double, (double x)); # endif #endif @@ -494,7 +509,9 @@ _GL_FUNCDECL_SYS (ceill, long double, (long double x)); # endif _GL_CXXALIAS_SYS (ceill, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ceill); +# endif #elif defined GNULIB_POSIXCHECK # undef ceill # if HAVE_RAW_DECL_CEILL @@ -525,7 +542,7 @@ _GL_FUNCDECL_SYS (copysign, double, (double x, double y)); # endif _GL_CXXALIAS_SYS (copysign, double, (double x, double y)); # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (copysign); +_GL_CXXALIASWARN1 (copysign, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef copysign @@ -580,7 +597,9 @@ _GL_WARN_ON_USE (cosf, "cosf is unportable - " _GL_FUNCDECL_SYS (cosl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (cosl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (cosl); +# endif #elif defined GNULIB_POSIXCHECK # undef cosl # if HAVE_RAW_DECL_COSL @@ -654,7 +673,9 @@ _GL_FUNCDECL_SYS (expl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (expl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (expl); +# endif #elif defined GNULIB_POSIXCHECK # undef expl # if HAVE_RAW_DECL_EXPL @@ -693,7 +714,7 @@ _GL_FUNCDECL_SYS (exp2, double, (double x)); _GL_CXXALIAS_SYS (exp2, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (exp2); +_GL_CXXALIASWARN1 (exp2, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef exp2 @@ -766,7 +787,7 @@ _GL_FUNCDECL_SYS (expm1, double, (double x)); _GL_CXXALIAS_SYS (expm1, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (expm1); +_GL_CXXALIASWARN1 (expm1, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef expm1 @@ -809,7 +830,9 @@ _GL_WARN_ON_USE (expm1l, "expm1l is unportable - " _GL_FUNCDECL_SYS (fabsf, float, (float x)); # endif _GL_CXXALIAS_SYS (fabsf, float, (float x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fabsf); +# endif #elif defined GNULIB_POSIXCHECK # undef fabsf # if HAVE_RAW_DECL_FABSF @@ -833,7 +856,9 @@ _GL_FUNCDECL_SYS (fabsl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (fabsl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fabsl); +# endif #elif defined GNULIB_POSIXCHECK # undef fabsl # if HAVE_RAW_DECL_FABSL @@ -879,7 +904,7 @@ _GL_CXXALIAS_RPL (floor, double, (double x)); _GL_CXXALIAS_SYS (floor, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (floor); +_GL_CXXALIASWARN1 (floor, double, (double x)); # endif #endif @@ -898,7 +923,9 @@ _GL_FUNCDECL_SYS (floorl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (floorl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (floorl); +# endif #elif defined GNULIB_POSIXCHECK # undef floorl # if HAVE_RAW_DECL_FLOORL @@ -948,7 +975,7 @@ _GL_FUNCDECL_SYS (fma, double, (double x, double y, double z)); _GL_CXXALIAS_SYS (fma, double, (double x, double y, double z)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (fma); +_GL_CXXALIASWARN1 (fma, double, (double x, double y, double z)); # endif #elif defined GNULIB_POSIXCHECK # undef fma @@ -1025,7 +1052,7 @@ _GL_CXXALIAS_RPL (fmod, double, (double x, double y)); _GL_CXXALIAS_SYS (fmod, double, (double x, double y)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (fmod); +_GL_CXXALIASWARN1 (fmod, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef fmod @@ -1050,7 +1077,9 @@ _GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y)); # endif _GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fmodl); +# endif #elif defined GNULIB_POSIXCHECK # undef fmodl # if HAVE_RAW_DECL_FMODL @@ -1082,7 +1111,9 @@ _GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2))); # endif _GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (frexpf); +# endif #elif defined GNULIB_POSIXCHECK # undef frexpf # if HAVE_RAW_DECL_FREXPF @@ -1144,7 +1175,9 @@ _GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr)); # endif #endif #if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@) +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (frexpl); +# endif #endif #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK # undef frexpl @@ -1170,7 +1203,9 @@ _GL_FUNCDECL_SYS (hypotf, float, (float x, float y)); # endif _GL_CXXALIAS_SYS (hypotf, float, (float x, float y)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (hypotf); +# endif #elif defined GNULIB_POSIXCHECK # undef hypotf # if HAVE_RAW_DECL_HYPOTF @@ -1192,7 +1227,7 @@ _GL_CXXALIAS_RPL (hypot, double, (double x, double y)); _GL_CXXALIAS_SYS (hypot, double, (double x, double y)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (hypot); +_GL_CXXALIASWARN1 (hypot, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef hypot @@ -1217,7 +1252,9 @@ _GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y)); # endif _GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (hypotl); +# endif #elif defined GNULIB_POSIXCHECK # undef hypotl # if HAVE_RAW_DECL_HYPOTL @@ -1265,7 +1302,7 @@ _GL_FUNCDECL_SYS (ilogb, int, (double x)); _GL_CXXALIAS_SYS (ilogb, int, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (ilogb); +_GL_CXXALIASWARN1 (ilogb, int, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef ilogb @@ -1299,6 +1336,55 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - " #endif +#if @GNULIB_MDA_J0@ +/* On native Windows, map 'j0' to '_j0', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::j0 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef j0 +# define j0 _j0 +# endif +_GL_CXXALIAS_MDA (j0, double, (double x)); +# else +_GL_CXXALIAS_SYS (j0, double, (double x)); +# endif +_GL_CXXALIASWARN (j0); +#endif + +#if @GNULIB_MDA_J1@ +/* On native Windows, map 'j1' to '_j1', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::j1 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef j1 +# define j1 _j1 +# endif +_GL_CXXALIAS_MDA (j1, double, (double x)); +# else +_GL_CXXALIAS_SYS (j1, double, (double x)); +# endif +_GL_CXXALIASWARN (j1); +#endif + +#if @GNULIB_MDA_JN@ +/* On native Windows, map 'jn' to '_jn', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::jn always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef jn +# define jn _jn +# endif +_GL_CXXALIAS_MDA (jn, double, (int n, double x)); +# else +_GL_CXXALIAS_SYS (jn, double, (int n, double x)); +# endif +_GL_CXXALIASWARN (jn); +#endif + + /* Return x * 2^exp. */ #if @GNULIB_LDEXPF@ # if !@HAVE_LDEXPF@ @@ -1306,7 +1392,9 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - " _GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp)); # endif _GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ldexpf); +# endif #elif defined GNULIB_POSIXCHECK # undef ldexpf # if HAVE_RAW_DECL_LDEXPF @@ -1332,7 +1420,9 @@ _GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp)); # endif #endif #if @GNULIB_LDEXPL@ +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ldexpl); +# endif #endif #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK # undef ldexpl @@ -1379,7 +1469,7 @@ _GL_CXXALIAS_RPL (log, double, (double x)); _GL_CXXALIAS_SYS (log, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log); +_GL_CXXALIASWARN1 (log, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log @@ -1404,7 +1494,9 @@ _GL_FUNCDECL_SYS (logl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (logl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (logl); +# endif #elif defined GNULIB_POSIXCHECK # undef logl # if HAVE_RAW_DECL_LOGL @@ -1450,7 +1542,7 @@ _GL_CXXALIAS_RPL (log10, double, (double x)); _GL_CXXALIAS_SYS (log10, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log10); +_GL_CXXALIASWARN1 (log10, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log10 @@ -1475,7 +1567,9 @@ _GL_FUNCDECL_SYS (log10l, long double, (long double x)); # endif _GL_CXXALIAS_SYS (log10l, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (log10l); +# endif #elif defined GNULIB_POSIXCHECK # undef log10l # if HAVE_RAW_DECL_LOG10L @@ -1523,7 +1617,7 @@ _GL_FUNCDECL_SYS (log1p, double, (double x)); _GL_CXXALIAS_SYS (log1p, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log1p); +_GL_CXXALIASWARN1 (log1p, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log1p @@ -1597,7 +1691,7 @@ _GL_FUNCDECL_SYS (log2, double, (double x)); _GL_CXXALIAS_SYS (log2, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log2); +_GL_CXXALIASWARN1 (log2, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log2 @@ -1669,7 +1763,7 @@ _GL_FUNCDECL_SYS (logb, double, (double x)); _GL_CXXALIAS_SYS (logb, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (logb); +_GL_CXXALIASWARN1 (logb, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef logb @@ -1739,7 +1833,7 @@ _GL_CXXALIAS_RPL (modf, double, (double x, double *iptr)); _GL_CXXALIAS_SYS (modf, double, (double x, double *iptr)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (modf); +_GL_CXXALIASWARN1 (modf, double, (double x, double *iptr)); # endif #elif defined GNULIB_POSIXCHECK # undef modf @@ -1766,7 +1860,9 @@ _GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr) # endif _GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (modfl); +# endif #elif defined GNULIB_POSIXCHECK # undef modfl # if HAVE_RAW_DECL_MODFL @@ -1830,7 +1926,7 @@ _GL_FUNCDECL_SYS (remainder, double, (double x, double y)); _GL_CXXALIAS_SYS (remainder, double, (double x, double y)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (remainder); +_GL_CXXALIASWARN1 (remainder, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef remainder @@ -1887,7 +1983,7 @@ _GL_FUNCDECL_SYS (rint, double, (double x)); # endif _GL_CXXALIAS_SYS (rint, double, (double x)); # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (rint); +_GL_CXXALIASWARN1 (rint, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef rint @@ -1959,7 +2055,7 @@ _GL_FUNCDECL_SYS (round, double, (double x)); _GL_CXXALIAS_SYS (round, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (round); +_GL_CXXALIASWARN1 (round, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef round @@ -2026,7 +2122,9 @@ _GL_WARN_ON_USE (sinf, "sinf is unportable - " _GL_FUNCDECL_SYS (sinl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (sinl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (sinl); +# endif #elif defined GNULIB_POSIXCHECK # undef sinl # if HAVE_RAW_DECL_SINL @@ -2100,7 +2198,9 @@ _GL_FUNCDECL_SYS (sqrtl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (sqrtl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (sqrtl); +# endif #elif defined GNULIB_POSIXCHECK # undef sqrtl # if HAVE_RAW_DECL_SQRTL @@ -2140,7 +2240,9 @@ _GL_WARN_ON_USE (tanf, "tanf is unportable - " _GL_FUNCDECL_SYS (tanl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (tanl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (tanl); +# endif #elif defined GNULIB_POSIXCHECK # undef tanl # if HAVE_RAW_DECL_TANL @@ -2213,7 +2315,7 @@ _GL_FUNCDECL_SYS (trunc, double, (double x)); _GL_CXXALIAS_SYS (trunc, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (trunc); +_GL_CXXALIASWARN1 (trunc, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef trunc @@ -2247,6 +2349,55 @@ _GL_WARN_ON_USE (truncl, "truncl is unportable - " #endif +#if @GNULIB_MDA_Y0@ +/* On native Windows, map 'y0' to '_y0', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::y0 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef y0 +# define y0 _y0 +# endif +_GL_CXXALIAS_MDA (y0, double, (double x)); +# else +_GL_CXXALIAS_SYS (y0, double, (double x)); +# endif +_GL_CXXALIASWARN (y0); +#endif + +#if @GNULIB_MDA_Y1@ +/* On native Windows, map 'y1' to '_y1', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::y1 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef y1 +# define y1 _y1 +# endif +_GL_CXXALIAS_MDA (y1, double, (double x)); +# else +_GL_CXXALIAS_SYS (y1, double, (double x)); +# endif +_GL_CXXALIASWARN (y1); +#endif + +#if @GNULIB_MDA_YN@ +/* On native Windows, map 'yn' to '_yn', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::yn always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef yn +# define yn _yn +# endif +_GL_CXXALIAS_MDA (yn, double, (int n, double x)); +# else +_GL_CXXALIAS_SYS (yn, double, (int n, double x)); +# endif +_GL_CXXALIASWARN (yn); +#endif + + /* Definitions of function-like macros come here, after the function declarations. */ @@ -2266,7 +2417,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x); # if defined isfinite || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite) # undef isfinite -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's <cmath> possibly defines isfinite through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool) @@ -2300,7 +2451,7 @@ _GL_EXTERN_C int gl_isinfl (long double x); # if defined isinf || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf) # undef isinf -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's <cmath> possibly defines isinf through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool) @@ -2324,10 +2475,11 @@ _GL_WARN_REAL_FLOATING_DECL (isinf); # if @HAVE_ISNANF@ /* The original <math.h> included above provides a declaration of isnan macro or (older) isnanf function. */ -# if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanf)) - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */ # undef isnanf -# define isnanf(x) __builtin_isnanf ((float)(x)) +# define isnanf(x) __builtin_isnan ((float)(x)) # elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -2347,8 +2499,8 @@ _GL_EXTERN_C int isnanf (float x); # if @HAVE_ISNAND@ /* The original <math.h> included above provides a declaration of isnan macro. */ -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */ # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) # else @@ -2368,10 +2520,11 @@ _GL_EXTERN_C int isnand (double x); # if @HAVE_ISNANL@ /* The original <math.h> included above provides a declaration of isnan macro or (older) isnanl function. */ -# if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl)) - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */ # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) # elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -2391,20 +2544,20 @@ _GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST; isnanf.h (e.g.) here, because those may end up being macros that recursively expand back to isnan. So use the gnulib replacements for them directly. */ -# if @HAVE_ISNANF@ && __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanf)) -# define gl_isnan_f(x) __builtin_isnanf ((float)(x)) +# if @HAVE_ISNANF@ && (__GNUC__ >= 4) || (__clang_major__ >= 4) +# define gl_isnan_f(x) __builtin_isnan ((float)(x)) # else _GL_EXTERN_C int rpl_isnanf (float x); # define gl_isnan_f(x) rpl_isnanf (x) # endif -# if @HAVE_ISNAND@ && __GNUC__ >= 4 +# if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4) # define gl_isnan_d(x) __builtin_isnan ((double)(x)) # else _GL_EXTERN_C int rpl_isnand (double x); # define gl_isnan_d(x) rpl_isnand (x) # endif -# if @HAVE_ISNANL@ && __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl)) -# define gl_isnan_l(x) __builtin_isnanl ((long double)(x)) +# if @HAVE_ISNANL@ && (__GNUC__ >= 4) || (__clang_major__ >= 4) +# define gl_isnan_l(x) __builtin_isnan ((long double)(x)) # else _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST; # define gl_isnan_l(x) rpl_isnanl (x) @@ -2414,18 +2567,18 @@ _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST; (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \ sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ gl_isnan_f (x)) -# elif __GNUC__ >= 4 && (!defined __clang__ || (__has_builtin (__builtin_isnanf) && __has_builtin (__builtin_isnanl))) +# elif (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnan # define isnan(x) \ - (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \ + (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \ sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \ - __builtin_isnanf ((float)(x))) + __builtin_isnan ((float)(x))) # endif # ifdef __cplusplus # if defined isnan || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan) # undef isnan -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || (defined __FreeBSD__ && __clang_major__ < 7) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's <cmath> possibly defines isnan through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool) @@ -2450,10 +2603,10 @@ _GL_WARN_REAL_FLOATING_DECL (isnan); #if @GNULIB_SIGNBIT@ -# if (@REPLACE_SIGNBIT_USING_GCC@ \ +# if (@REPLACE_SIGNBIT_USING_BUILTINS@ \ && (!defined __cplusplus || __cplusplus < 201103)) # undef signbit - /* GCC 4.0 and newer provides three built-ins for signbit. */ + /* GCC >= 4.0 and clang provide three built-ins for signbit. */ # define signbit(x) \ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ @@ -2464,7 +2617,7 @@ _GL_WARN_REAL_FLOATING_DECL (isnan); _GL_EXTERN_C int gl_signbitf (float arg); _GL_EXTERN_C int gl_signbitd (double arg); _GL_EXTERN_C int gl_signbitl (long double arg); -# if __GNUC__ >= 2 && !defined __STRICT_ANSI__ +# if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__ # define _GL_NUM_UINT_WORDS(type) \ ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) # if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf @@ -2508,7 +2661,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg); # if defined signbit || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit) # undef signbit -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's <cmath> possibly defines signbit through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool) @@ -2529,4 +2682,5 @@ _GL_WARN_REAL_FLOATING_DECL (signbit); _GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_MATH_H */ +#endif /* _GL_INCLUDING_MATH_H */ #endif /* _@GUARD_PREFIX@_MATH_H */ diff --git a/gnulib/import/mbrtowc-impl-utf8.h b/gnulib/import/mbrtowc-impl-utf8.h index a826b1b..4f3bbb3 100644 --- a/gnulib/import/mbrtowc-impl-utf8.h +++ b/gnulib/import/mbrtowc-impl-utf8.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/mbrtowc-impl.h b/gnulib/import/mbrtowc-impl.h index c970439..eab0416 100644 --- a/gnulib/import/mbrtowc-impl.h +++ b/gnulib/import/mbrtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/mbrtowc.c b/gnulib/import/mbrtowc.c index a71d394..caf7cb6 100644 --- a/gnulib/import/mbrtowc.c +++ b/gnulib/import/mbrtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/mbsinit.c b/gnulib/import/mbsinit.c index 981a894..b6e9841 100644 --- a/gnulib/import/mbsinit.c +++ b/gnulib/import/mbsinit.c @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/mbsrtowcs-impl.h b/gnulib/import/mbsrtowcs-impl.h index 06ecec2..0d544b0 100644 --- a/gnulib/import/mbsrtowcs-impl.h +++ b/gnulib/import/mbsrtowcs-impl.h @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/mbsrtowcs-state.c b/gnulib/import/mbsrtowcs-state.c index aca1ad8..328e9a8 100644 --- a/gnulib/import/mbsrtowcs-state.c +++ b/gnulib/import/mbsrtowcs-state.c @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/mbsrtowcs.c b/gnulib/import/mbsrtowcs.c index 6d1c685..c2bfdd2 100644 --- a/gnulib/import/mbsrtowcs.c +++ b/gnulib/import/mbsrtowcs.c @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/mbtowc-impl.h b/gnulib/import/mbtowc-impl.h index 22e414a..bfcf5cc 100644 --- a/gnulib/import/mbtowc-impl.h +++ b/gnulib/import/mbtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/mbtowc-lock.c b/gnulib/import/mbtowc-lock.c index 85ad3c4..27b1643 100644 --- a/gnulib/import/mbtowc-lock.c +++ b/gnulib/import/mbtowc-lock.c @@ -1,5 +1,5 @@ /* Return the internal lock used by mbrtowc and mbrtoc32. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/mbtowc-lock.h b/gnulib/import/mbtowc-lock.h index e101978..696b12c 100644 --- a/gnulib/import/mbtowc-lock.h +++ b/gnulib/import/mbtowc-lock.h @@ -1,5 +1,5 @@ /* Use the internal lock used by mbrtowc and mbrtoc32. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/mbtowc.c b/gnulib/import/mbtowc.c index 5fc2d28..ef217c6 100644 --- a/gnulib/import/mbtowc.c +++ b/gnulib/import/mbtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/memchr.c b/gnulib/import/memchr.c index bff63da..cacaf18 100644 --- a/gnulib/import/memchr.c +++ b/gnulib/import/memchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2020 +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), diff --git a/gnulib/import/memchr.valgrind b/gnulib/import/memchr.valgrind index f6dd209..c0a53db 100644 --- a/gnulib/import/memchr.valgrind +++ b/gnulib/import/memchr.valgrind @@ -1,6 +1,6 @@ # Suppress a valgrind message about use of uninitialized memory in memchr(). -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/memmem.c b/gnulib/import/memmem.c index 6f65742..87266fa 100644 --- a/gnulib/import/memmem.c +++ b/gnulib/import/memmem.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2020 Free Software +/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/mempcpy.c b/gnulib/import/mempcpy.c index fe832d7..fea618a 100644 --- a/gnulib/import/mempcpy.c +++ b/gnulib/import/mempcpy.c @@ -1,5 +1,5 @@ /* Copy memory area and return pointer after last written byte. - Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/memrchr.c b/gnulib/import/memrchr.c index 7ff32e1..dcd24fa 100644 --- a/gnulib/import/memrchr.c +++ b/gnulib/import/memrchr.c @@ -1,6 +1,6 @@ /* memrchr -- find the last occurrence of a byte in a memory block - Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2020 Free Software + Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2021 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), diff --git a/gnulib/import/minmax.h b/gnulib/import/minmax.h index b947776..eb9fb09 100644 --- a/gnulib/import/minmax.h +++ b/gnulib/import/minmax.h @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2020 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/mkdir.c b/gnulib/import/mkdir.c index c0d4b61..d508db6 100644 --- a/gnulib/import/mkdir.c +++ b/gnulib/import/mkdir.c @@ -1,7 +1,7 @@ /* On some systems, mkdir ("foo/", 0700) fails because of the trailing slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001, 2003, 2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ rpl_mkdir (char const *dir, mode_t mode maybe_unused) || (last[1] == '.' && last[2] == '\0'))) { struct stat st; - if (stat (tmp_dir, &st) == 0) + if (stat (tmp_dir, &st) == 0 || errno == EOVERFLOW) errno = EEXIST; return -1; } diff --git a/gnulib/import/mkdtemp.c b/gnulib/import/mkdtemp.c index 6aae798..8ed805b 100644 --- a/gnulib/import/mkdtemp.c +++ b/gnulib/import/mkdtemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2020 Free Software +/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/mkostemp.c b/gnulib/import/mkostemp.c index 46b58e1..9d733dd 100644 --- a/gnulib/import/mkostemp.c +++ b/gnulib/import/mkostemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2020 Free Software +/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2021 Free Software Foundation, Inc. This file is derived from the one in the GNU C Library. diff --git a/gnulib/import/msvc-inval.c b/gnulib/import/msvc-inval.c index 8636688..658c4e3 100644 --- a/gnulib/import/msvc-inval.c +++ b/gnulib/import/msvc-inval.c @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/msvc-inval.h b/gnulib/import/msvc-inval.h index 93ee785..46404ae 100644 --- a/gnulib/import/msvc-inval.h +++ b/gnulib/import/msvc-inval.h @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/msvc-nothrow.c b/gnulib/import/msvc-nothrow.c index bf93b88..e893ed6 100644 --- a/gnulib/import/msvc-nothrow.c +++ b/gnulib/import/msvc-nothrow.c @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/msvc-nothrow.h b/gnulib/import/msvc-nothrow.h index fca54157..a1979dd 100644 --- a/gnulib/import/msvc-nothrow.h +++ b/gnulib/import/msvc-nothrow.h @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/netinet_in.in.h b/gnulib/import/netinet_in.in.h index 84ad215..f091d5c 100644 --- a/gnulib/import/netinet_in.in.h +++ b/gnulib/import/netinet_in.in.h @@ -1,5 +1,5 @@ /* Substitute for <netinet/in.h>. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/open.c b/gnulib/import/open.c index 751b42d..8599185 100644 --- a/gnulib/import/open.c +++ b/gnulib/import/open.c @@ -1,5 +1,5 @@ /* Open a descriptor to a file. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,11 @@ static int orig_open (const char *filename, int flags, mode_t mode) { +#if defined _WIN32 && !defined __CYGWIN__ + return _open (filename, flags, mode); +#else return open (filename, flags, mode); +#endif } /* Specification. */ diff --git a/gnulib/import/openat-die.c b/gnulib/import/openat-die.c index fd96dd7..f30e210 100644 --- a/gnulib/import/openat-die.c +++ b/gnulib/import/openat-die.c @@ -1,6 +1,6 @@ /* Report a save- or restore-cwd failure in our openat replacement and then exit. - Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/openat-priv.h b/gnulib/import/openat-priv.h index 5b824f7..5c42d03 100644 --- a/gnulib/import/openat-priv.h +++ b/gnulib/import/openat-priv.h @@ -1,6 +1,6 @@ /* Internals for openat-like functions. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/openat-proc.c b/gnulib/import/openat-proc.c index b5aaee8..4f8be90 100644 --- a/gnulib/import/openat-proc.c +++ b/gnulib/import/openat-proc.c @@ -1,6 +1,6 @@ /* Create /proc/self/fd-related names for subfiles of open directories. - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/openat.c b/gnulib/import/openat.c index baf6566..ac92374 100644 --- a/gnulib/import/openat.c +++ b/gnulib/import/openat.c @@ -1,5 +1,5 @@ /* provide a replacement openat function - Copyright (C) 2004-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/openat.h b/gnulib/import/openat.h index 824ce56..7098124 100644 --- a/gnulib/import/openat.h +++ b/gnulib/import/openat.h @@ -1,5 +1,5 @@ /* provide a replacement openat function - Copyright (C) 2004-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/opendir.c b/gnulib/import/opendir.c index 500fa44..480b96b 100644 --- a/gnulib/import/opendir.c +++ b/gnulib/import/opendir.c @@ -1,5 +1,5 @@ /* Start reading the entries of a directory. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/pathmax.h b/gnulib/import/pathmax.h index 15a236f..49cf462 100644 --- a/gnulib/import/pathmax.h +++ b/gnulib/import/pathmax.h @@ -1,5 +1,5 @@ /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2020 Free Software + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/pipe-safer.c b/gnulib/import/pipe-safer.c index 5a597c5..efa4bd6 100644 --- a/gnulib/import/pipe-safer.c +++ b/gnulib/import/pipe-safer.c @@ -1,5 +1,5 @@ /* Invoke pipe, but avoid some glitches. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,6 @@ int pipe_safer (int fd[2]) { -#if HAVE_PIPE if (pipe (fd) == 0) { int i; @@ -39,18 +38,15 @@ pipe_safer (int fd[2]) fd[i] = fd_safer (fd[i]); if (fd[i] < 0) { - int e = errno; + int saved_errno = errno; close (fd[1 - i]); - errno = e; + errno = saved_errno; return -1; } } return 0; } -#else - errno = ENOSYS; -#endif return -1; } diff --git a/gnulib/import/pipe.c b/gnulib/import/pipe.c new file mode 100644 index 0000000..584965a --- /dev/null +++ b/gnulib/import/pipe.c @@ -0,0 +1,50 @@ +/* Create a pipe. + Copyright (C) 2009-2021 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#if defined _WIN32 && ! defined __CYGWIN__ +/* Native Windows API. */ + +/* Get _pipe(). */ +# include <io.h> + +/* Get _O_BINARY. */ +# include <fcntl.h> + +int +pipe (int fd[2]) +{ + /* Mingw changes fd to {-1,-1} on failure, but this violates + http://austingroupbugs.net/view.php?id=467 */ + int tmp[2]; + int result = _pipe (tmp, 4096, _O_BINARY); + if (!result) + { + fd[0] = tmp[0]; + fd[1] = tmp[1]; + } + return result; +} + +#else + +# error "This platform lacks a pipe function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib." + +#endif diff --git a/gnulib/import/rawmemchr.c b/gnulib/import/rawmemchr.c index 04bf084..bbb250f 100644 --- a/gnulib/import/rawmemchr.c +++ b/gnulib/import/rawmemchr.c @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/rawmemchr.valgrind b/gnulib/import/rawmemchr.valgrind index 53c5b31..087d5e4 100644 --- a/gnulib/import/rawmemchr.valgrind +++ b/gnulib/import/rawmemchr.valgrind @@ -1,6 +1,6 @@ # Suppress a valgrind message about use of uninitialized memory in rawmemchr(). -# Copyright (C) 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 2008-2021 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/readdir.c b/gnulib/import/readdir.c index 91a3516..723198e 100644 --- a/gnulib/import/readdir.c +++ b/gnulib/import/readdir.c @@ -1,5 +1,5 @@ /* Read the next entry of a directory. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/readlink.c b/gnulib/import/readlink.c index 4d392ef..c4b635c 100644 --- a/gnulib/import/readlink.c +++ b/gnulib/import/readlink.c @@ -1,5 +1,5 @@ -/* Stub for readlink(). - Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc. +/* Read the contents of a symbolic link. + Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ such as DJGPP 2.03 and mingw32. */ ssize_t -readlink (const char *name, char *buf _GL_UNUSED, +readlink (char const *file, char *buf _GL_UNUSED, size_t bufsize _GL_UNUSED) { struct stat statbuf; @@ -37,7 +37,7 @@ readlink (const char *name, char *buf _GL_UNUSED, /* In general we should use lstat() here, not stat(). But on platforms without symbolic links, lstat() - if it exists - would be equivalent to stat(), therefore we can use stat(). This saves us a configure check. */ - if (stat (name, &statbuf) >= 0) + if (stat (file, &statbuf) >= 0) errno = EINVAL; return -1; } @@ -51,24 +51,54 @@ readlink (const char *name, char *buf _GL_UNUSED, for Solaris 9. */ ssize_t -rpl_readlink (const char *name, char *buf, size_t bufsize) +rpl_readlink (char const *file, char *buf, size_t bufsize) { # if READLINK_TRAILING_SLASH_BUG - size_t len = strlen (name); - if (len && name[len - 1] == '/') + size_t file_len = strlen (file); + if (file_len && file[file_len - 1] == '/') { - /* Even if name without the slash is a symlink to a directory, + /* Even if FILE without the slash is a symlink to a directory, both lstat() and stat() must resolve the trailing slash to the directory rather than the symlink. We can therefore safely use stat() to distinguish between EINVAL and ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */ struct stat st; - if (stat (name, &st) == 0) + if (stat (file, &st) == 0 || errno == EOVERFLOW) errno = EINVAL; return -1; } # endif /* READLINK_TRAILING_SLASH_BUG */ - return readlink (name, buf, bufsize); + + ssize_t r = readlink (file, buf, bufsize); + +# if READLINK_TRUNCATE_BUG + if (r < 0 && errno == ERANGE) + { + /* Try again with a bigger buffer. This is just for test cases; + real code invariably discards short reads. */ + char stackbuf[4032]; + r = readlink (file, stackbuf, sizeof stackbuf); + if (r < 0) + { + if (errno == ERANGE) + { + /* Clear the buffer, which is good enough for real code. + Thankfully, no test cases try short reads of enormous + symlinks and what would be the point anyway? */ + r = bufsize; + memset (buf, 0, r); + } + } + else + { + if (bufsize < r) + r = bufsize; + memcpy (buf, stackbuf, r); + } + } +# endif + + return r; } #endif /* HAVE_READLINK */ diff --git a/gnulib/import/realloc.c b/gnulib/import/realloc.c index a24054d..35caeab 100644 --- a/gnulib/import/realloc.c +++ b/gnulib/import/realloc.c @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2020 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/rename.c b/gnulib/import/rename.c index 108dc40..e0f417d 100644 --- a/gnulib/import/rename.c +++ b/gnulib/import/rename.c @@ -1,6 +1,6 @@ /* Work around rename bugs in some systems. - Copyright (C) 2001-2003, 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/rewinddir.c b/gnulib/import/rewinddir.c index a18943d..26fbbac 100644 --- a/gnulib/import/rewinddir.c +++ b/gnulib/import/rewinddir.c @@ -1,5 +1,5 @@ /* Restart reading the entries of a directory from the beginning. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/rmdir.c b/gnulib/import/rmdir.c index 2155224..3cca0ce 100644 --- a/gnulib/import/rmdir.c +++ b/gnulib/import/rmdir.c @@ -1,6 +1,6 @@ /* Work around rmdir bugs. - Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2020 Free Software + Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -26,6 +26,9 @@ #include "filename.h" #undef rmdir +#if defined _WIN32 && !defined __CYGWIN__ +# define rmdir _rmdir +#endif /* Remove directory DIR. Return 0 if successful, -1 if not. */ diff --git a/gnulib/import/same-inode.h b/gnulib/import/same-inode.h index 09c339a..cf1c96e 100644 --- a/gnulib/import/same-inode.h +++ b/gnulib/import/same-inode.h @@ -1,6 +1,6 @@ /* Determine whether two stat buffers are known to refer to the same file. - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/save-cwd.c b/gnulib/import/save-cwd.c index c2608d5..0a18bc5 100644 --- a/gnulib/import/save-cwd.c +++ b/gnulib/import/save-cwd.c @@ -1,6 +1,6 @@ /* save-cwd.c -- Save and restore current working directory. - Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2020 Free Software + Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/save-cwd.h b/gnulib/import/save-cwd.h index db8bfd2..3cefba5 100644 --- a/gnulib/import/save-cwd.h +++ b/gnulib/import/save-cwd.h @@ -1,6 +1,6 @@ /* Save and restore current working directory. - Copyright (C) 1995, 1997-1998, 2003, 2009-2020 Free Software Foundation, + Copyright (C) 1995, 1997-1998, 2003, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/scratch_buffer.h b/gnulib/import/scratch_buffer.h index 4c0db3e..3e2b5ef 100644 --- a/gnulib/import/scratch_buffer.h +++ b/gnulib/import/scratch_buffer.h @@ -1,3 +1,21 @@ +/* Variable-sized buffer with on-stack default allocation. + Copyright (C) 2017-2021 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, 2017. */ + #ifndef _GL_SCRATCH_BUFFER_H #define _GL_SCRATCH_BUFFER_H diff --git a/gnulib/import/setenv.c b/gnulib/import/setenv.c index d03bc5a..78c7aaa 100644 --- a/gnulib/import/setenv.c +++ b/gnulib/import/setenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2003, 2005-2020 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2003, 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify @@ -72,7 +72,7 @@ __libc_lock_define_initialized (static, envlock) values are from a small set. Outside glibc this will eat up all memory after a while. */ #if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \ - && defined __GNUC__) + && (defined __GNUC__ || defined __clang__)) # define USE_TSEARCH 1 # include <search.h> typedef int (*compar_fn_t) (const void *, const void *); diff --git a/gnulib/import/setlocale-lock.c b/gnulib/import/setlocale-lock.c index 7dde32d..5474ae0 100644 --- a/gnulib/import/setlocale-lock.c +++ b/gnulib/import/setlocale-lock.c @@ -1,5 +1,5 @@ /* Return the internal lock used by setlocale_null_r. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/setlocale_null.c b/gnulib/import/setlocale_null.c index abe55b5..059af4e 100644 --- a/gnulib/import/setlocale_null.c +++ b/gnulib/import/setlocale_null.c @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/setlocale_null.h b/gnulib/import/setlocale_null.h index 6844be5..5f45856 100644 --- a/gnulib/import/setlocale_null.h +++ b/gnulib/import/setlocale_null.h @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/signal.in.h b/gnulib/import/signal.in.h index c94b053..ed01d67 100644 --- a/gnulib/import/signal.in.h +++ b/gnulib/import/signal.in.h @@ -1,6 +1,6 @@ /* A GNU-like <signal.h>. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,13 +55,13 @@ #ifndef _@GUARD_PREFIX@_SIGNAL_H #define _@GUARD_PREFIX@_SIGNAL_H -/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android - declare pthread_sigmask in <pthread.h>, not in <signal.h>. +/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android, + OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>. But avoid namespace pollution on glibc systems.*/ #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ && ((defined __APPLE__ && defined __MACH__) \ || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \ - || defined __sun || defined __ANDROID__) \ + || defined __sun || defined __ANDROID__ || defined __KLIBC__) \ && ! defined __GLIBC__ # include <pthread.h> #endif diff --git a/gnulib/import/stat-time.h b/gnulib/import/stat-time.h index 884ffd8..523ed21 100644 --- a/gnulib/import/stat-time.h +++ b/gnulib/import/stat-time.h @@ -1,6 +1,6 @@ /* stat-related time functions. - Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/stat-w32.c b/gnulib/import/stat-w32.c index 19bdfaa..914707e 100644 --- a/gnulib/import/stat-w32.c +++ b/gnulib/import/stat-w32.c @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,10 +20,22 @@ #if defined _WIN32 && ! defined __CYGWIN__ -/* Ensure that <windows.h> defines FILE_ID_INFO. */ -#if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8) -# undef _WIN32_WINNT -# define _WIN32_WINNT _WIN32_WINNT_WIN8 +/* Attempt to make <windows.h> define FILE_ID_INFO. + But ensure that the redefinition of _WIN32_WINNT does not make us assume + Windows Vista or newer when building for an older version of Windows. */ +#if HAVE_SDKDDKVER_H +# include <sdkddkver.h> +# if _WIN32_WINNT >= _WIN32_WINNT_VISTA +# define WIN32_ASSUME_VISTA 1 +# else +# define WIN32_ASSUME_VISTA 0 +# endif +# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8) +# undef _WIN32_WINNT +# define _WIN32_WINNT _WIN32_WINNT_WIN8 +# endif +#else +# define WIN32_ASSUME_VISTA (_WIN32_WINNT >= _WIN32_WINNT_VISTA) #endif #include <sys/types.h> @@ -46,7 +58,12 @@ #undef GetFinalPathNameByHandle #define GetFinalPathNameByHandle GetFinalPathNameByHandleA -#if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA) +/* Older mingw headers do not define VOLUME_NAME_NONE. */ +#ifndef VOLUME_NAME_NONE +# define VOLUME_NAME_NONE 4 +#endif + +#if !WIN32_ASSUME_VISTA /* Avoid warnings from gcc -Wcast-function-type. */ # define GetProcAddress \ @@ -149,7 +166,7 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) DWORD type = GetFileType (h); if (type == FILE_TYPE_DISK) { -#if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA) +#if !WIN32_ASSUME_VISTA if (!initialized) initialize (); #endif diff --git a/gnulib/import/stat-w32.h b/gnulib/import/stat-w32.h index 491a754..27b4e47 100644 --- a/gnulib/import/stat-w32.h +++ b/gnulib/import/stat-w32.h @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/stat.c b/gnulib/import/stat.c index 9d3965d..505368f 100644 --- a/gnulib/import/stat.c +++ b/gnulib/import/stat.c @@ -1,5 +1,5 @@ /* Work around platform bugs in stat. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/stdalign.in.h b/gnulib/import/stdalign.in.h index cd786be..eae9d13 100644 --- a/gnulib/import/stdalign.in.h +++ b/gnulib/import/stdalign.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C11 <stdalign.h>. - Copyright 2011-2020 Free Software Foundation, Inc. + Copyright 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,11 +34,12 @@ requirement of a structure member (i.e., slot or field) that is of type TYPE, as an integer constant expression. - This differs from GCC's __alignof__ operator, which can yield a - better-performing alignment for an object of that type. For - example, on x86 with GCC, __alignof__ (double) and __alignof__ - (long long) are 8, whereas alignof (double) and alignof (long long) - are 4 unless the option '-malign-double' is used. + This differs from GCC's and clang's __alignof__ operator, which can + yield a better-performing alignment for an object of that type. For + example, on x86 with GCC and on Linux/x86 with clang, + __alignof__ (double) and __alignof__ (long long) are 8, whereas + alignof (double) and alignof (long long) are 4 unless the option + '-malign-double' is used. The result cannot be used as a value for an 'enum' constant, if you want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. @@ -53,9 +54,12 @@ #undef _Alignof /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 - <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. + clang versions < 8.0.0 have the same bug. */ #if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ - || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9))) + || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ + && !defined __clang__) \ + || (defined __clang__ && __clang_major__ < 8)) # ifdef __cplusplus # if 201103 <= __cplusplus # define _Alignof(type) alignof (type) @@ -102,8 +106,9 @@ # define _Alignas(a) alignas (a) # elif ((defined __APPLE__ && defined __MACH__ \ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + : __GNUC__ && !defined __ibmxl__) \ + || (4 <= __clang_major__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) # define _Alignas(a) __attribute__ ((__aligned__ (a))) # elif 1300 <= _MSC_VER diff --git a/gnulib/import/stdbool.in.h b/gnulib/import/stdbool.in.h index baacf98..28e0a53 100644 --- a/gnulib/import/stdbool.in.h +++ b/gnulib/import/stdbool.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2003, 2006-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2003, 2006-2021 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/stddef.in.h b/gnulib/import/stddef.in.h index 2e50a1f..3a0052d 100644 --- a/gnulib/import/stddef.in.h +++ b/gnulib/import/stddef.in.h @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,6 +49,23 @@ # ifndef _@GUARD_PREFIX@_STDDEF_H +/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a + type with alignment 4, but 'long' has alignment 8. */ +# if defined _AIX && defined _ARCH_PPC64 +# if !GNULIB_defined_max_align_t +# ifdef _MAX_ALIGN_T +/* /usr/include/stddef.h has already defined max_align_t. Override it. */ +typedef long rpl_max_align_t; +# define max_align_t rpl_max_align_t +# else +/* Prevent /usr/include/stddef.h from defining max_align_t. */ +typedef long max_align_t; +# define _MAX_ALIGN_T +# endif +# define GNULIB_defined_max_align_t 1 +# endif +# endif + /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -97,7 +114,7 @@ and the C11 standard allows this. Work around this problem by using __alignof__ (which returns 8 for double) rather than _Alignof (which returns 4), and align each union member accordingly. */ -# ifdef __GNUC__ +# if defined __GNUC__ || (__clang_major__ >= 4) # define _GL_STDDEF_ALIGNAS(type) \ __attribute__ ((__aligned__ (__alignof__ (type)))) # else diff --git a/gnulib/import/stdint.in.h b/gnulib/import/stdint.in.h index 994c0c7..7a8f27c 100644 --- a/gnulib/import/stdint.in.h +++ b/gnulib/import/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -302,12 +302,11 @@ typedef gl_uint_fast32_t gl_uint_fast16_t; /* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own definitions of intptr_t and uintptr_t (which use int and unsigned) to avoid clashes with declarations of system functions like sbrk. - Similarly, mingw 5.22 <crtdefs.h> defines _INTPTR_T_DEFINED and - _UINTPTR_T_DEFINED and needs its own definitions of intptr_t and + Similarly, MinGW WSL-5.4.1 <stdint.h> needs its own intptr_t and uintptr_t to avoid conflicting declarations of system functions like _findclose in <io.h>. */ # if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \ - || (defined __MINGW32__ && defined _INTPTR_T_DEFINED && defined _UINTPTR_T_DEFINED)) + || defined __MINGW32__) # undef intptr_t # undef uintptr_t # ifdef _WIN64 @@ -580,11 +579,6 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes <stdint.h> and assumes its types are already defined. */ # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -# include <stddef.h> -# include <stdio.h> -# include <time.h> # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include <wchar.h> # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H diff --git a/gnulib/import/stdio.in.h b/gnulib/import/stdio.in.h index 6c338dd..a930840 100644 --- a/gnulib/import/stdio.in.h +++ b/gnulib/import/stdio.in.h @@ -1,6 +1,6 @@ /* A GNU-like <stdio.h>. - Copyright (C) 2004, 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,37 +63,51 @@ gnulib and libintl do '#define printf __printf__' when they override the 'printf' function. */ #ifndef _GL_ATTRIBUTE_FORMAT -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__ # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) # else # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ # endif #endif -/* _GL_ATTRIBUTE_FORMAT_PRINTF - indicates to GCC that the function takes a format string and arguments, - where the format string directives are the ones standardized by ISO C99 - and POSIX. */ +/* An __attribute__ __format__ specifier for a function that takes a format + string and arguments, where the format string directives are the ones + standardized by ISO C99 and POSIX. + _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */ +/* __gnu_printf__ is supported in GCC >= 4.4. */ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) +# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__ #else -# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__ #endif -/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF, - except that it indicates to GCC that the supported format string directives - are the ones of the system printf(), rather than the ones standardized by - ISO C99 and POSIX. */ +/* An __attribute__ __format__ specifier for a function that takes a format + string and arguments, where the format string directives are the ones of the + system printf(), rather than the ones standardized by ISO C99 and POSIX. + _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM */ +/* On mingw, Gnulib sets __USE_MINGW_ANSI_STDIO in order to get closer to + the standards. The macro GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU indicates + whether this change is effective. On older mingw, it is not. */ #if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU -# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument) +# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD #else -# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__ #endif +/* _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD + indicates to GCC that the function takes a format string and arguments, + where the format string directives are the ones standardized by ISO C99 + and POSIX. */ +#define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument)) + +/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD, + except that it indicates to GCC that the supported format string directives + are the ones of the system printf(), rather than the ones standardized by + ISO C99 and POSIX. */ +#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, formatstring_parameter, first_argument)) + /* _GL_ATTRIBUTE_FORMAT_SCANF indicates to GCC that the function takes a format string and arguments, where the format string directives are the ones standardized by ISO C99 @@ -174,13 +188,13 @@ # define dprintf rpl_dprintf # endif _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...)); # else # if !@HAVE_DPRINTF@ _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((2))); # endif _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...)); @@ -215,6 +229,31 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - " "use gnulib module fclose for portable POSIX compliance"); #endif +#if @GNULIB_MDA_FCLOSEALL@ +/* On native Windows, map 'fcloseall' to '_fcloseall', so that -loldnames is + not required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fcloseall on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcloseall +# define fcloseall _fcloseall +# endif +_GL_CXXALIAS_MDA (fcloseall, int, (void)); +# else +# if @HAVE_DECL_FCLOSEALL@ +# if defined __FreeBSD__ +_GL_CXXALIAS_SYS (fcloseall, void, (void)); +# else +_GL_CXXALIAS_SYS (fcloseall, int, (void)); +# endif +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@ +_GL_CXXALIASWARN (fcloseall); +# endif +#endif + #if @GNULIB_FDOPEN@ # if @REPLACE_FDOPEN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -224,6 +263,12 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - " _GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fdopen +# define fdopen _fdopen +# endif +_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode)); # else _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); # endif @@ -233,6 +278,20 @@ _GL_CXXALIASWARN (fdopen); /* Assume fdopen is always declared. */ _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - " "use gnulib module fdopen for portability"); +#elif @GNULIB_MDA_FDOPEN@ +/* On native Windows, map 'fdopen' to '_fdopen', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fdopen always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fdopen +# define fdopen _fdopen +# endif +_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode)); +# else +_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); +# endif +_GL_CXXALIASWARN (fdopen); #endif #if @GNULIB_FFLUSH@ @@ -297,6 +356,22 @@ _GL_CXXALIASWARN (fgets); # endif #endif +#if @GNULIB_MDA_FILENO@ +/* On native Windows, map 'fileno' to '_fileno', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fileno always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fileno +# define fileno _fileno +# endif +_GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream)); +# else +_GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream)); +# endif +_GL_CXXALIASWARN (fileno); +#endif + #if @GNULIB_FOPEN@ # if @REPLACE_FOPEN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -332,7 +407,7 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX complian # if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ _GL_FUNCDECL_RPL (fprintf, int, (FILE *restrict fp, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); # else _GL_FUNCDECL_RPL (fprintf, int, @@ -824,6 +899,22 @@ _GL_WARN_ON_USE (getline, "getline is unportable - " _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif +#if @GNULIB_MDA_GETW@ +/* On native Windows, map 'getw' to '_getw', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getw always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getw +# define getw _getw +# endif +_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream)); +# else +_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream)); +# endif +_GL_CXXALIASWARN (getw); +#endif + #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ struct obstack; /* Grow an obstack with formatted output. Return the number of @@ -837,7 +928,7 @@ struct obstack; # endif _GL_FUNCDECL_RPL (obstack_printf, int, (struct obstack *obs, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (obstack_printf, int, (struct obstack *obs, const char *format, ...)); @@ -845,7 +936,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int, # if !@HAVE_DECL_OBSTACK_PRINTF@ _GL_FUNCDECL_SYS (obstack_printf, int, (struct obstack *obs, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (obstack_printf, int, @@ -858,7 +949,7 @@ _GL_CXXALIASWARN (obstack_printf); # endif _GL_FUNCDECL_RPL (obstack_vprintf, int, (struct obstack *obs, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (obstack_vprintf, int, (struct obstack *obs, const char *format, va_list args)); @@ -866,7 +957,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int, # if !@HAVE_DECL_OBSTACK_PRINTF@ _GL_FUNCDECL_SYS (obstack_vprintf, int, (struct obstack *obs, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (obstack_vprintf, int, @@ -940,7 +1031,7 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - " #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) -# if defined __GNUC__ +# if defined __GNUC__ || defined __clang__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) /* Don't break __attribute__((format(printf,M,N))). */ # define printf __printf__ @@ -950,7 +1041,7 @@ _GL_FUNCDECL_RPL_1 (__printf__, int, (const char *restrict format, ...) __asm__ (@ASM_SYMBOL_PREFIX@ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) - _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ARG_NONNULL ((1))); # else _GL_FUNCDECL_RPL_1 (__printf__, int, @@ -967,7 +1058,7 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...)); # endif _GL_FUNCDECL_RPL (printf, int, (const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...)); # endif @@ -1037,6 +1128,22 @@ _GL_CXXALIASWARN (puts); # endif #endif +#if @GNULIB_MDA_PUTW@ +/* On native Windows, map 'putw' to '_putw', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::putw always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putw +# define putw _putw +# endif +_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream)); +# else +_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream)); +# endif +_GL_CXXALIASWARN (putw); +#endif + #if @GNULIB_REMOVE@ # if @REPLACE_REMOVE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1114,7 +1221,7 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - " #if @GNULIB_SCANF@ # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ -# if defined __GNUC__ +# if defined __GNUC__ || defined __clang__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef scanf /* Don't break __attribute__((format(scanf,M,N))). */ @@ -1153,7 +1260,7 @@ _GL_CXXALIASWARN (scanf); _GL_FUNCDECL_RPL (snprintf, int, (char *restrict str, size_t size, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ARG_NONNULL ((3))); _GL_CXXALIAS_RPL (snprintf, int, (char *restrict str, size_t size, @@ -1163,14 +1270,16 @@ _GL_CXXALIAS_RPL (snprintf, int, _GL_FUNCDECL_SYS (snprintf, int, (char *restrict str, size_t size, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ARG_NONNULL ((3))); # endif _GL_CXXALIAS_SYS (snprintf, int, (char *restrict str, size_t size, const char *restrict format, ...)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (snprintf); +# endif #elif defined GNULIB_POSIXCHECK # undef snprintf # if HAVE_RAW_DECL_SNPRINTF @@ -1195,7 +1304,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - " # endif _GL_FUNCDECL_RPL (sprintf, int, (char *restrict str, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (sprintf, int, (char *restrict str, const char *restrict format, ...)); @@ -1214,6 +1323,22 @@ _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - " "POSIX compliance"); #endif +#if @GNULIB_MDA_TEMPNAM@ +/* On native Windows, map 'tempnam' to '_tempnam', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::tempnam always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tempnam +# define tempnam _tempnam +# endif +_GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix)); +# else +_GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix)); +# endif +_GL_CXXALIASWARN (tempnam); +#endif + #if @GNULIB_TMPFILE@ # if @REPLACE_TMPFILE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1246,7 +1371,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - " # endif _GL_FUNCDECL_RPL (asprintf, int, (char **result, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (asprintf, int, (char **result, const char *format, ...)); @@ -1254,7 +1379,7 @@ _GL_CXXALIAS_RPL (asprintf, int, # if !@HAVE_VASPRINTF@ _GL_FUNCDECL_SYS (asprintf, int, (char **result, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (asprintf, int, @@ -1267,7 +1392,7 @@ _GL_CXXALIASWARN (asprintf); # endif _GL_FUNCDECL_RPL (vasprintf, int, (char **result, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (vasprintf, int, (char **result, const char *format, va_list args)); @@ -1275,7 +1400,7 @@ _GL_CXXALIAS_RPL (vasprintf, int, # if !@HAVE_VASPRINTF@ _GL_FUNCDECL_SYS (vasprintf, int, (char **result, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (vasprintf, int, @@ -1291,7 +1416,7 @@ _GL_CXXALIASWARN (vasprintf); # endif _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *restrict format, va_list args)); @@ -1299,7 +1424,7 @@ _GL_CXXALIAS_RPL (vdprintf, int, # if !@HAVE_VDPRINTF@ _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((2))); # endif /* Need to cast, because on Solaris, the third parameter will likely be @@ -1329,7 +1454,7 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - " _GL_FUNCDECL_RPL (vfprintf, int, (FILE *restrict fp, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); # else _GL_FUNCDECL_RPL (vfprintf, int, @@ -1382,7 +1507,9 @@ _GL_CXXALIAS_SYS (vfscanf, int, (FILE *restrict stream, const char *restrict format, va_list args)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (vfscanf); +# endif #endif #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@ @@ -1394,7 +1521,7 @@ _GL_CXXALIASWARN (vfscanf); # define GNULIB_overrides_vprintf 1 # if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0) _GL_ARG_NONNULL ((1))); # else _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args) @@ -1436,7 +1563,9 @@ _GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args)); # else _GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (vscanf); +# endif #endif #if @GNULIB_VSNPRINTF@ @@ -1447,7 +1576,7 @@ _GL_CXXALIASWARN (vscanf); _GL_FUNCDECL_RPL (vsnprintf, int, (char *restrict str, size_t size, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))); _GL_CXXALIAS_RPL (vsnprintf, int, (char *restrict str, size_t size, @@ -1457,14 +1586,16 @@ _GL_CXXALIAS_RPL (vsnprintf, int, _GL_FUNCDECL_SYS (vsnprintf, int, (char *restrict str, size_t size, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))); # endif _GL_CXXALIAS_SYS (vsnprintf, int, (char *restrict str, size_t size, const char *restrict format, va_list args)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (vsnprintf); +# endif #elif defined GNULIB_POSIXCHECK # undef vsnprintf # if HAVE_RAW_DECL_VSNPRINTF @@ -1481,7 +1612,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - " _GL_FUNCDECL_RPL (vsprintf, int, (char *restrict str, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (vsprintf, int, (char *restrict str, diff --git a/gnulib/import/stdlib.in.h b/gnulib/import/stdlib.in.h index 59f9e6c..49fc44e 100644 --- a/gnulib/import/stdlib.in.h +++ b/gnulib/import/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like <stdlib.h>. - Copyright (C) 1995, 2001-2004, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,8 +53,8 @@ # include <sys/loadavg.h> #endif -/* Native Windows platforms declare mktemp() in <io.h>. */ -#if 0 && (defined _WIN32 && ! defined __CYGWIN__) +/* Native Windows platforms declare _mktemp() in <io.h>. */ +#if defined _WIN32 && !defined __CYGWIN__ # include <io.h> #endif @@ -102,7 +102,7 @@ struct random_data /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ #ifndef _GL_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define _GL_ATTRIBUTE_PURE /* empty */ @@ -149,6 +149,31 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " #endif +/* Allocate memory with indefinite extent and specified alignment. */ +#if @GNULIB_ALIGNED_ALLOC@ +# if @REPLACE_ALIGNED_ALLOC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef aligned_alloc +# define aligned_alloc rpl_aligned_alloc +# endif +_GL_FUNCDECL_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); +_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); +# else +# if @HAVE_ALIGNED_ALLOC@ +_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); +# endif +# endif +# if @HAVE_ALIGNED_ALLOC@ +_GL_CXXALIASWARN (aligned_alloc); +# endif +#elif defined GNULIB_POSIXCHECK +# undef aligned_alloc +# if HAVE_RAW_DECL_ALIGNED_ALLOC +_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " + "use gnulib module aligned_alloc for portability"); +# endif +#endif + #if @GNULIB_ATOLL@ /* Parse a signed decimal integer. Returns the value of the integer. Errors are not detected. */ @@ -217,6 +242,94 @@ _GL_WARN_ON_USE (canonicalize_file_name, # endif #endif +#if @GNULIB_MDA_ECVT@ +/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ecvt +# define ecvt _ecvt +# endif +_GL_CXXALIAS_MDA (ecvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# else +# if @HAVE_DECL_ECVT@ +_GL_CXXALIAS_SYS (ecvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@ +_GL_CXXALIASWARN (ecvt); +# endif +#endif + +#if @GNULIB_MDA_FCVT@ +/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcvt +# define fcvt _fcvt +# endif +_GL_CXXALIAS_MDA (fcvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# else +# if @HAVE_DECL_FCVT@ +_GL_CXXALIAS_SYS (fcvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@ +_GL_CXXALIASWARN (fcvt); +# endif +#endif + +#if @GNULIB_FREE_POSIX@ +# if @REPLACE_FREE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef free +# define free rpl_free +# endif +_GL_FUNCDECL_RPL (free, void, (void *ptr)); +_GL_CXXALIAS_RPL (free, void, (void *ptr)); +# else +_GL_CXXALIAS_SYS (free, void, (void *ptr)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (free); +# endif +#elif defined GNULIB_POSIXCHECK +# undef free +/* Assume free is always declared. */ +_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - " + "use gnulib module free for portability"); +#endif + +#if @GNULIB_MDA_GCVT@ +/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gcvt +# define gcvt _gcvt +# endif +_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf)); +# else +# if @HAVE_DECL_GCVT@ +_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@ +_GL_CXXALIASWARN (gcvt); +# endif +#endif + #if @GNULIB_GETLOADAVG@ /* Store max(NELEM,3) load average numbers in LOADAVG[]. The three numbers are the load average of the last 1 minute, the last 5 @@ -468,6 +581,51 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " # endif #endif +#if @GNULIB_MDA_MKTEMP@ +/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::mktemp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mktemp +# define mktemp _mktemp +# endif +_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/)); +# else +_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/)); +# endif +_GL_CXXALIASWARN (mktemp); +#endif + +/* Allocate memory with indefinite extent and specified alignment. */ +#if @GNULIB_POSIX_MEMALIGN@ +# if @REPLACE_POSIX_MEMALIGN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef posix_memalign +# define posix_memalign rpl_posix_memalign +# endif +_GL_FUNCDECL_RPL (posix_memalign, int, + (void **memptr, size_t alignment, size_t size) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (posix_memalign, int, + (void **memptr, size_t alignment, size_t size)); +# else +# if @HAVE_POSIX_MEMALIGN@ +_GL_CXXALIAS_SYS (posix_memalign, int, + (void **memptr, size_t alignment, size_t size)); +# endif +# endif +# if @HAVE_POSIX_MEMALIGN@ +_GL_CXXALIASWARN (posix_memalign); +# endif +#elif defined GNULIB_POSIXCHECK +# undef posix_memalign +# if HAVE_RAW_DECL_POSIX_MEMALIGN +_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " + "use gnulib module posix_memalign for portability"); +# endif +#endif + #if @GNULIB_POSIX_OPENPT@ /* Return an FD open to the master side of a pseudo-terminal. Flags should include O_RDWR, and may also include O_NOCTTY. */ @@ -546,6 +704,28 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " # endif _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (putenv, int, (char *string)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv _putenv +# endif +_GL_CXXALIAS_MDA (putenv, int, (char *string)); +# else +_GL_CXXALIAS_SYS (putenv, int, (char *string)); +# endif +_GL_CXXALIASWARN (putenv); +#elif @GNULIB_MDA_PUTENV@ +/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::putenv always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv _putenv +# endif +/* Need to cast, because on mingw, the parameter is either + 'const char *string' or 'char *string'. */ +_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string)); # else _GL_CXXALIAS_SYS (putenv, int, (char *string)); # endif diff --git a/gnulib/import/str-two-way.h b/gnulib/import/str-two-way.h index 6ad0130..005a19f 100644 --- a/gnulib/import/str-two-way.h +++ b/gnulib/import/str-two-way.h @@ -1,5 +1,5 @@ /* Byte-wise substring search, using the Two-Way algorithm. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Eric Blake <ebb9@byu.net>, 2008. diff --git a/gnulib/import/strchrnul.c b/gnulib/import/strchrnul.c index 858d66f..3fed52a 100644 --- a/gnulib/import/strchrnul.c +++ b/gnulib/import/strchrnul.c @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strchrnul.valgrind b/gnulib/import/strchrnul.valgrind index a85608a..c71fd15 100644 --- a/gnulib/import/strchrnul.valgrind +++ b/gnulib/import/strchrnul.valgrind @@ -1,6 +1,6 @@ # Suppress a valgrind message about use of uninitialized memory in strchrnul(). -# Copyright (C) 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 2008-2021 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strdup.c b/gnulib/import/strdup.c index 4da6007..1a00b9d 100644 --- a/gnulib/import/strdup.c +++ b/gnulib/import/strdup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2020 Free Software +/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/streq.h b/gnulib/import/streq.h index d06c272..9b63e81 100644 --- a/gnulib/import/streq.h +++ b/gnulib/import/streq.h @@ -1,5 +1,5 @@ /* Optimized string comparison. - Copyright (C) 2001-2002, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -29,7 +29,7 @@ /* Help GCC to generate good code for string comparisons with immediate strings. */ -#if defined (__GNUC__) && defined (__OPTIMIZE__) +#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__ static inline int streq9 (const char *s1, const char *s2) diff --git a/gnulib/import/strerror-override.c b/gnulib/import/strerror-override.c index 61b7689..744714f 100644 --- a/gnulib/import/strerror-override.c +++ b/gnulib/import/strerror-override.c @@ -1,6 +1,6 @@ /* strerror-override.c --- POSIX compatible system error routine - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strerror-override.h b/gnulib/import/strerror-override.h index 062f51c..009c560 100644 --- a/gnulib/import/strerror-override.h +++ b/gnulib/import/strerror-override.h @@ -1,6 +1,6 @@ /* strerror-override.h --- POSIX compatible system error routine - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strerror.c b/gnulib/import/strerror.c index 1a53a8b..9a49725 100644 --- a/gnulib/import/strerror.c +++ b/gnulib/import/strerror.c @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strerror_r.c b/gnulib/import/strerror_r.c index 9ccc6c3..71965fb 100644 --- a/gnulib/import/strerror_r.c +++ b/gnulib/import/strerror_r.c @@ -1,6 +1,6 @@ /* strerror_r.c --- POSIX compatible system error routine - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -120,6 +120,7 @@ local_snprintf (char *buf, size_t buflen, const char *format, ...) buf[buflen - 1] = '\0'; return result; } +# undef snprintf # define snprintf local_snprintf #endif diff --git a/gnulib/import/string.in.h b/gnulib/import/string.in.h index a08e705..c76c182 100644 --- a/gnulib/import/string.in.h +++ b/gnulib/import/string.in.h @@ -1,6 +1,6 @@ /* A GNU-like <string.h>. - Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ #ifndef _GL_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define _GL_ATTRIBUTE_PURE /* empty */ @@ -69,6 +69,14 @@ # include <unistd.h> #endif +/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \ + && defined _AIX) \ + && ! defined __GLIBC__ +# include <strings.h> +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ @@ -110,10 +118,18 @@ _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module"); /* Find the index of the least-significant set bit. */ #if @GNULIB_FFSLL@ -# if !@HAVE_FFSLL@ +# if @REPLACE_FFSLL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define ffsll rpl_ffsll +# endif +_GL_FUNCDECL_RPL (ffsll, int, (long long int i)); +_GL_CXXALIAS_RPL (ffsll, int, (long long int i)); +# else +# if !@HAVE_FFSLL@ _GL_FUNCDECL_SYS (ffsll, int, (long long int i)); -# endif +# endif _GL_CXXALIAS_SYS (ffsll, int, (long long int i)); +# endif _GL_CXXALIASWARN (ffsll); #elif defined GNULIB_POSIXCHECK # undef ffsll @@ -123,10 +139,30 @@ _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module"); #endif +#if @GNULIB_MDA_MEMCCPY@ +/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::memccpy always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef memccpy +# define memccpy _memccpy +# endif +_GL_CXXALIAS_MDA (memccpy, void *, + (void *dest, const void *src, int c, size_t n)); +# else +_GL_CXXALIAS_SYS (memccpy, void *, + (void *dest, const void *src, int c, size_t n)); +# endif +_GL_CXXALIASWARN (memccpy); +#endif + + /* Return the first instance of C within N bytes of S, or NULL. */ #if @GNULIB_MEMCHR@ # if @REPLACE_MEMCHR@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef memchr # define memchr rpl_memchr # endif _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) @@ -134,11 +170,6 @@ _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); # else -# if ! @HAVE_MEMCHR@ -_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) - _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1))); -# endif /* On some systems, this function is defined as an overloaded function: extern "C" { const void * std::memchr (const void *, int, size_t); } extern "C++" { void * std::memchr (void *, int, size_t); } */ @@ -334,7 +365,8 @@ _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - " GB18030 and the character to be searched is a digit. */ # undef strchr /* Assume strchr is always declared. */ -_GL_WARN_ON_USE_CXX (strchr, const char *, (const char *, int), +_GL_WARN_ON_USE_CXX (strchr, + const char *, char *, (const char *, int), "strchr cannot work correctly on character strings " "in some multibyte locales - " "use mbschr if you care about internationalization"); @@ -388,6 +420,12 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - " # endif _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup _strdup +# endif +_GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); # else # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup /* strdup exists as a function and as a macro. Get rid of the macro. */ @@ -405,6 +443,23 @@ _GL_CXXALIASWARN (strdup); _GL_WARN_ON_USE (strdup, "strdup is unportable - " "use gnulib module strdup for portability"); # endif +#elif @GNULIB_MDA_STRDUP@ +/* On native Windows, map 'creat' to '_creat', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::creat always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup _strdup +# endif +_GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); +# else +# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup +# undef strdup +# endif +_GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); +# endif +_GL_CXXALIASWARN (strdup); #endif /* Append no more than N characters from SRC onto DEST. */ @@ -529,7 +584,8 @@ _GL_CXXALIASWARN (strpbrk); locale encoding is GB18030 and one of the characters to be searched is a digit. */ # undef strpbrk -_GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *), +_GL_WARN_ON_USE_CXX (strpbrk, + const char *, char *, (const char *, const char *), "strpbrk cannot work correctly on character strings " "in multibyte locales - " "use mbspbrk if you care about internationalization"); @@ -537,7 +593,8 @@ _GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *), #elif defined GNULIB_POSIXCHECK # undef strpbrk # if HAVE_RAW_DECL_STRPBRK -_GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *), +_GL_WARN_ON_USE_CXX (strpbrk, + const char *, char *, (const char *, const char *), "strpbrk is unportable - " "use gnulib module strpbrk for portability"); # endif @@ -558,7 +615,8 @@ _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings " GB18030 and the character to be searched is a digit. */ # undef strrchr /* Assume strrchr is always declared. */ -_GL_WARN_ON_USE_CXX (strrchr, const char *, (const char *, int), +_GL_WARN_ON_USE_CXX (strrchr, + const char *, char *, (const char *, int), "strrchr cannot work correctly on character strings " "in some multibyte locales - " "use mbsrchr if you care about internationalization"); @@ -1031,6 +1089,60 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " # endif #endif +/* Return the name of the system error code ERRNUM. */ +#if @GNULIB_STRERRORNAME_NP@ +# if @REPLACE_STRERRORNAME_NP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerrorname_np +# define strerrorname_np rpl_strerrorname_np +# endif +_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); +_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); +# else +# if !@HAVE_STRERRORNAME_NP@ +_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIASWARN (strerrorname_np); +#elif defined GNULIB_POSIXCHECK +# undef strerrorname_np +# if HAVE_RAW_DECL_STRERRORNAME_NP +_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " + "use gnulib module strerrorname_np for portability"); +# endif +#endif + +/* Return an abbreviation string for the signal number SIG. */ +#if @GNULIB_SIGABBREV_NP@ +# if ! @HAVE_SIGABBREV_NP@ +_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig)); +# endif +_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig)); +_GL_CXXALIASWARN (sigabbrev_np); +#elif defined GNULIB_POSIXCHECK +# undef sigabbrev_np +# if HAVE_RAW_DECL_SIGABBREV_NP +_GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - " + "use gnulib module sigabbrev_np for portability"); +# endif +#endif + +/* Return an English description string for the signal number SIG. */ +#if @GNULIB_SIGDESCR_NP@ +# if ! @HAVE_SIGDESCR_NP@ +_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig)); +# endif +_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig)); +_GL_CXXALIASWARN (sigdescr_np); +#elif defined GNULIB_POSIXCHECK +# undef sigdescr_np +# if HAVE_RAW_DECL_SIGDESCR_NP +_GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - " + "use gnulib module sigdescr_np for portability"); +# endif +#endif + #if @GNULIB_STRSIGNAL@ # if @REPLACE_STRSIGNAL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) diff --git a/gnulib/import/stripslash.c b/gnulib/import/stripslash.c index 6818b30..f2cbcb5 100644 --- a/gnulib/import/stripslash.c +++ b/gnulib/import/stripslash.c @@ -1,6 +1,6 @@ /* stripslash.c -- remove redundant trailing slashes from a file name - Copyright (C) 1990, 2001, 2003-2006, 2009-2020 Free Software Foundation, + Copyright (C) 1990, 2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/strnlen.c b/gnulib/import/strnlen.c index dcecf08..c27a039 100644 --- a/gnulib/import/strnlen.c +++ b/gnulib/import/strnlen.c @@ -1,5 +1,5 @@ /* Find the length of STRING, but scan at most MAXLEN characters. - Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff --git a/gnulib/import/strnlen1.c b/gnulib/import/strnlen1.c index 88edc18..d52811b 100644 --- a/gnulib/import/strnlen1.c +++ b/gnulib/import/strnlen1.c @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strnlen1.h b/gnulib/import/strnlen1.h index 2e21fea..da62073 100644 --- a/gnulib/import/strnlen1.h +++ b/gnulib/import/strnlen1.h @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/strstr.c b/gnulib/import/strstr.c index 2f8ae46..50daaf6 100644 --- a/gnulib/import/strstr.c +++ b/gnulib/import/strstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2020 Free Software +/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/strtok_r.c b/gnulib/import/strtok_r.c index 1870a0a..ef576a6 100644 --- a/gnulib/import/strtok_r.c +++ b/gnulib/import/strtok_r.c @@ -1,5 +1,5 @@ /* Reentrant string tokenizer. Generic version. - Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2020 Free Software + Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib/import/sys_random.in.h b/gnulib/import/sys_random.in.h index f14ac1f..5b9280d 100644 --- a/gnulib/import/sys_random.in.h +++ b/gnulib/import/sys_random.in.h @@ -1,5 +1,5 @@ /* Substitute for <sys/random.h>. - Copyright (C) 2020 Free Software Foundation, Inc. + Copyright (C) 2020-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,10 @@ #if @HAVE_SYS_RANDOM_H@ +/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>. */ +# if defined __UCLIBC__ +# include <stddef.h> +# endif /* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>. On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that includes <Availability.h>, such as <stdlib.h> or <unistd.h>. */ diff --git a/gnulib/import/sys_socket.in.h b/gnulib/import/sys_socket.in.h index 88ac5f0..2777007 100644 --- a/gnulib/import/sys_socket.in.h +++ b/gnulib/import/sys_socket.in.h @@ -1,6 +1,6 @@ /* Provide a sys/socket header file for systems lacking it (read: MinGW) and for systems where it is incomplete. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify @@ -256,7 +256,7 @@ rpl_fd_isset (SOCKET fd, fd_set * set) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef close # define close close_used_without_including_unistd_h -# else +# elif !defined __clang__ _GL_WARN_ON_USE (close, "close() used without including <unistd.h>"); # endif diff --git a/gnulib/import/sys_stat.in.h b/gnulib/import/sys_stat.in.h index 4494607..13d1294 100644 --- a/gnulib/import/sys_stat.in.h +++ b/gnulib/import/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat.h header file. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -375,11 +375,11 @@ struct stat # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #endif -/* S_IXUGO is a common extension to POSIX. */ +/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are + not implemented in GNU/Linux, some Gnulib-using apps use the macros. */ #if !S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) #endif - #ifndef S_IRWXUGO # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif @@ -391,6 +391,24 @@ struct stat #endif +#if @GNULIB_MDA_CHMOD@ +/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::chmod always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chmod +# define chmod _chmod +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode)); +# else +_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode)); +# endif +_GL_CXXALIASWARN (chmod); +#endif + + #if @GNULIB_FCHMODAT@ # if @REPLACE_FCHMODAT@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -432,7 +450,9 @@ _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); # else _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fstat); +# endif #elif @GNULIB_OVERRIDES_STRUCT_STAT@ # undef fstat # define fstat fstat_used_without_requesting_gnulib_module_fstat @@ -515,6 +535,23 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - " #endif +#if @GNULIB_GETUMASK@ +# if !@HAVE_GETUMASK@ +_GL_FUNCDECL_SYS (getumask, mode_t, (void)); +# endif +_GL_CXXALIAS_SYS (getumask, mode_t, (void)); +# if @HAVE_GETUMASK@ +_GL_CXXALIASWARN (getumask); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getumask +# if HAVE_RAW_DECL_GETUMASK +_GL_WARN_ON_USE (getumask, "getumask is not portable - " + "use gnulib module getumask for portability"); +# endif +#endif + + #if @GNULIB_LCHMOD@ /* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME denotes a symbolic link. */ @@ -571,21 +608,20 @@ _GL_WARN_ON_USE (lstat, "lstat is unportable - " #endif -#if @REPLACE_MKDIR@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef mkdir -# define mkdir rpl_mkdir -# endif +#if @GNULIB_MKDIR@ +# if @REPLACE_MKDIR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir +# define mkdir rpl_mkdir +# endif _GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) - _GL_ARG_NONNULL ((1))); + _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); -#else +# elif defined _WIN32 && !defined __CYGWIN__ /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. Additionally, it declares _mkdir (and depending on compile flags, an alias mkdir), only in the nonstandard includes <direct.h> and <io.h>, which are included above. */ -# if defined _WIN32 && ! defined __CYGWIN__ - # if !GNULIB_defined_rpl_mkdir static int rpl_mkdir (char const *name, mode_t mode) @@ -594,16 +630,44 @@ rpl_mkdir (char const *name, mode_t mode) } # define GNULIB_defined_rpl_mkdir 1 # endif - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir # define mkdir rpl_mkdir # endif _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); # else _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); # endif -#endif _GL_CXXALIASWARN (mkdir); +#elif defined GNULIB_POSIXCHECK +# undef mkdir +# if HAVE_RAW_DECL_MKDIR +_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - " + "use gnulib module mkdir for portability"); +# endif +#elif @GNULIB_MDA_MKDIR@ +/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::mkdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !GNULIB_defined_rpl_mkdir +static int +rpl_mkdir (char const *name, mode_t mode) +{ + return _mkdir (name); +} +# define GNULIB_defined_rpl_mkdir 1 +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir +# define mkdir rpl_mkdir +# endif +_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); +# else +_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); +# endif +_GL_CXXALIASWARN (mkdir); +#endif #if @GNULIB_MKDIRAT@ @@ -649,11 +713,21 @@ _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - " #if @GNULIB_MKFIFOAT@ -# if !@HAVE_MKFIFOAT@ +# if @REPLACE_MKFIFOAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkfifoat +# define mkfifoat rpl_mkfifoat +# endif +_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)); +# else +# if !@HAVE_MKFIFOAT@ _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); +# endif _GL_CXXALIASWARN (mkfifoat); #elif defined GNULIB_POSIXCHECK # undef mkfifoat @@ -692,13 +766,25 @@ _GL_WARN_ON_USE (mknod, "mknod is not portable - " #if @GNULIB_MKNODAT@ -# if !@HAVE_MKNODAT@ +# if @REPLACE_MKNODAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mknodat +# define mknodat rpl_mknodat +# endif +_GL_FUNCDECL_RPL (mknodat, int, + (int fd, char const *file, mode_t mode, dev_t dev) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (mknodat, int, + (int fd, char const *file, mode_t mode, dev_t dev)); +# else +# if !@HAVE_MKNODAT@ _GL_FUNCDECL_SYS (mknodat, int, (int fd, char const *file, mode_t mode, dev_t dev) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (mknodat, int, (int fd, char const *file, mode_t mode, dev_t dev)); +# endif _GL_CXXALIASWARN (mknodat); #elif defined GNULIB_POSIXCHECK # undef mknodat @@ -783,6 +869,24 @@ _GL_WARN_ON_USE (stat, "stat is unportable - " #endif +#if @GNULIB_MDA_UMASK@ +/* On native Windows, map 'umask' to '_umask', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::umask always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef umask +# define umask _umask +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask)); +# else +_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask)); +# endif +_GL_CXXALIASWARN (umask); +#endif + + #if @GNULIB_UTIMENSAT@ /* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat implementation relies on futimesat, which on Solaris 10 makes an invocation diff --git a/gnulib/import/sys_time.in.h b/gnulib/import/sys_time.in.h index d30b267..90a67d1 100644 --- a/gnulib/import/sys_time.in.h +++ b/gnulib/import/sys_time.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/time.h. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -135,7 +135,7 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef close # define close close_used_without_including_unistd_h -# else +# elif !defined __clang__ _GL_WARN_ON_USE (close, "close() used without including <unistd.h>"); # endif diff --git a/gnulib/import/sys_types.in.h b/gnulib/import/sys_types.in.h index e7e1a22..654e803 100644 --- a/gnulib/import/sys_types.in.h +++ b/gnulib/import/sys_types.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/sys_uio.in.h b/gnulib/import/sys_uio.in.h index 8588d3c..db72437 100644 --- a/gnulib/import/sys_uio.in.h +++ b/gnulib/import/sys_uio.in.h @@ -1,5 +1,5 @@ /* Substitute for <sys/uio.h>. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/tempname.c b/gnulib/import/tempname.c index cfb0fc4..3d91dee 100644 --- a/gnulib/import/tempname.c +++ b/gnulib/import/tempname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,9 +47,11 @@ #include <string.h> #include <fcntl.h> +#include <stdalign.h> #include <stdint.h> #include <sys/random.h> #include <sys/stat.h> +#include <time.h> #if _LIBC # define struct_stat64 struct stat64 @@ -60,27 +62,33 @@ # define __mkdir mkdir # define __open open # define __lxstat64(version, file, buf) lstat (file, buf) +# define __getrandom getrandom +# define __clock_gettime64 clock_gettime +# define __timespec64 timespec #endif -#ifdef _LIBC -# include <random-bits.h> -# define RANDOM_BITS(Var) ((Var) = random_bits ()) -typedef uint32_t random_value; -# define RANDOM_VALUE_MAX UINT32_MAX -# define BASE_62_DIGITS 5 /* 62**5 < UINT32_MAX */ -# define BASE_62_POWER (62 * 62 * 62 * 62 * 62) /* 2**BASE_62_DIGITS */ -#else /* Use getrandom if it works, falling back on a 64-bit linear - congruential generator that starts with whatever Var's value - happens to be. */ -# define RANDOM_BITS(Var) \ - ((void) (getrandom (&(Var), sizeof (Var), 0) == sizeof (Var) \ - || ((Var) = 2862933555777941757 * (Var) + 3037000493))) + congruential generator that starts with Var's value + mixed in with a clock's low-order bits if available. */ typedef uint_fast64_t random_value; -# define RANDOM_VALUE_MAX UINT_FAST64_MAX -# define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */ -# define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62) +#define RANDOM_VALUE_MAX UINT_FAST64_MAX +#define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */ +#define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62) + +static random_value +random_bits (random_value var) +{ + random_value r; + if (__getrandom (&r, sizeof r, 0) == sizeof r) + return r; +#if _LIBC || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME) + /* Add entropy if getrandom is not supported. */ + struct __timespec64 tv; + __clock_gettime64 (CLOCK_MONOTONIC, &tv); + var ^= tv.tv_nsec; #endif + return 2862933555777941757 * var + 3037000493; +} #if _LIBC /* Return nonzero if DIR is an existent directory. */ @@ -250,8 +258,11 @@ try_tempname_len (char *tmpl, int suffixlen, void *args, unsigned int attempts = ATTEMPTS_MIN; #endif - /* A random variable. */ - random_value v; + /* A random variable. The initial value is used only the for fallback path + on 'random_bits' on 'getrandom' failure. Its initial value tries to use + some entropy from the ASLR and ignore possible bits from the stack + alignment. */ + random_value v = ((uintptr_t) &v) / alignof (max_align_t); /* How many random base-62 digits can currently be extracted from V. */ int vdigits = 0; @@ -279,7 +290,7 @@ try_tempname_len (char *tmpl, int suffixlen, void *args, if (vdigits == 0) { do - RANDOM_BITS (v); + v = random_bits (v); while (unfair_min <= v); vdigits = BASE_62_DIGITS; diff --git a/gnulib/import/tempname.h b/gnulib/import/tempname.h index 00dcbe4..a8681fc 100644 --- a/gnulib/import/tempname.h +++ b/gnulib/import/tempname.h @@ -1,6 +1,6 @@ /* Create a temporary file or directory. - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/time.in.h b/gnulib/import/time.in.h index 1d11650..1385980 100644 --- a/gnulib/import/time.in.h +++ b/gnulib/import/time.in.h @@ -1,6 +1,6 @@ /* A more-standard <time.h>. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -101,6 +101,25 @@ struct __time_t_must_be_integral { # define GNULIB_defined_struct_time_t_must_be_integral 1 # endif +/* Define TIME_UTC, a positive integer constant used for timespec_get(). */ +# if ! @TIME_H_DEFINES_TIME_UTC@ +# if !GNULIB_defined_TIME_UTC +# define TIME_UTC 1 +# define GNULIB_defined_TIME_UTC 1 +# endif +# endif + +/* Set *TS to the current time, and return BASE. + Upon failure, return 0. */ +# if @GNULIB_TIMESPEC_GET@ +# if ! @HAVE_TIMESPEC_GET@ +_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); +_GL_CXXALIASWARN (timespec_get); +# endif + /* Sleep for at least RQTP seconds unless interrupted, If interrupted, return -1 and store the remaining time into RMTP. See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>. */ @@ -135,10 +154,27 @@ _GL_CXXALIASWARN (nanosleep); # endif _GL_FUNCDECL_RPL (tzset, void, (void)); _GL_CXXALIAS_RPL (tzset, void, (void)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzset +# define tzset _tzset +# endif +_GL_CXXALIAS_MDA (tzset, void, (void)); # else -# if ! @HAVE_TZSET@ -_GL_FUNCDECL_SYS (tzset, void, (void)); +_GL_CXXALIAS_SYS (tzset, void, (void)); +# endif +_GL_CXXALIASWARN (tzset); +# elif @GNULIB_MDA_TZSET@ +/* On native Windows, map 'tzset' to '_tzset', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::tzset always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzset +# define tzset _tzset # endif +_GL_CXXALIAS_MDA (tzset, void, (void)); +# else _GL_CXXALIAS_SYS (tzset, void, (void)); # endif _GL_CXXALIASWARN (tzset); @@ -350,17 +386,17 @@ _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " # endif # if defined GNULIB_POSIXCHECK # undef asctime_r -_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " +_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # if defined GNULIB_POSIXCHECK # undef ctime -_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " +_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # if defined GNULIB_POSIXCHECK # undef ctime_r -_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " +_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif diff --git a/gnulib/import/time_r.c b/gnulib/import/time_r.c index e8fca2d..d908986 100644 --- a/gnulib/import/time_r.c +++ b/gnulib/import/time_r.c @@ -1,6 +1,6 @@ /* Reentrant time functions like localtime_r. - Copyright (C) 2003, 2006-2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2010-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/unistd--.h b/gnulib/import/unistd--.h index 05f3740..5e6ecb0 100644 --- a/gnulib/import/unistd--.h +++ b/gnulib/import/unistd--.h @@ -1,6 +1,6 @@ /* Like unistd.h, but redefine some names to avoid glitches. - Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/unistd-safer.h b/gnulib/import/unistd-safer.h index 3e83509..541bafe 100644 --- a/gnulib/import/unistd-safer.h +++ b/gnulib/import/unistd-safer.h @@ -1,6 +1,6 @@ /* Invoke unistd-like functions, but avoid some glitches. - Copyright (C) 2001, 2003, 2005, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/unistd.in.h b/gnulib/import/unistd.in.h index b211e4d..5e9b47d 100644 --- a/gnulib/import/unistd.in.h +++ b/gnulib/import/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -93,20 +93,18 @@ # undef __need_system_stdlib_h #endif -/* Native Windows platforms declare chdir, getcwd, rmdir in +/* Native Windows platforms declare _chdir, _getcwd, _rmdir in <io.h> and/or <direct.h>, not in <unistd.h>. - They also declare access(), chmod(), close(), dup(), dup2(), isatty(), - lseek(), read(), unlink(), write() in <io.h>. */ -#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ - || defined GNULIB_POSIXCHECK) \ - && (defined _WIN32 && ! defined __CYGWIN__)) -# include <io.h> /* mingw32, mingw64 */ -# include <direct.h> /* mingw64, MSVC 9 */ -#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \ - || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \ - || defined GNULIB_POSIXCHECK) \ - && (defined _WIN32 && ! defined __CYGWIN__) + They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(), + _lseek(), _read(), _unlink(), _write() in <io.h>. */ +#if defined _WIN32 && !defined __CYGWIN__ # include <io.h> +# include <direct.h> +#endif + +/* Native Windows platforms declare _execl*, _execv* in <process.h>. */ +#if defined _WIN32 && !defined __CYGWIN__ +# include <process.h> #endif /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. @@ -138,11 +136,8 @@ /* MSVC defines off_t in <sys/types.h>. May also define off_t to a 64-bit type on native Windows. */ -/* But avoid namespace pollution on glibc systems. */ -#ifndef __GLIBC__ -/* Get off_t, ssize_t. */ -# include <sys/types.h> -#endif +/* Get off_t, ssize_t, mode_t. */ +#include <sys/types.h> /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -273,6 +268,12 @@ _GL_INLINE_HEADER_BEGIN _GL_FUNCDECL_RPL (access, int, (const char *file, int mode) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access _access +# endif +_GL_CXXALIAS_MDA (access, int, (const char *file, int mode)); # else _GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); # endif @@ -286,11 +287,33 @@ _GL_WARN_ON_USE (access, "access does not always support X_OK - " "also, this function is a security risk - " "use the gnulib module faccessat instead"); # endif +#elif @GNULIB_MDA_ACCESS@ +/* On native Windows, map 'access' to '_access', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::access always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access _access +# endif +_GL_CXXALIAS_MDA (access, int, (const char *file, int mode)); +# else +_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); +# endif +_GL_CXXALIASWARN (access); #endif #if @GNULIB_CHDIR@ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chdir +# define chdir _chdir +# endif +_GL_CXXALIAS_MDA (chdir, int, (const char *file)); +# else _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +# endif _GL_CXXALIASWARN (chdir); #elif defined GNULIB_POSIXCHECK # undef chdir @@ -298,6 +321,20 @@ _GL_CXXALIASWARN (chdir); _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " "use gnulib module chdir for portability"); # endif +#elif @GNULIB_MDA_CHDIR@ +/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::chdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chdir +# define chdir _chdir +# endif +_GL_CXXALIAS_MDA (chdir, int, (const char *file)); +# else +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIASWARN (chdir); #endif @@ -342,6 +379,12 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " # endif _GL_FUNCDECL_RPL (close, int, (int fd)); _GL_CXXALIAS_RPL (close, int, (int fd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close _close +# endif +_GL_CXXALIAS_MDA (close, int, (int fd)); # else _GL_CXXALIAS_SYS (close, int, (int fd)); # endif @@ -354,6 +397,20 @@ _GL_CXXALIASWARN (close); /* Assume close is always declared. */ _GL_WARN_ON_USE (close, "close does not portably work on sockets - " "use gnulib module close for portability"); +#elif @GNULIB_MDA_CLOSE@ +/* On native Windows, map 'close' to '_close', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::close always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close _close +# endif +_GL_CXXALIAS_MDA (close, int, (int fd)); +# else +_GL_CXXALIAS_SYS (close, int, (int fd)); +# endif +_GL_CXXALIASWARN (close); #endif @@ -368,10 +425,11 @@ _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, # endif _GL_CXXALIASWARN (copy_file_range); #elif defined GNULIB_POSIXCHECK -/* Assume copy_file_range is always declared. */ +# if HAVE_RAW_DECL_COPY_FILE_RANGE _GL_WARN_ON_USE (copy_file_range, "copy_file_range is unportable - " "use gnulib module copy_file_range for portability"); +# endif #endif @@ -382,6 +440,12 @@ _GL_WARN_ON_USE (copy_file_range, # endif _GL_FUNCDECL_RPL (dup, int, (int oldfd)); _GL_CXXALIAS_RPL (dup, int, (int oldfd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup +# define dup _dup +# endif +_GL_CXXALIAS_MDA (dup, int, (int oldfd)); # else _GL_CXXALIAS_SYS (dup, int, (int oldfd)); # endif @@ -392,6 +456,20 @@ _GL_CXXALIASWARN (dup); _GL_WARN_ON_USE (dup, "dup is unportable - " "use gnulib module dup for portability"); # endif +#elif @GNULIB_MDA_DUP@ +/* On native Windows, map 'dup' to '_dup', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::dup always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup +# define dup _dup +# endif +_GL_CXXALIAS_MDA (dup, int, (int oldfd)); +# else +_GL_CXXALIAS_SYS (dup, int, (int oldfd)); +# endif +_GL_CXXALIASWARN (dup); #endif @@ -407,10 +485,13 @@ _GL_WARN_ON_USE (dup, "dup is unportable - " # endif _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); -# else -# if !@HAVE_DUP2@ -_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup2 +# define dup2 _dup2 # endif +_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd)); +# else _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); # endif _GL_CXXALIASWARN (dup2); @@ -420,6 +501,20 @@ _GL_CXXALIASWARN (dup2); _GL_WARN_ON_USE (dup2, "dup2 is unportable - " "use gnulib module dup2 for portability"); # endif +#elif @GNULIB_MDA_DUP2@ +/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::dup2 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup2 +# define dup2 _dup2 +# endif +_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd)); +# else +_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); +# endif +_GL_CXXALIASWARN (dup2); #endif @@ -520,6 +615,282 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " #endif +#if @GNULIB_EXECL@ +# if @REPLACE_EXECL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl rpl_execl +# endif +_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#elif defined GNULIB_POSIXCHECK +# undef execl +# if HAVE_RAW_DECL_EXECL +_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - " + "use gnulib module execl for portability"); +# endif +#elif @GNULIB_MDA_EXECL@ +/* On native Windows, map 'execl' to '_execl', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execl always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl _execl +# endif +_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#endif + +#if @GNULIB_EXECLE@ +# if @REPLACE_EXECLE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle rpl_execle +# endif +_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#elif defined GNULIB_POSIXCHECK +# undef execle +# if HAVE_RAW_DECL_EXECLE +_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - " + "use gnulib module execle for portability"); +# endif +#elif @GNULIB_MDA_EXECLE@ +/* On native Windows, map 'execle' to '_execle', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execle always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle _execle +# endif +_GL_CXXALIAS_MDA (execle, intptr_t, + (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#endif + +#if @GNULIB_EXECLP@ +# if @REPLACE_EXECLP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp rpl_execlp +# endif +_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#elif defined GNULIB_POSIXCHECK +# undef execlp +# if HAVE_RAW_DECL_EXECLP +_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - " + "use gnulib module execlp for portability"); +# endif +#elif @GNULIB_MDA_EXECLP@ +/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execlp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp _execlp +# endif +_GL_CXXALIAS_MDA (execlp, intptr_t, + (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#endif + + +#if @GNULIB_EXECV@ +# if @REPLACE_EXECV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv rpl_execv +# endif +_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#elif defined GNULIB_POSIXCHECK +# undef execv +# if HAVE_RAW_DECL_EXECV +_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - " + "use gnulib module execv for portability"); +# endif +#elif @GNULIB_MDA_EXECV@ +/* On native Windows, map 'execv' to '_execv', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execv always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv _execv +# endif +_GL_CXXALIAS_MDA_CAST (execv, intptr_t, + (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#endif + +#if @GNULIB_EXECVE@ +# if @REPLACE_EXECVE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve rpl_execve +# endif +_GL_FUNCDECL_RPL (execve, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execve, int, + (const char *program, char * const *argv, char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#elif defined GNULIB_POSIXCHECK +# undef execve +# if HAVE_RAW_DECL_EXECVE +_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - " + "use gnulib module execve for portability"); +# endif +#elif @GNULIB_MDA_EXECVE@ +/* On native Windows, map 'execve' to '_execve', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execve always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve _execve +# endif +_GL_CXXALIAS_MDA_CAST (execve, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#endif + +#if @GNULIB_EXECVP@ +# if @REPLACE_EXECVP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp rpl_execvp +# endif +_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#elif defined GNULIB_POSIXCHECK +# undef execvp +# if HAVE_RAW_DECL_EXECVP +_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - " + "use gnulib module execvp for portability"); +# endif +#elif @GNULIB_MDA_EXECVP@ +/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execvp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp _execvp +# endif +_GL_CXXALIAS_MDA_CAST (execvp, intptr_t, + (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#endif + +#if @GNULIB_EXECVPE@ +# if @REPLACE_EXECVPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe rpl_execvpe +# endif +_GL_FUNCDECL_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# else +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execvpe); +#elif defined GNULIB_POSIXCHECK +# undef execvpe +# if HAVE_RAW_DECL_EXECVPE +_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - " + "use gnulib module execvpe for portability"); +# endif +#elif @GNULIB_MDA_EXECVPE@ +/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe _execvpe +# endif +_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# elif @HAVE_EXECVPE@ +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@ +_GL_CXXALIASWARN (execvpe); +# endif +#endif + + #if @GNULIB_FACCESSAT@ # if @REPLACE_FACCESSAT@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -607,7 +978,7 @@ _GL_CXXALIASWARN (fchownat); # undef fchownat # if HAVE_RAW_DECL_FCHOWNAT _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " - "use gnulib module openat for portability"); + "use gnulib module fchownat for portability"); # endif #endif @@ -695,6 +1066,12 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " # endif _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getcwd +# define getcwd _getcwd +# endif +_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size)); # else /* Need to cast, because on mingw, the second parameter is int size. */ @@ -707,6 +1084,22 @@ _GL_CXXALIASWARN (getcwd); _GL_WARN_ON_USE (getcwd, "getcwd is unportable - " "use gnulib module getcwd for portability"); # endif +#elif @GNULIB_MDA_GETCWD@ +/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getcwd always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getcwd +# define getcwd _getcwd +# endif +/* Need to cast, because on mingw, the second parameter is either + 'int size' or 'size_t size'. */ +_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size)); +# else +_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); +# endif +_GL_CXXALIASWARN (getcwd); #endif @@ -1041,6 +1434,23 @@ _GL_WARN_ON_USE (getpass, "getpass is unportable - " #endif +#if @GNULIB_MDA_GETPID@ +/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getpid always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpid +# define getpid _getpid +# endif +_GL_CXXALIAS_MDA (getpid, int, (void)); +# else +_GL_CXXALIAS_SYS (getpid, pid_t, (void)); +# endif +_GL_CXXALIASWARN (getpid); +#endif + + #if @GNULIB_GETUSERSHELL@ /* Return the next valid login shell on the system, or NULL when the end of the list has been reached. */ @@ -1113,6 +1523,12 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - " # endif _GL_FUNCDECL_RPL (isatty, int, (int fd)); _GL_CXXALIAS_RPL (isatty, int, (int fd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty _isatty +# endif +_GL_CXXALIAS_MDA (isatty, int, (int fd)); # else _GL_CXXALIAS_SYS (isatty, int, (int fd)); # endif @@ -1123,6 +1539,20 @@ _GL_CXXALIASWARN (isatty); _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " "use gnulib module isatty for portability"); # endif +#elif @GNULIB_MDA_ISATTY@ +/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::isatty always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty _isatty +# endif +_GL_CXXALIAS_MDA (isatty, int, (int fd)); +# else +_GL_CXXALIAS_SYS (isatty, int, (int fd)); +# endif +_GL_CXXALIASWARN (isatty); #endif @@ -1234,6 +1664,12 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - " # endif _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lseek +# define lseek _lseek +# endif +_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence)); # else _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); # endif @@ -1244,6 +1680,20 @@ _GL_CXXALIASWARN (lseek); _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " "systems - use gnulib module lseek for portability"); # endif +#elif @GNULIB_MDA_LSEEK@ +/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::lseek always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lseek +# define lseek _lseek +# endif +_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence)); +# else +_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); +# endif +_GL_CXXALIASWARN (lseek); #endif @@ -1376,11 +1826,32 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - " _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read _read +# endif +_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count)); +# else +_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#elif @GNULIB_MDA_READ@ +/* On native Windows, map 'read' to '_read', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::read always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read _read +# endif +# ifdef __MINGW32__ +_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count)); +# else +_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count)); +# endif # else -/* Need to cast, because on mingw, the third parameter is - unsigned int count - and the return type is 'int'. */ -_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); +_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); # endif _GL_CXXALIASWARN (read); #endif @@ -1465,6 +1936,12 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - " # endif _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (rmdir, int, (char const *name)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rmdir +# define rmdir _rmdir +# endif +_GL_CXXALIAS_MDA (rmdir, int, (char const *name)); # else _GL_CXXALIAS_SYS (rmdir, int, (char const *name)); # endif @@ -1475,6 +1952,20 @@ _GL_CXXALIASWARN (rmdir); _GL_WARN_ON_USE (rmdir, "rmdir is unportable - " "use gnulib module rmdir for portability"); # endif +#elif @GNULIB_MDA_RMDIR@ +/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::rmdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rmdir +# define rmdir _rmdir +# endif +_GL_CXXALIAS_MDA (rmdir, int, (char const *name)); +# else +_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); +# endif +_GL_CXXALIASWARN (rmdir); #endif @@ -1533,6 +2024,23 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - " #endif +#if @GNULIB_MDA_SWAB@ +/* On native Windows, map 'swab' to '_swab', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::creat always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef swab +# define swab _swab +# endif +_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n)); +# else +_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n)); +# endif +_GL_CXXALIASWARN (swab); +#endif + + #if @GNULIB_SYMLINK@ # if @REPLACE_SYMLINK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1657,6 +2165,12 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - " # endif _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (unlink, int, (char const *file)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink _unlink +# endif +_GL_CXXALIAS_MDA (unlink, int, (char const *file)); # else _GL_CXXALIAS_SYS (unlink, int, (char const *file)); # endif @@ -1667,6 +2181,20 @@ _GL_CXXALIASWARN (unlink); _GL_WARN_ON_USE (unlink, "unlink is not portable - " "use gnulib module unlink for portability"); # endif +#elif @GNULIB_MDA_UNLINK@ +/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::unlink always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink _unlink +# endif +_GL_CXXALIAS_MDA (unlink, int, (char const *file)); +# else +_GL_CXXALIAS_SYS (unlink, int, (char const *file)); +# endif +_GL_CXXALIASWARN (unlink); #endif @@ -1691,7 +2219,7 @@ _GL_CXXALIASWARN (unlinkat); # undef unlinkat # if HAVE_RAW_DECL_UNLINKAT _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " - "use gnulib module openat for portability"); + "use gnulib module unlinkat for portability"); # endif #endif @@ -1738,11 +2266,32 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - " _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write _write +# endif +_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); +# else +_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (write); +#elif @GNULIB_MDA_WRITE@ +/* On native Windows, map 'write' to '_write', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::write always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write _write +# endif +# ifdef __MINGW32__ +_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count)); +# else +_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count)); +# endif # else -/* Need to cast, because on mingw, the third parameter is - unsigned int count - and the return type is 'int'. */ -_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count)); +_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); # endif _GL_CXXALIASWARN (write); #endif diff --git a/gnulib/import/unsetenv.c b/gnulib/import/unsetenv.c index 766df35..11089a0 100644 --- a/gnulib/import/unsetenv.c +++ b/gnulib/import/unsetenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2002, 2005-2020 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2002, 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/verify.h b/gnulib/import/verify.h index f109761..3cdcdca 100644 --- a/gnulib/import/verify.h +++ b/gnulib/import/verify.h @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,11 +23,15 @@ /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC) works as per C11. This is supported by GCC 4.6.0 and later, in C - mode. + mode, and by clang (also in C++ mode). Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as - per C2X, and define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) - works as per C++17. This is supported by GCC 9.1 and later. + per C2X. This is supported by GCC 9.1 and later, and by clang in + C++1z mode. + + Define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) works as per + C++17. This is supported by GCC 9.1 and later, and by clang in + C++1z mode. Support compilers claiming conformance to the relevant standard, and also support GCC when not pedantic. If we were willing to slow @@ -35,7 +39,8 @@ since this affects only the quality of diagnostics, why bother? */ #ifndef __cplusplus # if (201112L <= __STDC_VERSION__ \ - || (!defined __STRICT_ANSI__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__))) + || (!defined __STRICT_ANSI__ \ + && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 4 <= __clang_major__))) # define _GL_HAVE__STATIC_ASSERT 1 # endif # if (202000L <= __STDC_VERSION__ \ @@ -43,7 +48,15 @@ # define _GL_HAVE__STATIC_ASSERT1 1 # endif #else -# if 201703L <= __cplusplus || 9 <= __GNUC__ +# if 4 <= __clang_major__ +# define _GL_HAVE__STATIC_ASSERT 1 +# endif +# if 4 <= __clang_major__ && 201411 <= __cpp_static_assert +# define _GL_HAVE__STATIC_ASSERT1 1 +# endif +# if 201703L <= __cplusplus \ + || 9 <= __GNUC__ \ + || (4 <= __clang_major__ && 201411 <= __cpp_static_assert) # define _GL_HAVE_STATIC_ASSERT1 1 # endif #endif @@ -292,7 +305,12 @@ template <int w> Although assuming R can help a compiler generate better code or diagnostics, performance can suffer if R uses hard-to-optimize - features such as function calls not inlined by the compiler. */ + features such as function calls not inlined by the compiler. + + Avoid Clang's __builtin_assume, as it breaks GNU Emacs master + as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see + <https://bugs.gnu.org/43152#71>. It's not known whether this breakage + is a Clang bug or an Emacs bug; play it safe for now. */ #if _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) diff --git a/gnulib/import/warn-on-use.h b/gnulib/import/warn-on-use.h index 23c10fd..5d5b17f 100644 --- a/gnulib/import/warn-on-use.h +++ b/gnulib/import/warn-on-use.h @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -87,6 +87,13 @@ extern __typeof__ (function) function __attribute__ ((__warning__ (message))) # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ __attribute__ ((__warning__ (message))) +# elif __clang_major__ >= 4 +/* Another compiler attribute is available in clang. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function \ + __attribute__ ((__diagnose_if__ (1, message, "warning"))) +# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ + __attribute__ ((__diagnose_if__ (1, message, "warning"))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ # define _GL_WARN_ON_USE(function, message) \ @@ -99,27 +106,33 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use # endif #endif -/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") - is like _GL_WARN_ON_USE (function, "string"), except that in C++ mode the +/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") + is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the function is declared with the given prototype, consisting of return type, parameters, and attributes. This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does not work in this case. */ #ifndef _GL_WARN_ON_USE_CXX # if !defined __cplusplus -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ _GL_WARN_ON_USE (function, msg) # else # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_gcc function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __clang_major__ >= 4 +/* Another compiler attribute is available in clang. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_clang function parameters_and_attributes \ + __attribute__ ((__diagnose_if__ (1, msg, "warning"))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_gcc function parameters_and_attributes # else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ _GL_WARN_EXTERN_C int _gl_warn_on_use # endif # endif diff --git a/gnulib/import/wchar.in.h b/gnulib/import/wchar.in.h index 7640a14..cdda680 100644 --- a/gnulib/import/wchar.in.h +++ b/gnulib/import/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wchar.h>, for platforms that have issues. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,20 +65,12 @@ # include <features.h> /* for __GLIBC__ */ #endif -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. - In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined +/* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined by <stddef.h>. But avoid namespace pollution on glibc systems. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include <stddef.h> #endif -#ifndef __GLIBC__ -# include <stdio.h> -# include <time.h> -#endif /* Include the original <wchar.h> if it exists. Some builds of uClibc lack it. */ @@ -95,7 +87,7 @@ /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ #ifndef _GL_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define _GL_ATTRIBUTE_PURE /* empty */ @@ -942,10 +934,18 @@ _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - " /* Duplicate S, returning an identical malloc'd string. */ #if @GNULIB_WCSDUP@ -# if !@HAVE_WCSDUP@ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsdup +# define wcsdup _wcsdup +# endif +_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s)); +# else +# if !@HAVE_WCSDUP@ _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s)); -# endif +# endif _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# endif _GL_CXXALIASWARN (wcsdup); #elif defined GNULIB_POSIXCHECK # undef wcsdup @@ -953,6 +953,25 @@ _GL_CXXALIASWARN (wcsdup); _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - " "use gnulib module wcsdup for portability"); # endif +#elif @GNULIB_MDA_WCSDUP@ +/* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::wcsdup always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsdup +# define wcsdup _wcsdup +# endif +_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s)); +# else +_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# if @HAVE_DECL_WCSDUP@ +_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@ +_GL_CXXALIASWARN (wcsdup); +# endif #endif diff --git a/gnulib/import/wctype.in.h b/gnulib/import/wctype.in.h index 57b8692..d1c4a30 100644 --- a/gnulib/import/wctype.in.h +++ b/gnulib/import/wctype.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wctype.h>, for platforms that lack it. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,14 +45,7 @@ #ifndef _@GUARD_PREFIX@_WCTYPE_H #if @HAVE_WINT_T@ -/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. - Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -# include <stddef.h> -# include <stdio.h> -# include <time.h> +/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ # include <wchar.h> #endif diff --git a/gnulib/import/windows-initguard.h b/gnulib/import/windows-initguard.h index c4be45a..afdd8e7 100644 --- a/gnulib/import/windows-initguard.h +++ b/gnulib/import/windows-initguard.h @@ -1,5 +1,5 @@ /* Init guards, somewhat like spinlocks (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-mutex.c b/gnulib/import/windows-mutex.c index 7eb38a2..b86c829 100644 --- a/gnulib/import/windows-mutex.c +++ b/gnulib/import/windows-mutex.c @@ -1,5 +1,5 @@ /* Plain mutexes (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-mutex.h b/gnulib/import/windows-mutex.h index 748b988..6300035 100644 --- a/gnulib/import/windows-mutex.h +++ b/gnulib/import/windows-mutex.h @@ -1,5 +1,5 @@ /* Plain mutexes (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-once.c b/gnulib/import/windows-once.c index c431bd6..3c4a386 100644 --- a/gnulib/import/windows-once.c +++ b/gnulib/import/windows-once.c @@ -1,5 +1,5 @@ /* Once-only control (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-once.h b/gnulib/import/windows-once.h index d31717e..9dfbf3f 100644 --- a/gnulib/import/windows-once.h +++ b/gnulib/import/windows-once.h @@ -1,5 +1,5 @@ /* Once-only control (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-recmutex.c b/gnulib/import/windows-recmutex.c index db3c40c..8e2bd14 100644 --- a/gnulib/import/windows-recmutex.c +++ b/gnulib/import/windows-recmutex.c @@ -1,5 +1,5 @@ /* Plain recursive mutexes (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-recmutex.h b/gnulib/import/windows-recmutex.h index 3b315e5..d3a8f47 100644 --- a/gnulib/import/windows-recmutex.h +++ b/gnulib/import/windows-recmutex.h @@ -1,5 +1,5 @@ /* Plain recursive mutexes (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-rwlock.c b/gnulib/import/windows-rwlock.c index 64e761c..2c3f922 100644 --- a/gnulib/import/windows-rwlock.c +++ b/gnulib/import/windows-rwlock.c @@ -1,5 +1,5 @@ /* Read-write locks (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/windows-rwlock.h b/gnulib/import/windows-rwlock.h index ae5b82f..7198c1e 100644 --- a/gnulib/import/windows-rwlock.h +++ b/gnulib/import/windows-rwlock.h @@ -1,5 +1,5 @@ /* Read-write locks (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/wmemchr-impl.h b/gnulib/import/wmemchr-impl.h index 55231b3..ab08897 100644 --- a/gnulib/import/wmemchr-impl.h +++ b/gnulib/import/wmemchr-impl.h @@ -1,5 +1,5 @@ /* Search wide character array for a wide character. - Copyright (C) 1999, 2011-2020 Free Software Foundation, Inc. + Copyright (C) 1999, 2011-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 1999. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/wmemchr.c b/gnulib/import/wmemchr.c index b4f1970..549818f 100644 --- a/gnulib/import/wmemchr.c +++ b/gnulib/import/wmemchr.c @@ -1,5 +1,5 @@ /* Search wide character array for a wide character. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnulib/import/wmempcpy.c b/gnulib/import/wmempcpy.c index 2e96ed8..64ffe39 100644 --- a/gnulib/import/wmempcpy.c +++ b/gnulib/import/wmempcpy.c @@ -1,5 +1,5 @@ /* Copy wide character array, return pointer after last written wide character. - Copyright (C) 2020 Free Software Foundation, Inc. + Copyright (C) 2020-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/xalloc-oversized.h b/gnulib/import/xalloc-oversized.h index 13ee230..53daf59 100644 --- a/gnulib/import/xalloc-oversized.h +++ b/gnulib/import/xalloc-oversized.h @@ -1,6 +1,6 @@ /* xalloc-oversized.h -- memory allocation size checking - Copyright (C) 1990-2000, 2003-2004, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ typedef size_t __xalloc_count_type; positive and N must be nonnegative. This is a macro, not a function, so that it works correctly even when SIZE_MAX < N. */ -#if 7 <= __GNUC__ +#if 7 <= __GNUC__ && !defined __clang__ # define xalloc_oversized(n, s) \ __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1) #elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ |