]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agolocalename: Use module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 20:11:50 +0000 (22:11 +0200)]
localename: Use module 'thread-optim'.

* lib/localename.c: Include thread-optim.h.
(struniq): Use IF_MT macro.
* modules/localename (Depends-on): Add thread-optim.

4 years agoclean-temp: Use module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 20:09:09 +0000 (22:09 +0200)]
clean-temp: Use module 'thread-optim'.

* lib/clean-temp.c: Include thread-optim.h.
(register_temporary_file, unregister_temporary_file, create_temp_dir,
register_temp_file, unregister_temp_file, register_temp_subdir,
unregister_temp_subdir, cleanup_temp_dir_contents, register_fd,
close_temp, fclose_variant_temp): Use IF_MT macro.
* modules/clean-temp (Depends-on): Add thread-optim.

4 years agofatal-signal: Use module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 20:05:25 +0000 (22:05 +0200)]
fatal-signal: Use module 'thread-optim'.

* lib/fatal-signal.c: Include thread-optim.h.
(at_fatal_signal, block_fatal_signals, unblock_fatal_signals): Use IF_MT
macro.
* modules/fatal-signal (Depends-on): Add thread-optim.

4 years agoNew module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 17:47:28 +0000 (19:47 +0200)]
New module 'thread-optim'.

* lib/thread-optim.h: New file.
* modules/thread-optim: New file.
* doc/multithread.texi (Multithreading Optimizations): New section.

4 years agodoc: more updates for glibc 2.32
Paul Eggert [Fri, 7 Aug 2020 22:26:27 +0000 (15:26 -0700)]
doc: more updates for glibc 2.32

* doc/glibc-functions/lchmod.texi, doc/posix-functions/faccessat.texi:
* doc/posix-functions/fchmodat.texi: Update.

4 years agodoc: Update for glibc 2.32.
Bruno Haible [Fri, 7 Aug 2020 21:02:21 +0000 (23:02 +0200)]
doc: Update for glibc 2.32.

* doc/glibc-functions/__libc_single_threaded.texi: New file.
* doc/glibc-functions/pthread_attr_getsigmask_np.texi: New file.
* doc/glibc-functions/pthread_attr_setsigmask_np.texi: New file.
* doc/glibc-functions/sigabbrev_np.texi: New file.
* doc/glibc-functions/sigdescr_np.texi: New file.
* doc/glibc-functions/strerrordesc_np.texi: New file.
* doc/glibc-functions/strerrorname_np.texi: New file.
* doc/gnulib.texi: Include them.
(Glibc sys/single_threaded.h): New section.
* doc/pastposix-functions/h_errno.texi: Update.
* doc/posix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

4 years agoalloca: No need to compile alloca.c with clang.
Bruno Haible [Fri, 7 Aug 2020 12:55:22 +0000 (14:55 +0200)]
alloca: No need to compile alloca.c with clang.

* lib/alloca.c: Skip all code with clang.

4 years agoUse __builtin_alloca with clang.
Bruno Haible [Fri, 7 Aug 2020 11:19:48 +0000 (13:19 +0200)]
Use __builtin_alloca with clang.

* lib/alloca.in.h (alloca): Define as __builtin_alloca on clang.

4 years agoUse __builtin_assume with clang.
Bruno Haible [Fri, 7 Aug 2020 00:12:09 +0000 (02:12 +0200)]
Use __builtin_assume with clang.

* lib/verify.h (_GL_HAS_BUILTIN_ASSUME): New macro.
(assume): Use __builtin_assume when available.

4 years agolibgmp: add <gmp/gmp.h> support
Paul Eggert [Thu, 6 Aug 2020 21:53:08 +0000 (14:53 -0700)]
libgmp: add <gmp/gmp.h> support

* m4/libgmp.m4 (gl_LIBGMP):
* modules/libgmp (configure.ac, Makefile.am):
Support platforms requiring ‘#include <gmp/gmp.h>’ instead of
‘#include <gmp.h>’.

4 years agoConsider that clang defines __OPTIMIZE__ like GCC does.
Bruno Haible [Thu, 6 Aug 2020 18:55:13 +0000 (20:55 +0200)]
Consider that clang defines __OPTIMIZE__ like GCC does.

* lib/streq.h: Define the inline functions also on clang.
* lib/c-strcaseeq.h: Likewise.
* lib/c++defs.h (_GL_CXXALIASWARN_2, _GL_CXXALIASWARN1_2): Don't enable
the GCC workaround to clang.

4 years agosafe-alloc: Remove unused code.
Bruno Haible [Thu, 6 Aug 2020 18:41:33 +0000 (20:41 +0200)]
safe-alloc: Remove unused code.

* lib/safe-alloc.h (__GNUC_PREREQ): Remove macro.

4 years agoUse __builtin_expect with clang everywhere.
Bruno Haible [Thu, 6 Aug 2020 18:34:29 +0000 (20:34 +0200)]
Use __builtin_expect with clang everywhere.

* lib/cdefs.h (__glibc_unlikely, __glibc_likely): Use the GCC built-in
also on clang.

4 years agoUse __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang everywhere.
Bruno Haible [Wed, 5 Aug 2020 17:57:21 +0000 (19:57 +0200)]
Use __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang everywhere.

* lib/count-trailing-zeros.h (COUNT_TRAILING_ZEROS): Use the GCC
built-in also on clang.
* lib/ffs.c: With clang, use the GCC built-in, not <intrin.h>.
* lib/ffsl.h: Likewise. Assume GCC_BUILTIN is defined.

4 years agoUse __builtin_clz{,l,ll} with clang, also on Windows.
Bruno Haible [Wed, 5 Aug 2020 17:25:42 +0000 (19:25 +0200)]
Use __builtin_clz{,l,ll} with clang, also on Windows.

* lib/integer_length.c: With clang, use the GCC built-in, not
<intrin.h>.
* lib/integer_length_l.c: Likewise.
* lib/count-leading-zeros.h (COUNT_LEADING_ZEROS): Use the GCC built-in
also on clang.
* lib/vasnprintf.c (divide): Likewise.

4 years agoUpdate srclist.txt as per recent glibc changes
Paul Eggert [Wed, 5 Aug 2020 06:54:47 +0000 (23:54 -0700)]
Update srclist.txt as per recent glibc changes

* config/srclist.txt: Uncomment lines to reflect recent merges
from Gnulib to glibc.

4 years agoPrefer documented autoconf macro 'm4_if' over 'ifelse'.
Bruno Haible [Mon, 3 Aug 2020 23:52:48 +0000 (01:52 +0200)]
Prefer documented autoconf macro 'm4_if' over 'ifelse'.

* m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Use m4_if instead of ifelse.

4 years agointeger_length_ll: Optimize for MSVC in 64-bit mode.
Bruno Haible [Mon, 3 Aug 2020 23:17:36 +0000 (01:17 +0200)]
integer_length_ll: Optimize for MSVC in 64-bit mode.

* lib/integer_length_l.c (MSVC_BUILTIN): Define for MSVC in 64-bit mode.
(FUNC): On MSVC, use MSVC_BUILTIN if defined.

4 years agointeger_length_ll: Optimize for MSVC in 32-bit mode.
Bruno Haible [Mon, 3 Aug 2020 23:10:23 +0000 (01:10 +0200)]
integer_length_ll: Optimize for MSVC in 32-bit mode.

* lib/integer_length_l.c: Include <intrin.h>.
(integer_length): Define as inline function, like in
lib/integer_length.c.

4 years agointeger_length: Optimize for MSVC.
Bruno Haible [Mon, 3 Aug 2020 22:40:24 +0000 (00:40 +0200)]
integer_length: Optimize for MSVC.

* lib/integer_length.c: Include <intrin.h>.
(integer_length): With MSVC, use the _BitScanReverse built-in.

4 years agoffsll: Optimize for MSVC in 64-bit mode.
Bruno Haible [Mon, 3 Aug 2020 22:13:46 +0000 (00:13 +0200)]
ffsll: Optimize for MSVC in 64-bit mode.

* lib/ffsl.h (FUNC): On MSVC, use MSVC_BUILTIN if defined.
* lib/ffsll.c (MSVC_BUILTIN): Define for MSVC in 64-bit mode.
* lib/ffsl.c (MSVC_BUILTIN): Define for MSVC.

4 years agoffsll: Optimize for MSVC in 32-bit mode.
Bruno Haible [Mon, 3 Aug 2020 22:11:02 +0000 (00:11 +0200)]
ffsll: Optimize for MSVC in 32-bit mode.

* lib/ffsl.h: Include <intrin.h>.
(ffs): Define as inline function, like in lib/ffs.c.

4 years agoffs: Optimize for MSVC.
Bruno Haible [Mon, 3 Aug 2020 22:05:05 +0000 (00:05 +0200)]
ffs: Optimize for MSVC.

* lib/ffs.c: Include <intrin.h>.
(ffs): With MSVC, use the _BitScanForward built-in.

4 years agosigprocmask: Try to avoid breakage for people who use an Autoconf cache.
Bruno Haible [Mon, 3 Aug 2020 21:43:55 +0000 (23:43 +0200)]
sigprocmask: Try to avoid breakage for people who use an Autoconf cache.

* m4/signalblocking.m4 (gl_SIGNALBLOCKING): Change the name of the cache
variable.

4 years agofopen: Avoid undesired interactions with glibc headers.
Harald van Dijk [Mon, 3 Aug 2020 19:59:04 +0000 (21:59 +0200)]
fopen: Avoid undesired interactions with glibc headers.

* lib/fopen.c (_GL_ALREADY_INCLUDING_STDIO_H): Define this instead of
__need_FILE, as the latter does not work with glibc.

4 years agofcntl: document some F_SETLK errno variations
Paul Eggert [Sun, 2 Aug 2020 23:54:07 +0000 (16:54 -0700)]
fcntl: document some F_SETLK errno variations

* doc/posix-functions/fcntl.texi (fcntl): Document
OpenIndiana, GNU/Linux, FreeBSD on NFS files.

4 years agooset: Add an 'iterator_atleast' operation.
Bruno Haible [Sun, 2 Aug 2020 18:57:11 +0000 (20:57 +0200)]
oset: Add an 'iterator_atleast' operation.

* lib/gl_array_oset.c (gl_array_indexof_atleast): New function,
extracted from gl_array_search_atleast.
(gl_array_search_atleast): Use it.
(gl_array_iterator_atleast): New function.
(gl_array_oset_implementation): Use it.
* lib/gl_anytree_oset.h (gl_tree_iterator_atleast): New function.
* lib/gl_avltree_oset.c (gl_avltree_oset_implementation): Use it.
* lib/gl_rbtree_oset.c (gl_rbtree_oset_implementation): Likewise.
* lib/gl_oset.h (struct gl_oset_implementation): Add 'iterator_atleast'
member.
(gl_oset_iterator_atleast): New function.
* lib/gl_oset.hh (gl_OSet): Add 'begin_atleast' member.
(gl_OSet::iterator): Add another auxiliary constructor.
* tests/test-array_oset.c (is_at_least, gl_sortedlist_indexof_atleast):
New functions.
(main): Test also gl_oset_iterator_atleast.
* tests/test-avltree_oset.c (is_at_least): New function.
(main): Test also gl_oset_iterator_atleast.
* tests/test-rbtree_oset.c (is_at_least): New function.
(main): Test also gl_oset_iterator_atleast.
* tests/test-oset-c++.cc (is_at_most): New function.
(main): Test also gl_OSet::begin_atleast.

4 years agooset-c++, omap-c++: Remove restriction for search_atleast method.
Bruno Haible [Sun, 2 Aug 2020 18:19:31 +0000 (20:19 +0200)]
oset-c++, omap-c++: Remove restriction for search_atleast method.

* lib/gl_oset.hh (gl_OSet::search_atleast): Allow the threshold to be of
a different type than the element.
* lib/gl_omap.hh (gl_OMap::search_atleast): Allow the threshold to be of
a different type than the key.

4 years agognumakefile: say ‘$(MAKE)’ not ‘make’
Paul Eggert [Sat, 1 Aug 2020 23:19:37 +0000 (16:19 -0700)]
gnumakefile: say ‘$(MAKE)’ not ‘make’

* top/GNUmakefile (abort-due-to-no-makefile):
Prefer ‘$(MAKE)’ to ‘make’ in a diagnostic.
This change is backported from Autoconf.

4 years agoPrefer documented autoconf macro 'm4_if' over 'ifelse'.
Bruno Haible [Sat, 1 Aug 2020 20:37:05 +0000 (22:37 +0200)]
Prefer documented autoconf macro 'm4_if' over 'ifelse'.

* m4/autobuild.m4 (AB_INIT): Use m4_if instead of ifelse.
* m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
* m4/javacomp.m4 (gt_JAVACOMP): Likewise.
* m4/javaexec.m4 (gt_JAVAEXEC): Likewise.
* m4/libtextstyle.m4 (gl_LIBTEXTSTYLE): Likewise.

4 years agolibtextstyle-optional: Update tests.
Bruno Haible [Sat, 1 Aug 2020 18:48:44 +0000 (20:48 +0200)]
libtextstyle-optional: Update tests.

* modules/libtextstyle-optional-tests (configure.ac): Invoke
gl_LIBTEXTSTYLE_OPTIONAL.

4 years agoparse-datetime: Fix wrong #line statements.
Bruno Haible [Sat, 1 Aug 2020 14:02:16 +0000 (16:02 +0200)]
parse-datetime: Fix wrong #line statements.

* modules/parse-datetime (Makefile.am): Correct #line statements also in
parse-datetime-gen.h.

4 years agolibtextstyle[-optional]: Allow requesting a minimum version.
Bruno Haible [Sat, 1 Aug 2020 13:04:52 +0000 (15:04 +0200)]
libtextstyle[-optional]: Allow requesting a minimum version.

* m4/libtextstyle.m4 (gl_LIBTEXTSTYLE): Allow an optional argument.
(gl_LIBTEXTSTYLE_NEWEST_VERSION, gl_LIBTEXTSTYLE_INITIALIZE,
gl_LIBTEXTSTYLE_SEARCH): New macros.
* modules/libtextstyle (configure.ac): Don't invoke gl_LIBTEXTSTYLE.
* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Allow an
optional argument. Invoke, not require, gl_LIBTEXTSTYLE.
* modules/libtextstyle-optional (configure.ac): Don't invoke
gl_LIBTEXTSTYLE_OPTIONAL.
* NEWS: Mention the changes.

4 years ago_GL_CMP: Improve documentation.
Bruno Haible [Fri, 31 Jul 2020 09:32:02 +0000 (11:32 +0200)]
_GL_CMP: Improve documentation.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00188.html>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Clarify what arguments can be
passed.

4 years agolargefile: sync with Autoconf master
Paul Eggert [Fri, 31 Jul 2020 02:12:44 +0000 (19:12 -0700)]
largefile: sync with Autoconf master

* m4/largefile.m4 (_AC_SYS_LARGEFILE_TEST_INCLUDES):
Avoid undefined behavior on platforms where off_t is 32 bits.
See: https://bugs.debian.org/742780

4 years agoalloca: sync with Autoconf master
Paul Eggert [Fri, 31 Jul 2020 02:06:49 +0000 (19:06 -0700)]
alloca: sync with Autoconf master

* m4/alloca.m4 (_AC_LIBOBJ_ALLOCA):
Do not define if Autoconf 2.70 or later, since Autoconf master
now matches us.

4 years agounicodeio: Add comment.
Bruno Haible [Thu, 30 Jul 2020 18:20:57 +0000 (20:20 +0200)]
unicodeio: Add comment.

* lib/unicodeio.c (unicode_to_mb): Clarify why the code distinguishes
different iconv behaviours.

4 years agoWork around some Oracle Studio attribute bugs
Paul Eggert [Thu, 30 Jul 2020 16:27:18 +0000 (09:27 -0700)]
Work around some Oracle Studio attribute bugs

These were discovered when building bleeding-edge Emacs with
Oracle Studio.
* m4/gnulib-common.m4 (_GL_ATTRIBUTE_COLD, _GL_ATTRIBUTE_MAY_ALIAS):
Port to Oracle Studio 12.6, which mishandles __attribute__
((__cold__)) and __attribute__ ((__may_alias__)) even though
__has_attribute says they work.

4 years agounicodeio: Fix wrong result on musl libc.
Bruno Haible [Thu, 30 Jul 2020 01:29:29 +0000 (03:29 +0200)]
unicodeio: Fix wrong result on musl libc.

Reported by A. Wilcox <awilfox@adelielinux.org> in
<https://www.openwall.com/lists/musl/2020/07/29/2>.

* lib/unicodeio.c (unicode_to_mb): Handle asterisk fallback characters
on musl libc.
* m4/unicodeio.m4 (gl_UNICODEIO): Invoke gl_MUSL_LIBC.
* modules/unicodeio (Files): Add m4/musl.m4.

4 years agofsusage, regex, stat-size: remove Cray support
Paul Eggert [Wed, 29 Jul 2020 20:39:37 +0000 (13:39 -0700)]
fsusage, regex, stat-size: remove Cray support

As near as I can make out this is actually support for UNICOS/mp,
last released 2005, and Cray hasn’t supported that for years.
* config/srclist.txt: Comment out regex.h for now.
* lib/fsusage.c (get_fs_usage):
* lib/regex.h (re_comp, re_exec):
* lib/stat-size.h (ST_NBLOCKSIZE):
Don’t worry about _CRAY.

4 years agoFix last ChangeLog entry.
Bruno Haible [Wed, 29 Jul 2020 16:24:13 +0000 (18:24 +0200)]
Fix last ChangeLog entry.

4 years agoparse-datetime: Fix compilation error with bison 3.7.
Bruno Haible [Wed, 29 Jul 2020 16:18:18 +0000 (18:18 +0200)]
parse-datetime: Fix compilation error with bison 3.7.

* modules/parse-datetime (Makefile.am): Create a generated header file
parse-datetime-gen.h in the source directory. Correct #include and

4 years agofopen-gnu: Create files correctly (regression from 2020-05-24).
Bruno Haible [Tue, 28 Jul 2020 19:01:06 +0000 (21:01 +0200)]
fopen-gnu: Create files correctly (regression from 2020-05-24).

* lib/fopen.c (rpl_open): Pass a third argument to open().

4 years agoxalloc-die: don’t depend on xalloc
Paul Eggert [Tue, 28 Jul 2020 00:21:51 +0000 (17:21 -0700)]
xalloc-die: don’t depend on xalloc

This removes a circular dependency, as xalloc depends on xalloc-die.
* modules/xalloc-die (Files): Add lib/xalloc.h.
(Depends-on): Remove xalloc.
Add extern-inline, stdint, xalloc-oversized (this is for xalloc.h).

4 years agodfa-tests: port to MSVC
Paul Eggert [Mon, 27 Jul 2020 19:57:45 +0000 (12:57 -0700)]
dfa-tests: port to MSVC

Problem reported by Gisle Vanem in:
https://lists.gnu.org/r/bug-gnulib/2020-07/msg00159.html
Also, remove an unnecessary dependency on getprogname.
* modules/dfa-tests (Depends-on): Remove getprogname.
* tests/test-dfa-match-aux.c: Do not include getprogname.h.
(exit_status): New static var.
(dfawarn): Set it instead of exiting.
Do not declare as _Noreturn, to pacify MSVC.
(main): Return exit_status.

4 years agoautoupdate
Paul Eggert [Sun, 26 Jul 2020 22:17:46 +0000 (15:17 -0700)]
autoupdate

4 years agoargz: pacify MSVC
Paul Eggert [Sun, 26 Jul 2020 21:38:48 +0000 (14:38 -0700)]
argz: pacify MSVC

* lib/argz.in.h: Avoid "*/*" to pacify MSVC.
Problem reported by Gisle Vanem.

4 years agolibgmp: remove dependency on havelib
Paul Eggert [Sun, 26 Jul 2020 16:57:47 +0000 (09:57 -0700)]
libgmp: remove dependency on havelib

* m4/libgmp.m4 (gl_LIBGMP): If gl_HAVE_MODULE_HAVELIB is not defined,
use the more-traditional AC_SEARCH_LIBS approach.
This should work better with GNU Emacs configuration,
which uses pkg-config instead of a havelib-style approach.
* modules/havelib (gl_HAVE_MODULE_HAVELIB): New witness macro.
* modules/libgmp (Depends-on): Remove havelib.

4 years agolibgmp: remove HAVE_GMP, LIB_GMP
Paul Eggert [Sun, 26 Jul 2020 00:42:18 +0000 (17:42 -0700)]
libgmp: remove HAVE_GMP, LIB_GMP

* m4/libgmp.m4 (gl_LIBGMP): Do not define HAVE_GMP and LIB_GMP, as
they’re redundant.  I’ll adjust GNU Coreutils accordingly.

4 years agointtypes: Remove support for AIX 4.
Bruno Haible [Sun, 26 Jul 2020 13:17:40 +0000 (15:17 +0200)]
inttypes: Remove support for AIX 4.

* lib/inttypes.in.h: Assume that PRI_MACROS_BROKEN is 0.
* m4/inttypes-pri.m4: Remove file.
* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Don't require gt_INTTYPES_PRI.
(gl_INTTYPES_H_DEFAULTS): Don't initialize PRI_MACROS_BROKEN.
* modules/inttypes-incomplete (Makefile.am): Don't substitute
PRI_MACROS_BROKEN.
* modules/inttypes (Files): Remove m4/inttypes-pri.m4.

4 years agogettimeofday: Remove workaround for Mac OS X 10.0.
Bruno Haible [Sun, 26 Jul 2020 11:46:35 +0000 (13:46 +0200)]
gettimeofday: Remove workaround for Mac OS X 10.0.

* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY_CLOBBER): Remove macro.
(gl_FUNC_GETTIMEOFDAY): Don't invoke it.
* lib/gettimeofday.c: Don't include localtime-buffer.h.
(gettimeofday): Don't test GETTIMEOFDAY_CLOBBERS_LOCALTIME.
* lib/localtime.c: Don't test GETTIMEOFDAY_CLOBBERS_LOCALTIME.
* modules/gettimeofday (Depends-on): Remove localtime-buffer.
* modules/localtime-buffer: Remove file.
* lib/localtime-buffer.h: Remove file.
* lib/localtime-buffer.c: Remove file.
* m4/localtime-buffer.m4: Remove file.
* MODULES.html.sh (Date and time <time.h>): Remove localtime-buffer.

4 years agotzset: Remove workaround for Solaris 2.6.
Bruno Haible [Sun, 26 Jul 2020 11:17:18 +0000 (13:17 +0200)]
tzset: Remove workaround for Solaris 2.6.

* m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Remove macro.
(gl_FUNC_TZSET): Don't invoke it. Don't define TZSET_CLOBBERS_LOCALTIME.
Don't require gl_LOCALTIME_BUFFER_DEFAULTS.
* lib/localtime-buffer.h: Don't test TZSET_CLOBBERS_LOCALTIME.
* lib/localtime-buffer.c: Likewise.
* lib/localtime.c: Likewise.
* lib/tzset.c: Don't include localtime-buffer.h.
(tzset): Don't test TZSET_CLOBBERS_LOCALTIME.
* lib/nstrftime.c (__strftime_internal): Assume HAVE_RUN_TZSET_TEST
is 1.
* modules/tzset (Depends-on): Remove localtime-buffer.

4 years agoexpl: Simplify autoconf test.
Bruno Haible [Sun, 26 Jul 2020 10:22:00 +0000 (12:22 +0200)]
expl: Simplify autoconf test.

* m4/expl.m4 (gl_FUNC_EXPL): Merge the "checking whether expl() breaks
with small values..." test into the "checking whether expl works..."
test.

4 years agoalloca: Remove Cray-2 and Cray Y-MP support.
Bruno Haible [Sun, 26 Jul 2020 09:52:44 +0000 (11:52 +0200)]
alloca: Remove Cray-2 and Cray Y-MP support.

* m4/alloca.m4 (_AC_LIBOBJ_ALLOCA): Don't define CRAY_STACKSEG_END.
Enable also on Autoconf >= 2.69.
* lib/alloca.c (ADDRESS_FUNCTION, struct stack_control_header,
struct stack_segment_linkage, struct stk_stat, struct stk_trailer,
i00afunc): Remove.

4 years agomultiarch: Prepare for x86_64+arm64 universal binaries in macOS 11.
Bruno Haible [Sun, 26 Jul 2020 00:00:11 +0000 (02:00 +0200)]
multiarch: Prepare for x86_64+arm64 universal binaries in macOS 11.

* m4/multiarch.m4 (gl_MULTIARCH): Recognize also the ARM architectures.

4 years agosigprocmask: Small autoconf macro improvement.
Bruno Haible [Sat, 25 Jul 2020 23:54:38 +0000 (01:54 +0200)]
sigprocmask: Small autoconf macro improvement.

* m4/signalblocking.m4 (gl_SIGNALBLOCKING): Make it possible for the
user to override the value of gl_cv_func_sigprocmask.
* m4/gnulib-common.m4 (gl_SILENT): New macro.

4 years agoSmall autoconf macro improvements.
Bruno Haible [Sat, 25 Jul 2020 23:45:32 +0000 (01:45 +0200)]
Small autoconf macro improvements.

* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Make it possible for the user to
override the value of gl_cv_func_working_mktime.
* m4/multiarch.m4 (gl_MULTIARCH): Show a line "checking whether the
compiler produces multi-arch binaries..." in the configure output.
* m4/size_max.m4 (gl_SIZE_MAX): When not found, say "no".
* m4/parse-datetime.m4 (gl_C_COMPOUND_LITERALS): Improve indentation.

4 years agodoc: Update for NetBSD 7.1, 8.0, 9.0.
Bruno Haible [Sat, 25 Jul 2020 21:27:40 +0000 (23:27 +0200)]
doc: Update for NetBSD 7.1, 8.0, 9.0.

* doc/*/*.texi: Update.
* m4/exp2l.m4: Update comments.
* m4/expl.m4: Likewise.
* m4/ilogb.m4: Likewise.
* m4/ilogbf.m4: Likewise.
* m4/log10l.m4: Likewise.
* m4/logl.m4: Likewise.
* m4/printf.m4: Likewise.
* m4/rintl.m4: Likewise.
* m4/wcwidth.m4: Likewise.

4 years agodoc: Revert another small part of the last big commit.
Bruno Haible [Sat, 25 Jul 2020 15:11:15 +0000 (17:11 +0200)]
doc: Revert another small part of the last big commit.

4 years agodoc: Fix small mistake in last commit.
Bruno Haible [Sat, 25 Jul 2020 15:03:23 +0000 (17:03 +0200)]
doc: Fix small mistake in last commit.

* doc/posix-functions/open.texi: Keep in sync with doc/posix-headers/fcntl.texi.

4 years agodoc: Update for Mac OS X 10.13.
Bruno Haible [Fri, 24 Jul 2020 23:38:31 +0000 (01:38 +0200)]
doc: Update for Mac OS X 10.13.

* doc/*/*.texi: Update.
* m4/expm1l.m4: Update comments.
* m4/getgroups.m4: Likewise.
* m4/getlogin_r.m4: Likewise.
* m4/linkat.m4: Likewise.
* m4/printf.m4: Likewise.

4 years agodoc: Update for Cygwin 2.9.0.
Bruno Haible [Fri, 24 Jul 2020 23:37:59 +0000 (01:37 +0200)]
doc: Update for Cygwin 2.9.0.

* doc/*/*.texi: Update.

4 years agoparse-datetime: modernize doc
Paul Eggert [Fri, 24 Jul 2020 19:20:14 +0000 (12:20 -0700)]
parse-datetime: modernize doc

* doc/parse-datetime.texi: Use more-current examples.
Don’t lead with 32-bit time_t, as it’s on its way out.
Capitalize “Epoch” to be consistent with POSIX.

4 years agotimespec: remove dependence on ‘verify’
Paul Eggert [Fri, 24 Jul 2020 17:58:46 +0000 (10:58 -0700)]
timespec: remove dependence on ‘verify’

* lib/timespec.h: Do not include verify.h; no longer needed.
* modules/timespec (Depends-on): Remove ‘verify’.

4 years agoOptimize a few more three-valued comparisons
Paul Eggert [Fri, 24 Jul 2020 16:52:36 +0000 (09:52 -0700)]
Optimize a few more three-valued comparisons

* lib/timespec.h (timespec_cmp, timespec_sign):
* lib/utimecmp.c (utimecmpat):
Avoid conditional branches by using _GL_CMP.

4 years agoFix _GL_CMP parenthesization typo
Paul Eggert [Fri, 24 Jul 2020 15:57:05 +0000 (08:57 -0700)]
Fix _GL_CMP parenthesization typo

* m4/gnulib-common.m4 (_GL_CMP): Properly parenthesize.

4 years agodfa: Revert breaking gawk.
Bruno Haible [Fri, 24 Jul 2020 12:25:30 +0000 (14:25 +0200)]
dfa: Revert breaking gawk.

Reported by Arnold Robbins <arnold@skeeve.com>.

* lib/dfa.c (compare): Don't reference the _GL_CMP macro.

4 years agoOptimize three-valued comparison between integers.
Bruno Haible [Wed, 22 Jul 2020 16:35:20 +0000 (18:35 +0200)]
Optimize three-valued comparison between integers.

(a > b ? 1 : a < b ? -1 : 0) is the same as (a > b) - (a < b).

* m4/gnulib-common.m4 (gl_COMMON): Define _GL_CMP.
* lib/c-strcasecmp.c (c_strcasecmp): Use _GL_CMP.
* lib/c-strncasecmp.c (c_strncasecmp): Likewise.
* lib/dfa.c (compare): Likewise.
* lib/fts.c (fts_compare_ino): Likewise.
* lib/mbmemcasecmp.c (mbmemcasecmp): Likewise.
* lib/mbscasecmp.c (mbscasecmp): Likewise.
* lib/mbsncasecmp.c (mbsncasecmp): Likewise.
* lib/memcasecmp.c (memcasecmp): Likewise.
* lib/memcmp2.c (memcmp2): Likewise.
* lib/savedir.c (direntry_cmp_inode): Likewise.
* lib/strcasecmp.c (strcasecmp): Likewise.
* lib/strncasecmp.c (strncasecmp): Likewise.
* lib/unistr/u-cmp2.h (FUNC): Likewise.

4 years agolchmod: Use /proc on Cygwin.
Bruno Haible [Thu, 23 Jul 2020 21:16:05 +0000 (23:16 +0200)]
lchmod: Use /proc on Cygwin.

* lib/lchmod.c (lchmod): Use /proc on Cygwin.

4 years agofchmodat: Use /proc on Cygwin
Ken Brown [Thu, 23 Jul 2020 17:44:22 +0000 (13:44 -0400)]
fchmodat: Use /proc on Cygwin

* lib/fchmodat.c (fchmodat): Use /proc on Cygwin.

4 years agoaligned-malloc: Optionally use aligned_alloc.
Bruno Haible [Tue, 21 Jul 2020 16:09:35 +0000 (18:09 +0200)]
aligned-malloc: Optionally use aligned_alloc.

* lib/aligned-malloc.h: Verify the alignment.
(aligned_malloc): Use aligned_alloc as an alternative.
* modules/aligned-malloc (configure.ac): Test for aligned_alloc.
* doc/posix-functions/aligned_alloc.texi: Mention the modules
'aligned-malloc' and 'pagealign_alloc'.

4 years agoaligned-malloc: Add tests.
Bruno Haible [Tue, 21 Jul 2020 08:04:36 +0000 (10:04 +0200)]
aligned-malloc: Add tests.

* tests/test-aligned-malloc.c: New file.
* modules/aligned-malloc-tests: New file.

4 years agoaligned-malloc: New module.
Bruno Haible [Tue, 21 Jul 2020 08:03:42 +0000 (10:03 +0200)]
aligned-malloc: New module.

* lib/aligned-malloc.h: New file.
* m4/malloc-align.m4: New file.
* modules/aligned-malloc: New file.
* doc/posix-functions/posix_memalign.texi: Mention the new module.
* doc/glibc-functions/memalign.texi: Likewise.

4 years agointtypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows.
Bruno Haible [Tue, 21 Jul 2020 07:53:29 +0000 (09:53 +0200)]
inttypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows.

* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): On 64-bit native Windows, make
sure PRIPTR_PREFIX is defined to "ll", not "l".

4 years agoprintf-posix: Make an autoconf test more future-proof.
Bruno Haible [Tue, 21 Jul 2020 07:48:09 +0000 (09:48 +0200)]
printf-posix: Make an autoconf test more future-proof.

* m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): Include <inttypes.h> before
using uintptr_t.

4 years agolist, oset, omap: Relicense some of the container modules under LGPLv2+.
Bruno Haible [Mon, 20 Jul 2020 19:22:12 +0000 (21:22 +0200)]
list, oset, omap: Relicense some of the container modules under LGPLv2+.

* modules/list (License): Change to LGPLv2+.
* modules/array-list (License): Likewise.
* modules/carray-list (License): Likewise.
* modules/linked-list (License): Likewise.
* modules/avltree-list (License): Likewise.
* modules/rbtree-list (License): Likewise.
* modules/oset (License): Likewise.
* modules/array-oset (License): Likewise.
* modules/avltree-oset (License): Likewise.
* modules/rbtree-oset (License): Likewise.
* modules/omap (License): Likewise.
* modules/array-omap (License): Likewise.
* modules/avltree-omap (License): Likewise.
* modules/rbtree-omap (License): Likewise.

4 years agooset: Add an 'update' operation.
Bruno Haible [Mon, 20 Jul 2020 18:06:29 +0000 (20:06 +0200)]
oset: Add an 'update' operation.

* lib/gl_array_oset.c (gl_array_update): New function.
(gl_array_oset_implementation): Use it.
* lib/gl_avltree_omap.c (NODE_PAYLOAD_DISPOSE): Add parameters.
* lib/gl_rbtree_omap.c (NODE_PAYLOAD_DISPOSE): Add parameters.
* lib/gl_avltree_ordered.h (gl_tree_add_node_before): New function,
extracted from gl_tree_nx_add_before.
(gl_tree_nx_add_before): Invoke it.
(gl_tree_add_node_after): New function, extracted from
gl_tree_nx_add_after.
(gl_tree_nx_add_after): Invoke it.
(gl_tree_remove_node_no_free): New function, extracted from
gl_tree_remove_node.
(gl_tree_remove_node): Invoke it.
* lib/gl_rbtree_ordered.h (gl_tree_add_node_before): New function,
extracted from gl_tree_nx_add_before.
(gl_tree_nx_add_before): Invoke it.
(gl_tree_add_node_after): New function, extracted from
gl_tree_nx_add_after.
(gl_tree_nx_add_after): Invoke it.
(gl_tree_remove_node_no_free): New function, extracted from
gl_tree_remove_node.
(gl_tree_remove_node): Invoke it.
* lib/gl_anytree_oset.h (gl_tree_next_node): New function, extracted
from gl_tree_iterator_next.
(gl_tree_iterator_next): Invoke it.
(gl_tree_prev_node, gl_tree_update): New functions.
* lib/gl_avltree_oset.c (NODE_PAYLOAD_DISPOSE): Add parameters.
(gl_avltree_oset_implementation): Use gl_tree_update.
* lib/gl_rbtree_oset.c (NODE_PAYLOAD_DISPOSE): Add parameters.
(gl_rbtree_oset_implementation): Use gl_tree_update.
* lib/gl_oset.h (struct gl_oset_implementation): Add 'update' member.
(gl_oset_update): New function.
* lib/gl_oset.hh (gl_OSet): Add 'update' member.
* modules/avltree-oset (configure.ac): Require AC_C_INLINE.
* modules/rbtree-oset (configure.ac): Likewise.
* tests/test-oset-update.h: New file.
* tests/test-array_oset.c: Include test-oset-update.h.
(main): Invoke test_update.
* tests/test-avltree_oset.c: Likewise.
* tests/test-rbtree_oset.c: Likewise.
* modules/array-oset-tests (Files): Add tests/test-oset-update.h.
* modules/avltree-oset-tests (Files): Likewise.
* modules/rbtree-oset-tests (Files): Likewise.
* tests/test-oset-c++.cc (action): New function.
(main): Test the 'update' member function.

4 years agomd5, sha1, sha256, sha512: pacify Autoconf 2.70
Paul Eggert [Wed, 15 Jul 2020 17:57:05 +0000 (10:57 -0700)]
md5, sha1, sha256, sha512: pacify Autoconf 2.70

* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Use m4_if rather than a
shell if, so that the argument to AC_CHECK_HEADERS is
a simple string that does not require shell evaluation.
This fixes a warning generated by Autoconf 2.69b.

4 years agoautoupdate
Karl Berry [Mon, 13 Jul 2020 14:17:03 +0000 (07:17 -0700)]
autoupdate

4 years agolibgmp: Avoid warning when --without-libgmp is used.
Bruno Haible [Sun, 12 Jul 2020 21:56:29 +0000 (23:56 +0200)]
libgmp: Avoid warning when --without-libgmp is used.

* lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for
GCC >= 8, not for GCC >= 4.6.

4 years agolibgmp: Link to the correct shared library.
Bruno Haible [Sun, 12 Jul 2020 21:47:52 +0000 (23:47 +0200)]
libgmp: Link to the correct shared library.

* m4/libgmp.m4 (gl_LIBGMP): Invoke AC_LIB_HAVE_LINKFLAGS.
* modules/libgmp (Depends-on): Add havelib.
(Link): Mention $(LIBGMP) and $(LTLIBGMP).
* modules/libgmp-tests (Makefile.am): Link test-libgmp with $(LIBGMP).

4 years agolibgmp tests: Add some safety checks.
Bruno Haible [Sun, 12 Jul 2020 20:51:22 +0000 (22:51 +0200)]
libgmp tests: Add some safety checks.

* modules/libgmp-tests (Depends-on): Add verify.
* tests/test-libgmp.c: Verify GMP_NUMB_BITS value.
(main): Verify that gmp.h and libgmp versions match.

4 years agoAdd a copyright header.
Bruno Haible [Sun, 12 Jul 2020 20:23:30 +0000 (22:23 +0200)]
Add a copyright header.

* tests/test-libgmp.c: Add a copyright header.

4 years agoautoupdate
Karl Berry [Sun, 12 Jul 2020 15:13:33 +0000 (08:13 -0700)]
autoupdate

4 years agoautoupdate
Karl Berry [Sat, 11 Jul 2020 15:09:12 +0000 (08:09 -0700)]
autoupdate

4 years agoautoupdate
Karl Berry [Fri, 10 Jul 2020 15:48:34 +0000 (08:48 -0700)]
autoupdate

4 years agounicodeio: Fix wrong result on NetBSD.
Bruno Haible [Fri, 10 Jul 2020 07:51:52 +0000 (09:51 +0200)]
unicodeio: Fix wrong result on NetBSD.

* lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
characters also on NetBSD.

4 years agounicodeio: Fix wrong result on Solaris 11.
Bruno Haible [Thu, 9 Jul 2020 15:28:48 +0000 (17:28 +0200)]
unicodeio: Fix wrong result on Solaris 11.

Reported by Kiyoshi Kanazawa <yoi_no_myoujou@yahoo.co.jp>
via Akim Demaille <akim.demaille@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00036.html>.

* lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
characters on Solaris.
* tests/test-unicodeio.c (main): In the "C" locale, expect either the
UTF-8 output or the specified fallback.

4 years agounicodeio: Add tests.
Bruno Haible [Wed, 8 Jul 2020 18:01:36 +0000 (20:01 +0200)]
unicodeio: Add tests.

* tests/test-unicodeio.c: New file.
* tests/test-unicodeio1.sh: New file.
* tests/test-unicodeio2.sh: New file.
* tests/test-unicodeio3.sh: New file.
* modules/unicodeio-tests: New file.

4 years agounicodeio: Document link requirements.
Bruno Haible [Wed, 8 Jul 2020 18:00:00 +0000 (20:00 +0200)]
unicodeio: Document link requirements.

* modules/unicodeio (Link): New section.

4 years agodoc: Remove support for some very old platforms.
Bruno Haible [Wed, 8 Jul 2020 01:21:36 +0000 (03:21 +0200)]
doc: Remove support for some very old platforms.

* doc/posix-functions/memcmp.texi: Don't mention "older platforms".
* doc/posix-functions/memcpy.texi: Likewise.
* doc/posix-functions/memmove.texi: Likewise.
* doc/posix-functions/memset.texi: Likewise.
* doc/posix-functions/getcwd.texi: Likewise.

4 years agomemchr: Remove support for some very old platforms.
Bruno Haible [Wed, 8 Jul 2020 01:19:54 +0000 (03:19 +0200)]
memchr: Remove support for some very old platforms.

* m4/memchr-obsolete.m4: Remove file.
* modules/memchr-obsolete: Remove file.
* m4/memchr.m4 (gl_FUNC_MEMCHR): Assume module 'memchr-obsolete' is
absent. Don't define HAVE_MEMCHR.
* lib/string.in.h (memchr): Assume HAVE_MEMCHR is 1.
* modules/memchr (Depends-on): Remove memchr-obsolete.
(configure.ac): Assume HAVE_MEMCHR is 1.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't initialize
HAVE_MEMCHR.
* modules/string (Makefile.am): Don't substitute HAVE_MEMCHR.
* doc/posix-functions/memchr.texi: Don't mention module
'memchr-obsolete'.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Assume HAVE_MEMCHR is 1.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Assume HAVE_MEMCHR is 1.
* modules/strnlen (Depends-on): Remove memchr-obsolete.

4 years agodup2: Remove support for some very old platforms.
Bruno Haible [Wed, 8 Jul 2020 00:52:09 +0000 (02:52 +0200)]
dup2: Remove support for some very old platforms.

* m4/dup2-obsolete.m4: Remove file.
* modules/dup2-obsolete: Remove file.
* m4/dup2.m4 (gl_FUNC_DUP2): Assume module 'dup2-obsolete' is absent.
Don't define HAVE_DUP2.
* lib/unistd.in.h (dup2): Assume HAVE_DUP2 is 1.
* lib/dup2.c: Likewise.
* modules/dup2 (Depends-on, configure.ac): Likewise.
(Depends-on): Remove dup2-obsolete.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize HAVE_DUP2.
* modules/unistd (Makefile.am): Don't substitute HAVE_DUP2.
* doc/posix-functions/dup2.texi: Don't mention module 'dup2-obsolete'.

4 years agocanonicalize: Trim module dependencies.
Bruno Haible [Wed, 8 Jul 2020 00:07:38 +0000 (02:07 +0200)]
canonicalize: Trim module dependencies.

* lib/hash-triple.h: Group declarations.
* lib/hash-triple-simple.c: New file, extracted from lib/hash-triple.c.
* lib/hash-triple.c: Don't include <stdlib.h>, <string.h>, hash-pjw.h.
(STREQ): Remove macro.
(triple_hash, triple_compare_ino_str, triple_free): Remove functions.
* modules/hash-triple-simple: New file, based on modules/hash-triple.
* modules/hash-triple (Files): Remove lib/hash-triple.h.
(Depends-on): Add hash-triple-simple. Remove hash-pjw.
* modules/canonicalize (Depends-on): Remove hash-triple. Add
hash-triple-simple.
* modules/file-set (Depends-on): Likewise.

4 years agoClarify dependencies to double-slash-root.
Bruno Haible [Tue, 7 Jul 2020 23:37:19 +0000 (01:37 +0200)]
Clarify dependencies to double-slash-root.

* modules/canonicalize (Files): Remove m4/double-slash-root.m4.
(Depends-on): Add double-slash-root.
* modules/canonicalize-lgpl (Depends-on): Add double-slash-root.
* modules/dirname-lgpl (Depends-on): Add double-slash-root.

4 years agolibgmp: new module
Paul Eggert [Tue, 7 Jul 2020 01:54:11 +0000 (18:54 -0700)]
libgmp: new module

The idea is to let programs simply include <gmp.h>, and
so long as they live within the mini-gmp subset they need
not worry about whether the GMP libraries are installed.
* MODULES.html.sh: Mention it.
* config/srclist.txt: Mention files copied from GMP source.
* config/srclistvars.sh (GMP): New var.
* lib/mini-gmp-gnulib.c, m4/libgmp.m4, modules/libgmp:
* modules/libgmp-tests, tests/test-libgmp.c: New files.
* lib/mini-gmp.c, lib/mini-gmp.h: New files, copied from GMP.

4 years agoUntabify.
Bruno Haible [Sun, 5 Jul 2020 19:39:35 +0000 (21:39 +0200)]
Untabify.

4 years agomkancesdirs: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:14:05 +0000 (21:14 +0200)]
mkancesdirs: Trim module dependencies.

* lib/mkancesdirs.c: Include filename.h instead of dirname.h.
* modules/mkancesdirs (Depends-on): Remove dirname-lgpl. Add filename.

4 years agogetprogname: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:12:33 +0000 (21:12 +0200)]
getprogname: Trim module dependencies.

* lib/getprogname.c: Include basename-lgpl.h instead of dirname.h.
* modules/getprogname (Depends-on): Remove dirname-lgpl. Add
basename-lgpl.

4 years agofilenamecat-lgpl: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:10:11 +0000 (21:10 +0200)]
filenamecat-lgpl: Trim module dependencies.

* lib/filenamecat-lgpl.c: Include basename-lgpl.h, filename.h instead of
dirname.h.
* modules/filenamecat-lgpl (Depends-on): Remove dirname-lgpl. Add
basename-lgpl, filename.