]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agomaintainer-makefile: Fix last sc_indent commit.
Simon Josefsson [Tue, 1 Nov 2022 08:09:02 +0000 (09:09 +0100)]
maintainer-makefile: Fix last sc_indent commit.

* top/maint.mk (sc_indent): Don't use grep -q.
Suggested by Bruno Haible.

2 years agomaintainer-makefile: Add syntax-check rule for unportable 'grep -q'.
Simon Josefsson [Tue, 1 Nov 2022 08:06:56 +0000 (09:06 +0100)]
maintainer-makefile: Add syntax-check rule for unportable 'grep -q'.

* top/maint.mk (sc_unportable_grep_q): Add.

2 years agomaintainer-makefile: Fix Apple Xcode 'make syntax-check'.
Simon Josefsson [Mon, 31 Oct 2022 08:42:42 +0000 (09:42 +0100)]
maintainer-makefile: Fix Apple Xcode 'make syntax-check'.

* top/maint.mk (sc_indent): Don't use non-GNU indent.

2 years agothread: pacify gcc -Wbad-function-cast
Paul Eggert [Sun, 30 Oct 2022 19:39:08 +0000 (12:39 -0700)]
thread: pacify gcc -Wbad-function-cast

* lib/glthread/thread.h (gl_thread_self_pointer): With POSIX
threads, cast the call to gl_thread_t before casting to void *.

2 years agotest-getlogin: pacify gcc -Wshadow
Paul Eggert [Sun, 30 Oct 2022 19:29:26 +0000 (12:29 -0700)]
test-getlogin: pacify gcc -Wshadow

* tests/test-getlogin.h (test_getlogin_result): Rename local.

2 years agogendocs: Output timestamp in English.
Simon Josefsson [Tue, 25 Oct 2022 21:39:15 +0000 (23:39 +0200)]
gendocs: Output timestamp in English.

* build-aux/gendocs.sh (SETLANG): Add LC_TIME= for "date".

2 years agoassert-h: Make static_assert work on Solaris 11.4.
Bruno Haible [Sun, 23 Oct 2022 14:43:06 +0000 (16:43 +0200)]
assert-h: Make static_assert work on Solaris 11.4.

* m4/assert_h.m4 (gl_ASSERT_H): After including <assert.h>, on Solaris,
redefine static_assert.

2 years agogetdelim: Work around buggy implementation on macOS 10.13.
Bruno Haible [Mon, 17 Oct 2022 00:44:54 +0000 (02:44 +0200)]
getdelim: Work around buggy implementation on macOS 10.13.

* doc/posix-functions/getdelim.texi: Mention the macOS bug.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Let the "checking for working
getdelim function" test answer 'no' on macOS.

2 years agoUpdate to Unicode 15.0.0.
Bruno Haible [Sat, 15 Oct 2022 22:46:24 +0000 (00:46 +0200)]
Update to Unicode 15.0.0.

* lib/gen-uni-tables.c (is_property_default_ignorable_code_point):
Exclude 0x13439..0x1343F.
(get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x0ECE, 0x10EFD..0x10EFF, 0x11241, 0x11F00..0x11F01, 0x11F36..0x11F3A,
0x11F40, 0x11F42, 0x13439..0x13440, 0x13447..0x13455, 0x1E08F,
0x1E4EC..0x1E4EF.

* All the affected modules: Bump required libunistring version.

2 years agogen-uni-tables: Temporarily revert last change.
Bruno Haible [Sat, 15 Oct 2022 17:59:51 +0000 (19:59 +0200)]
gen-uni-tables: Temporarily revert last change.

* lib/gen-uni-tables.c: Include <stdbool.h>, unless the C compiler
advertises compliance to ISO C 23.

2 years agodoc: improve intprops doc
Paul Eggert [Thu, 13 Oct 2022 00:18:20 +0000 (17:18 -0700)]
doc: improve intprops doc

* doc/intprops.texi: Tighten up wording, by saying that macros
"yield 1 if X, 0 otherwise" rather than the weaker "yield 1 if X".
Say "yield" rather than "return" since the macros are not
functions.  Say "1" and "0" rather than "true" and "false" since
the macros yield int.  Say that stdckdint.h is the standard
alternative to the _WRAPV macros.  Mention another source of
problems with the _OVERFLOW macros.

2 years agoautoupdate
Karl Berry [Wed, 12 Oct 2022 14:08:25 +0000 (07:08 -0700)]
autoupdate

2 years agotests: prefer stdckdint to intprops
Paul Eggert [Tue, 11 Oct 2022 01:45:03 +0000 (18:45 -0700)]
tests: prefer stdckdint to intprops

* modules/chown-tests, modules/fchownat-tests:
* modules/fdutimensat-tests, modules/futimens-tests:
* modules/lchown-tests, modules/stat-time-tests:
* modules/utime-tests, modules/utimens-tests:
* modules/utimensat-tests:
(Depends on): Depend on stdckint, not intprops.
* tests/nap.h: Include stdckdint.h, not intprops.h.
All macro uses changed.

2 years agostat-time: prefer stdckdint to intprops
Paul Eggert [Tue, 11 Oct 2022 01:26:05 +0000 (18:26 -0700)]
stat-time: prefer stdckdint to intprops

* lib/stat-time.h: Include stdckdint.h instead of intprops.h.
(stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
* modules/stat-time (Depends-on): Depend on stdckdint, not intprops.

2 years agoxalloc: remove stray includes + dependencies
Paul Eggert [Tue, 11 Oct 2022 01:17:02 +0000 (18:17 -0700)]
xalloc: remove stray includes + dependencies

These used to be needed, but are not needed now.
* lib/xalloc.h: Do not include stdlib.h.
[GNULIB_XALLOC]: Do not include "intprops.h".
* lib/xmalloc.c: Include stdint.h here instead, for SIZE_MAX.
* modules/xalloc-die, modules/xvasprintf (Depends-on): Remove stdint.

2 years agoautoupdate
Karl Berry [Sat, 8 Oct 2022 15:10:14 +0000 (08:10 -0700)]
autoupdate

2 years agoassert-h: suppress Apple clang 13 false alarms
Paul Eggert [Sat, 1 Oct 2022 00:35:18 +0000 (17:35 -0700)]
assert-h: suppress Apple clang 13 false alarms

* m4/assert_h.m4 (gl_ASSERT_H): Suppress bogus warnings from Apple
clang 13 (clang-1300.0.29.30).  Problem privately reported by
Mattias Engdegård for GNU Emacs.

2 years agolargefile: fix detection of time_t size on mingw32
Daiki Ueno [Mon, 26 Sep 2022 04:48:42 +0000 (13:48 +0900)]
largefile: fix detection of time_t size on mingw32

* modules/largefile (configure.ac-early): Ensure gl_YEAR2038_EARLY
is invoked before gl_YEAR2038_BODY.

2 years agofts: fix errno handling if dirfd fails
Paul Eggert [Mon, 26 Sep 2022 01:33:49 +0000 (18:33 -0700)]
fts: fix errno handling if dirfd fails

* lib/fts.c (fts_build): Use proper errno if dirfd failed.
Although I don’t know of any platform where dirfd can fail here,
we might as well get it right.

2 years agostdbool: Mostly revert last patch.
Bruno Haible [Sun, 25 Sep 2022 14:38:19 +0000 (16:38 +0200)]
stdbool: Mostly revert last patch.

* m4/c-bool.m4 (gl_C_BOOL): If stdbool.h does not exist, just err out.
* modules/stdbool (Files): Remove m4/stdbool.m4.

2 years agostdbool: Don't #include a gnulib-generated stdbool.h from config.h.
Bruno Haible [Sat, 24 Sep 2022 21:42:44 +0000 (23:42 +0200)]
stdbool: Don't #include a gnulib-generated stdbool.h from config.h.

* m4/c-bool.m4 (gl_C_BOOL): Check for stdbool.h and for _Bool. If
stdbool.h does not exist, don't #include <stdbool.h> but instead put the
substitute code into config.h.

2 years agostdalign: Don't #include a gnulib-generated stdalign.h from config.h.
Bruno Haible [Sat, 24 Sep 2022 17:56:31 +0000 (19:56 +0200)]
stdalign: Don't #include a gnulib-generated stdalign.h from config.h.

* m4/stdalign.m4 (gl_STDALIGN_H): Check for stdalign.h. If it does not
exist, don't #include <stdalign.h> but instead put the substitute code
into config.h.

2 years agostdalign: Fix compilation error with MSVC in C++ mode.
Bruno Haible [Sat, 24 Sep 2022 22:38:15 +0000 (00:38 +0200)]
stdalign: Fix compilation error with MSVC in C++ mode.

* lib/stdalign.in.h: Treat MSVC in C++ mode like C++11 compliant
compilers.
* tests/test-stdalign-c++.cc: Include some other header files.

2 years agostdalign: Avoid namespace pollution.
Bruno Haible [Sat, 24 Sep 2022 22:23:20 +0000 (00:23 +0200)]
stdalign: Avoid namespace pollution.

* lib/stdalign.in.h (_GL_STDALIGN_NEEDS_STDDEF): New macro.
Include <stddef.h> only when needed.

2 years agowarnings, manywarnings: Doc fixes.
Simon Josefsson [Fri, 23 Sep 2022 07:06:22 +0000 (09:06 +0200)]
warnings, manywarnings: Doc fixes.

* doc/manywarnings.texi (manywarnings): Improve usage instruction.
Start list of comments on particular warning flags, based on
comment from Paul Eggert <eggert@cs.ucla.edu>.
* doc/warnings.texi (warnings): Mention that it is often used with manywarnings.

2 years agoautoupdate
Karl Berry [Thu, 22 Sep 2022 14:22:59 +0000 (07:22 -0700)]
autoupdate

2 years agoassert-h: suppress clang false alarms
Paul Eggert [Wed, 21 Sep 2022 23:37:37 +0000 (16:37 -0700)]
assert-h: suppress clang false alarms

Suppress scads of annoying warnings from clang version 14.0.5
(Fedora 14.0.5-1.fc36) of the form "warning: '_Static_assert' with
no message is a C2x extension [-Wc2x-extensions]",
by refusing to use single-arg static_assert with older clang.
* m4/assert_h.m4 (gl_ASSERT_H): Turn -Wc2x-extensions from a
warning into an error when testing static_assert, so that the
annoying diagnostic causes the test to fail, which causes assert.h
to be replaced in a way that suppresses the diagnostic during
the real build.

2 years agoAdd another helper script for creating testdirs.
Bruno Haible [Tue, 20 Sep 2022 22:29:05 +0000 (00:29 +0200)]
Add another helper script for creating testdirs.

* all-modules: New file, based on posix-modules.

2 years agosnippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.
Bruno Haible [Tue, 20 Sep 2022 21:31:19 +0000 (23:31 +0200)]
snippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.

* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Use the clang command-line
option that disables implicit built-in function declarations in clang.

2 years agostdbool, stdbool-c99 tests: Fix compilation error with clang/MSVC.
Bruno Haible [Mon, 19 Sep 2022 19:20:33 +0000 (21:20 +0200)]
stdbool, stdbool-c99 tests: Fix compilation error with clang/MSVC.

* tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
define _MSC_VER.

2 years agostdbool: omit ‘#undef true’
Paul Eggert [Sun, 18 Sep 2022 18:26:36 +0000 (11:26 -0700)]
stdbool: omit ‘#undef true’

This is mostly just simplification.
* m4/c-bool.m4 (gl_C_BOOL): Test all preprocessors when
!HAVE_C_BOOL, not merely __SUNPRO_CC.  Use the slightly
more-elegant ‘!true’ instead of ‘true == 1’; this shouldn’t matter
in practice and if it does matter we want to know about it anyway.
Remove an unnecessary ‘#undef true’ that is simply commented out
by ‘configure’; again, if true is already #defined to be 0 the
system is so messed up we want to know about it anyway.

2 years agostdbool: Ensure that 'true' can be used in the preprocessor.
Bruno Haible [Sun, 18 Sep 2022 16:47:22 +0000 (18:47 +0200)]
stdbool: Ensure that 'true' can be used in the preprocessor.

* m4/c-bool.m4 (gl_C_BOOL): With Sun C++, redefine 'true' if it does not
evaluate to 1 in the preprocessor.

2 years agostdbool-c99: Ensure that 'true' can be used in the preprocessor.
Bruno Haible [Sun, 18 Sep 2022 16:45:39 +0000 (18:45 +0200)]
stdbool-c99: Ensure that 'true' can be used in the preprocessor.

* lib/stdbool.in.h (true): Redefine if it does not evaluate to 1 in the
preprocessor.

2 years agoautoupdate
Karl Berry [Sun, 18 Sep 2022 15:58:44 +0000 (08:58 -0700)]
autoupdate

2 years agouni{case,ctype,gbrk,str}/base: Fix installed .h file (regr. 2022-09-10).
Bruno Haible [Sun, 18 Sep 2022 13:33:09 +0000 (15:33 +0200)]
uni{case,ctype,gbrk,str}/base: Fix installed .h file (regr. 2022-09-10).

* lib/unicase.in.h: Do include <stdbool.h>.
* lib/unictype.in.h: Likewise.
* lib/unigbrk.in.h: Likewise.
* lib/unistr.in.h: Likewise.

2 years agosignal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.
Bruno Haible [Sun, 18 Sep 2022 12:41:20 +0000 (14:41 +0200)]
signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.

* lib/signal.in.h: On OpenBSD, include <sys/param.h>. Don't include
<pthread.h> on OpenBSD ≥ 5.1.

2 years agoexplicit_bzero-tests: robustify a bit
Paul Eggert [Sun, 18 Sep 2022 02:59:26 +0000 (19:59 -0700)]
explicit_bzero-tests: robustify a bit

This is mostly to suppress GCC warnings, though I suppose it
might also improve the test.
* tests/test-explicit_bzero.c: Do not ignore -Wmaybe-uninitialized,
as this warning should no longer be generated given the other changes.
(test_heap): ASSERT that malloc succeeds, to suppress any GCC
warning about relying on malloc succeeding.  Declare addr to be
volatile, so that GCC does not deduce that it is heapbuf in
disguise and diagnose using it after freeing it.
(do_secret_stuff): Declare more things to be volatile, to avoid
optimizations that might disturb the stack and/or mess up the test
in other ways.  Pass last_stackbuf address as a parameter rather
than having last_stackbuf be static, to avoid GCC warning about
assigning address of a local to a static; all callers changed.

2 years agowchar: Fix compilation errors in C++ mode on Solaris 11.3.
Bruno Haible [Sun, 18 Sep 2022 01:05:21 +0000 (03:05 +0200)]
wchar: Fix compilation errors in C++ mode on Solaris 11.3.

* lib/wchar.in.h (wcsnlen, wcpcpy, wcpncpy, wcscasecmp, wcsncasecmp,
wcsdup): Force declaration in C++ mode on Solaris (which does not
declare these functions in the global namespace).

2 years agoswab: Fix compilation error with Sun C++ on Solaris 11.3.
Bruno Haible [Sun, 18 Sep 2022 00:32:13 +0000 (02:32 +0200)]
swab: Fix compilation error with Sun C++ on Solaris 11.3.

* lib/unistd.in.h (swab): For the C++ declaration, under Solaris 11 but
not under Solaris 10, test also __XOPEN_OR_POSIX.

2 years agotime C++ tests: Fix link error on CentOS 5.
Bruno Haible [Sat, 17 Sep 2022 19:31:53 +0000 (21:31 +0200)]
time C++ tests: Fix link error on CentOS 5.

* modules/time-c++-tests (Makefile.am): Link test-time-c++ against
$(LIB_CLOCK_GETTIME).

2 years agoautoupdate
Karl Berry [Fri, 16 Sep 2022 15:18:31 +0000 (08:18 -0700)]
autoupdate

2 years agotime: Fix compilation errors with clang/MSVC.
Bruno Haible [Wed, 14 Sep 2022 22:50:41 +0000 (00:50 +0200)]
time: Fix compilation errors with clang/MSVC.

* m4/time_h.m4 (gl_TIME_H): Test whether asctime_r and ctime_r are
declared.
* lib/time.in.h (asctime_r, ctime_r): Skip _GL_WARN_ON_USE invocations
when these functions are not declared.

2 years agoverify: Avoid syntax error due to static_assert with clang in C++ mode.
Bruno Haible [Wed, 14 Sep 2022 20:21:47 +0000 (22:21 +0200)]
verify: Avoid syntax error due to static_assert with clang in C++ mode.

* lib/verify.h (static_assert): Don't define in clang C++ 6 or newer.
* m4/assert_h.m4 (gl_ASSERT_H): If we don't need to define static_assert
with clang in C++ mode, don't include <assert.h>.

2 years agoassert-h: work around include confusion
Paul Eggert [Wed, 14 Sep 2022 18:44:19 +0000 (13:44 -0500)]
assert-h: work around include confusion

* m4/assert_h.m4 (gl_ASSERT_H): Arrange for <config.h> to not
include <assert.h> if assert is already defined.  This works
around bugs in packages that mistakenly include <config.h> after
including <assert.h> (typically due to double-inclusion of
<config.h>).  Found in coreutils, which I plan to fix.

2 years agostdbool: depend on C99
Paul Eggert [Wed, 14 Sep 2022 18:40:37 +0000 (13:40 -0500)]
stdbool: depend on C99

Record that stdbool depends on C99 these days.
This matters only for ancient compilers that need special
flags to support C99 features.
* modules/stdbool (Depends-on): Add c99.

2 years agoverify: Avoid syntax error due to static_assert with MSVC 14 in C++.
Bruno Haible [Wed, 14 Sep 2022 16:08:10 +0000 (18:08 +0200)]
verify: Avoid syntax error due to static_assert with MSVC 14 in C++.

* lib/verify.h (static_assert): For MSVC in C++ mode, use a definition
that supports both the two-arguments and the one-argument syntax.

2 years agoposix_spawn-* tests: Fix test failure on mingw when libtool is in use.
Bruno Haible [Wed, 14 Sep 2022 13:12:18 +0000 (15:12 +0200)]
posix_spawn-* tests: Fix test failure on mingw when libtool is in use.

* tests/test-posix_spawn-inherit0.c (CHILD_PROGRAM_FILENAME): Add the
EXEEXT suffix.
* tests/test-posix_spawn-inherit1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open2.c (CHILD_PROGRAM_FILENAME): Likewise.

2 years agoverify: Avoid syntax error due to static_assert with MSVC 14.
Bruno Haible [Wed, 14 Sep 2022 11:35:14 +0000 (13:35 +0200)]
verify: Avoid syntax error due to static_assert with MSVC 14.

* lib/verify.h (_Static_assert): Pass only the first argument to
_GL_VERIFY.

2 years agoverify: treat GNU C++ 6 like recent C++
Paul Eggert [Wed, 14 Sep 2022 04:01:53 +0000 (23:01 -0500)]
verify: treat GNU C++ 6 like recent C++

* lib/verify.h (_GL_VERIFY):
* m4/assert_h.m4 (gl_ASSERT_H):
If we check __cpp_static_assert < 200410, also check __GNUG__ < 6,
for consistency with the previous change.

2 years agoverify: Avoid syntax error due to static_assert with GNU C++ 6.x.
Bruno Haible [Wed, 14 Sep 2022 01:04:10 +0000 (03:04 +0200)]
verify: Avoid syntax error due to static_assert with GNU C++ 6.x.

* lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.

2 years agoKeep ChangeLog entries order in sync with the git commit order.
Bruno Haible [Tue, 13 Sep 2022 23:17:54 +0000 (01:17 +0200)]
Keep ChangeLog entries order in sync with the git commit order.

2 years agostdalign: prefer to not include <stdalign.h>
Paul Eggert [Tue, 13 Sep 2022 22:29:36 +0000 (17:29 -0500)]
stdalign: prefer to not include <stdalign.h>

* lib/alignalloc.c, lib/argp-parse.c, lib/fts.c, lib/md4.c, lib/md5.c:
* lib/rawmemchr.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/sm3.c:
* lib/sys_socket.in.h:
In C23, <stdalign.h> is a no-op, so don’t include it.

2 years agostdalign: alignas and alignof are C23 keywords
Paul Eggert [Tue, 13 Sep 2022 22:29:36 +0000 (17:29 -0500)]
stdalign: alignas and alignof are C23 keywords

* m4/stdalign.m4 (gl_STDALIGN_H): Check also whether
alignas and alignof are keywords and so don’t need stdalign.h,
and define HAVE_C_ALIGNASOF if so.
If not, arrange for config.h to #define alignas and alignof
by including <stdalign.h>.
* modules/stdalign: No need to include <stdalign.h>.
* tests/test-stdalign.c: Do not include stdalign.h.

2 years agoassert-h: prefer to ‘verify’
Paul Eggert [Tue, 13 Sep 2022 22:29:36 +0000 (17:29 -0500)]
assert-h: prefer to ‘verify’

Where it’s easy, prefer ‘static_assert’ to ‘verify’,
as this simplifies the source by removing the need to
include verify.h.  Keep using ‘verify’ if verify.h
is used for other reasons, or if code is shared with glibc.
* lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h:
* lib/c32snrtombs.c, lib/c32srtombs.c, lib/exclude.c:
* lib/filevercmp.c, lib/fma.c, lib/i-ring.h, lib/ino-map.c:
* lib/localeinfo.c, lib/malloca.c, lib/mbrtoc32.c, lib/mbrtowc.c:
* lib/mbsinit.c, lib/mbsnrtoc32s.c, lib/mbsrtoc32s.c:
* lib/nanosleep.c, lib/parse-datetime.y, lib/pipe2.c:
* lib/rawmemchr.c, lib/relocwrapper.c, lib/sleep.c:
* lib/stat-w32.c, lib/strerror.c, lib/strtoimax.c:
* lib/utimecmp.c, lib/vasnprintf.c, tests/test-alignof.c:
* tests/test-intprops.c, tests/test-libgmp.c:
* tests/test-limits-h.c, tests/test-locale.c:
* tests/test-pthread.c, tests/test-round2.c:
* tests/test-stdalign.c, tests/test-stddef.c, tests/test-stdio.c:
* tests/test-stdlib.c, tests/test-string.c, tests/test-sys_stat.c:
* tests/test-time.c, tests/test-uchar.c, tests/test-unistd.c:
* tests/test-wchar.c:
Prefer static_assert to verify, and stop including verify.h.
* lib/stat.c: Don’t include verify.h (this include was unnecessary).
* modules/alignalloc, modules/alignof-tests, modules/argmatch:
* modules/c-vasnprintf, modules/c32isalnum, modules/c32isalpha:
* modules/c32isblank, modules/c32iscntrl, modules/c32isdigit:
* modules/c32isgraph, modules/c32islower, modules/c32isprint:
* modules/c32ispunct, modules/c32isspace, modules/c32isupper:
* modules/c32isxdigit, modules/c32snrtombs, modules/c32srtombs:
* modules/exclude, modules/filevercmp, modules/fma, modules/fmaf:
* modules/fmal, modules/fstat, modules/i-ring, modules/ino-map:
* modules/intprops-tests, modules/libgmp-tests:
* modules/limits-h-tests, modules/locale-tests, modules/malloca:
* modules/mbrtoc32, modules/mbrtowc, modules/mbsinit:
* modules/mbsnrtoc32s, modules/mbsrtoc32s, modules/nanosleep:
* modules/parse-datetime, modules/pipe2, modules/pthread-h-tests:
* modules/rawmemchr, modules/relocatable-prog-wrapper:
* modules/round-tests, modules/roundf-tests, modules/sleep:
* modules/stat, modules/stdalign-tests, modules/stdckdint-tests:
* modules/stddef-tests, modules/stdio-tests, modules/stdlib-tests:
* modules/strerror, modules/string-tests, modules/strtoimax:
* modules/strtoumax, modules/sys_stat-tests, modules/time-tests:
* modules/uchar-tests, modules/unistd-tests:
* modules/unistdio/u16-u16-vasnprintf:
* modules/unistdio/u16-vasnprintf:
* modules/unistdio/u32-u32-vasnprintf:
* modules/unistdio/u32-vasnprintf:
* modules/unistdio/u8-u8-vasnprintf:
* modules/unistdio/u8-vasnprintf, modules/unistdio/ulc-vasnprintf:
* modules/utimecmp, modules/vasnprintf, modules/wchar-tests:
Depend on assert-h, not verify.

2 years agoassert-h: static_assert is a keyword in C23
Paul Eggert [Tue, 13 Sep 2022 22:29:35 +0000 (17:29 -0500)]
assert-h: static_assert is a keyword in C23

* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
If not, arrange for config.h to #define static_assert
by including <assert.h>, and then do "#undef assert"
so that the assert macro still needs an explicit include.
This should be safe even on very old hosts, as assert.h
has been re-includable for decades.
* tests/tests-assert.c: New test.
* modules/assert-h-tests (Files, Makefile.am): Add it.

2 years agoPrefer talking about alignas than _Alignas.
Bruno Haible [Tue, 13 Sep 2022 20:18:37 +0000 (22:18 +0200)]
Prefer talking about alignas than _Alignas.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Don't mention _Alignas in a
comment.
* m4/stdalign.m4 (gl_STDALIGN_H): Likewise.

2 years agostdalign-tests: port to C23
Paul Eggert [Tue, 13 Sep 2022 17:56:56 +0000 (12:56 -0500)]
stdalign-tests: port to C23

* tests/test-stdalign.c: Do not test __alignas_is_defined,
_Alignof, or _Alignas as they are obsolescent.
Do not use __alignas_is_defined in C23 or later (or C++11 or later),
as it’s removed in C23.

2 years agosupersede: Avoid a failure when writing to /dev/null in Solaris zones.
Bruno Haible [Mon, 12 Sep 2022 08:49:25 +0000 (10:49 +0200)]
supersede: Avoid a failure when writing to /dev/null in Solaris zones.

* lib/supersede.c (open_supersede): Treat EACCES (seen on Solaris 11.3)
like EINVAL (seen on Illumos).

2 years agomaint: avoid unportable ERE \}
Paul Eggert [Sun, 11 Sep 2022 21:45:27 +0000 (16:45 -0500)]
maint: avoid unportable ERE \}

* top/maint.mk (sc_copyright_check):
Avoid unportable use of \} in ERE.

2 years agoverify: improve maint check
Paul Eggert [Sun, 11 Sep 2022 21:26:28 +0000 (16:26 -0500)]
verify: improve maint check

* top/maint.mk (sc_prohibit_verify_without_use):
Adjust re to match verify.h.

2 years agoverify: port better to C23
Paul Eggert [Sun, 11 Sep 2022 20:39:48 +0000 (15:39 -0500)]
verify: port better to C23

* lib/verify.h (_GL_VERIFY, static_assert):
If C23, use static_assert keyword; no macro.
This should simplify diagnostics and debugging.

2 years agoautoupdate
Karl Berry [Sun, 11 Sep 2022 14:56:05 +0000 (07:56 -0700)]
autoupdate

2 years agopipe-filter-gi: Fix test failure on native Windows.
Bruno Haible [Sun, 11 Sep 2022 00:53:07 +0000 (02:53 +0200)]
pipe-filter-gi: Fix test failure on native Windows.

* lib/pipe-filter-aux.h (write): Redefine on native Windows.

2 years agostdbool C++ tests: Fix compilation error with MSVC14 (regr. from today).
Bruno Haible [Sat, 10 Sep 2022 22:48:56 +0000 (00:48 +0200)]
stdbool C++ tests: Fix compilation error with MSVC14 (regr. from today).

* tests/test-stdbool-c++.cc (s): Choose field names that are not type
names.

2 years agoReorganize C++ tests for stdbool and stdbool-c99.
Bruno Haible [Sat, 10 Sep 2022 18:01:24 +0000 (20:01 +0200)]
Reorganize C++ tests for stdbool and stdbool-c99.

* tests/test-stdbool-c++.cc: Don't include <stdbool.h> if TEST_STDBOOL_H
is not defined. Add a couple of simple tests, from test-stdbool.c.
* tests/test-stdbool-c99-c++.cc: New file.
* modules/stdbool-c99-c++-tests: New file, based on
modules/stdbool-c++-tests.
* modules/stdbool-c99-tests (Depends-on): Add stdbool-c99-c++-tests.
Remove stdbool-c++-tests.
* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.

2 years agostdbool C++ tests: Fix for C++20.
Bruno Haible [Sat, 10 Sep 2022 17:18:05 +0000 (19:18 +0200)]
stdbool C++ tests: Fix for C++20.

* tests/test-stdbool-c++2.cc: Don't include <cstdbool> in C++20 or
newer.

2 years agouchar: Work around error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:56:14 +0000 (18:56 +0200)]
uchar: Work around error in C++ mode on AIX 7.2 with xlclang.

* lib/uchar.in.h (char16_t, char32_t): On AIX with xlclang++, define
these as macros.
* doc/posix-headers/uchar.texi: Document the AIX + xlclang++ bug.

2 years agoRely on new stdbool behavior
Paul Eggert [Sat, 10 Sep 2022 16:41:32 +0000 (11:41 -0500)]
Rely on new stdbool behavior

Prefer the C23 style to the C99 style,
since the stdbool module now supports C23.
* lib/acl-internal.h, lib/acl.h, lib/argmatch.c, lib/argmatch.h:
* lib/argp-help.c, lib/argv-iter.h, lib/asyncsafe-spin.c:
* lib/backup-internal.h, lib/backupfile.c, lib/base32.h:
* lib/base64.h, lib/basename-lgpl.c, lib/bitset/base.h:
* lib/c-ctype.h, lib/c-strcasestr.c, lib/canonicalize-lgpl.c:
* lib/canonicalize.c, lib/chdir-long.c, lib/chown.c:
* lib/classpath.h, lib/clean-temp-private.h:
* lib/clean-temp-simple.c, lib/clean-temp-simple.h:
* lib/clean-temp.c, lib/clean-temp.h, lib/cloexec.h:
* lib/close-stream.c, lib/closein.c, lib/closeout.c, lib/closeout.h:
* lib/csharpcomp.h, lib/csharpexec.h, lib/cycle-check.c:
* lib/cycle-check.h, lib/des.h, lib/dfa.h, lib/diffseq.h:
* lib/dirname.h, lib/exclude.c, lib/exclude.h, lib/execute.c:
* lib/execute.h, lib/execvpe.c, lib/fatal-signal.c, lib/fchdir.c:
* lib/file-set.h, lib/filevercmp.c, lib/findprog-in.c:
* lib/findprog.c, lib/findprog.h, lib/fma.c, lib/fnmatch.c:
* lib/fopen.c, lib/freadable.h, lib/freading.h, lib/freopen-safer.c:
* lib/fstrcmp.c, lib/fsusage.h, lib/fts.c, lib/fwritable.h:
* lib/fwriteerror.c, lib/fwriting.h, lib/gen-uni-tables.c:
* lib/getaddrinfo.c, lib/getcwd.c, lib/getloadavg.c:
* lib/getndelim2.c, lib/getpass.c, lib/getrandom.c:
* lib/git-merge-changelog.c, lib/gl_list.h, lib/gl_map.h:
* lib/gl_omap.h, lib/gl_oset.h, lib/gl_set.h, lib/glob.c:
* lib/glthread/cond.h, lib/hamt.h, lib/hard-locale.h:
* lib/hash-triple.h, lib/hash.h, lib/human.h, lib/i-ring.h:
* lib/isapipe.c, lib/javacomp.h, lib/javaexec.h, lib/javaversion.c:
* lib/lchown.c, lib/localeinfo.h, lib/localename.c:
* lib/long-options.h, lib/malloc/dynarray.h, lib/mbchar.h:
* lib/mbfile.h, lib/mbiter.h, lib/mbmemcasecoll.h, lib/mbscasestr.c:
* lib/mbsstr.c, lib/mbuiter.h, lib/mkdir-p.h, lib/modechange.h:
* lib/mountlist.h, lib/nanosleep.c, lib/nonblocking.h:
* lib/nstrftime.c, lib/openat.c, lib/openat.h, lib/os2-spawn.c:
* lib/parse-datetime.h, lib/pipe-filter-aux.c, lib/pipe-filter-gi.c:
* lib/pipe-filter-ii.c, lib/pipe-filter.h, lib/posixtm.h:
* lib/priv-set.c, lib/progreloc.c, lib/propername.c:
* lib/pthread-spin.c, lib/quotearg.c, lib/readtokens.c:
* lib/readtokens0.h, lib/readutmp.c, lib/regex-quote.h:
* lib/regex_internal.h, lib/relocwrapper.c, lib/rename.c:
* lib/renameatu.c, lib/rpmatch.c, lib/same.c, lib/same.h:
* lib/save-cwd.c, lib/savewd.c, lib/savewd.h, lib/spawn-pipe.h:
* lib/spawni.c, lib/stack.h, lib/stat.c, lib/stdckdint.in.h:
* lib/strcasestr.c, lib/strfmon_l.c, lib/striconveh.c:
* lib/striconveha.h, lib/string-buffer.h, lib/strptime.c:
* lib/strstr.c, lib/strtod.c, lib/supersede.h, lib/system-quote.c:
* lib/tempname.c, lib/term-style-control.c:
* lib/term-style-control.h, lib/textstyle.in.h, lib/time_rz.c:
* lib/tmpdir.c, lib/tmpdir.h, lib/tmpfile.c, lib/unicase.in.h:
* lib/unicase/caseprop.h, lib/unicase/invariant.h:
* lib/unicase/u16-casemap.c, lib/unicase/u16-ct-totitle.c:
* lib/unicase/u16-is-invariant.c, lib/unicase/u32-casemap.c:
* lib/unicase/u32-ct-totitle.c, lib/unicase/u32-is-invariant.c:
* lib/unicase/u8-casemap.c, lib/unicase/u8-ct-totitle.c:
* lib/unicase/u8-is-invariant.c, lib/unictype.in.h:
* lib/unigbrk.in.h, lib/unigbrk/u16-grapheme-breaks.c:
* lib/unigbrk/u32-grapheme-breaks.c:
* lib/unigbrk/u8-grapheme-breaks.c:
* lib/unigbrk/uc-grapheme-breaks.c, lib/uniname/uniname.c:
* lib/unistr.in.h, lib/unlinkdir.h, lib/userspec.h, lib/utime.c:
* lib/utimecmp.c, lib/utimens.c, lib/wait-process.h:
* lib/windows-cond.c, lib/windows-spawn.c, lib/windows-spawn.h:
* lib/windows-timedrwlock.c, lib/write-any-file.h, lib/xbinary-io.c:
* lib/xstrtod.h, lib/yesno.h:
* tests/nap.h, tests/qemu.h, tests/test-areadlink-with-size.c:
* tests/test-areadlink.c, tests/test-areadlinkat-with-size.c:
* tests/test-areadlinkat.c, tests/test-base32.c:
* tests/test-base64.c, tests/test-ceil2.c, tests/test-ceilf2.c:
* tests/test-chown.c, tests/test-dirname.c, tests/test-dup-safer.c:
* tests/test-dup3.c, tests/test-exclude.c:
* tests/test-execute-child.c, tests/test-execute-main.c:
* tests/test-execute-script.c, tests/test-explicit_bzero.c:
* tests/test-fchownat.c, tests/test-fcntl-safer.c:
* tests/test-fcntl.c, tests/test-fdutimensat.c:
* tests/test-filenamecat.c, tests/test-floor2.c:
* tests/test-floorf2.c, tests/test-fstatat.c, tests/test-fstrcmp.c:
* tests/test-futimens.c, tests/test-getlogin.h, tests/test-getopt.h:
* tests/test-hard-locale.c, tests/test-hash.c:
* tests/test-idpriv-drop.c, tests/test-idpriv-droptemp.c:
* tests/test-immutable.c, tests/test-intprops.c:
* tests/test-lchown.c, tests/test-link.c, tests/test-linkat.c:
* tests/test-lstat.c, tests/test-mbmemcasecmp.c:
* tests/test-mbmemcasecoll.c, tests/test-mkdir.c:
* tests/test-mkdirat.c, tests/test-mkfifo.c, tests/test-mkfifoat.c:
* tests/test-mknod.c, tests/test-nonblocking-pipe-child.c:
* tests/test-nonblocking-pipe-main.c:
* tests/test-nonblocking-socket-child.c:
* tests/test-nonblocking-socket-main.c, tests/test-open.c:
* tests/test-openat.c, tests/test-pipe.c, tests/test-pipe2.c:
* tests/test-poll.c, tests/test-posix_spawn-chdir.c:
* tests/test-posix_spawn-dup2-stdin.c:
* tests/test-posix_spawn-dup2-stdout.c:
* tests/test-posix_spawn-fchdir.c, tests/test-posix_spawn-open1.c:
* tests/test-posix_spawn-open2.c, tests/test-quotearg-simple.c:
* tests/test-quotearg.c, tests/test-readlink.c:
* tests/test-readlinkat.c, tests/test-readtokens.c:
* tests/test-rename.c, tests/test-renameat.c:
* tests/test-renameatu.c, tests/test-rmdir.c, tests/test-round2.c:
* tests/test-select.h, tests/test-spawn-pipe-child.c:
* tests/test-spawn-pipe-main.c, tests/test-spawn-pipe-script.c:
* tests/test-stack.c, tests/test-stat.c, tests/test-supersede.c:
* tests/test-symlink.c, tests/test-symlinkat.c:
* tests/test-system-quote-main.c:
* tests/test-term-style-control-hello.c:
* tests/test-term-style-control-yes.c, tests/test-timespec.c:
* tests/test-trunc2.c, tests/test-truncf2.c, tests/test-unlink.c:
* tests/test-unlinkat.c, tests/test-userspec.c, tests/test-utime.c:
* tests/test-utimens.c, tests/test-utimensat.c:
* tests/unictype/test-categ_byname.c:
* tests/unigbrk/test-uc-is-grapheme-break.c:
Don’t include stdbool.h.
* modules/acl, modules/xgetcwd:
Don’t depend on stdbool, as these modules don’t use bool.
* modules/argp, modules/bitset, modules/diffseq, modules/file-has-acl:
* modules/gen-uni-tables, modules/getrandom:
* modules/hash-triple-simple, modules/posix_spawn-internal:
* modules/strcasestr, modules/supersede, modules/system-quote:
* modules/uniconv/base, modules/uniname/uniname, modules/utime:
* modules/windows-timedrwlock:
Depend on stdbool, as these modules use bool.

2 years agostdbool: upgrade from C99 to C23
Paul Eggert [Sat, 10 Sep 2022 16:41:31 +0000 (11:41 -0500)]
stdbool: upgrade from C99 to C23

Change the stdbool module so that it now emulates C23.
The module now assumes C99.  The old module (which assumes
C89 and emulates C99) is still available  as stdbool-c99,
but is deprecated.
* tests/test-stdbool.c [TEST_STDBOOL_H]: Do not include stdbool.h.
(WORKING_BOOL): Depend on HAVE_C_BOOL, not __STDC_VERSION__.
* m4/c-bool.m4, modules/c-bool, modules/c-bool-tests:
* tests/test-c-bool.c: New files.

2 years agostring: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:20:58 +0000 (18:20 +0200)]
string: Fix compilation error in C++ mode on AIX 7.2 with xlclang.

* lib/string.in.h (mbslen): Enable the C++ alias warning only on glibc
systems.

2 years agomath: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:03:02 +0000 (18:03 +0200)]
math: Fix compilation error in C++ mode on AIX 7.2 with xlclang.

* lib/math.in.h (cbrtl, copysignl, exp2l, expm1l, fmal, ilogbl, log1pl,
log2l, logbl, remainderl, rintl, roundl, truncl): Enable the C++ alias
warning only on glibc systems.

2 years agodoc: Mention the stable branches.
Bruno Haible [Sat, 10 Sep 2022 13:17:05 +0000 (15:17 +0200)]
doc: Mention the stable branches.

* doc/gnulib-readme.texi (High Quality): Add subsection
'Stable Branches'.
(Writing reliable code): Extracted from 'High Quality'. Mention also
-Wall and valgrind.

2 years agoposix_spawn-internal: Optimize DuplicateHandle calls on native Windows.
Bruno Haible [Sat, 10 Sep 2022 00:31:20 +0000 (02:31 +0200)]
posix_spawn-internal: Optimize DuplicateHandle calls on native Windows.

* lib/windows-spawn.h (DELAYED_DUP2_OLDFD, DELAYED_DUP2_NEWFD): New
macros.
(struct IHANDLE): Add a linked_fd field.
* lib/spawni.c (SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE): New macro.
(do_delayed_dup2, do_remaining_delayed_dup2): New functions.
(close_inheritable_handles): Don't close handles in DELAYED_DUP2_NEWFD
entries.
(do_close): Add a third parameter. Optimize delayed dup2 calls.
(do_open): Use do_close.
(do_dup2): Likewise. Prepare for optimizing the DuplicateHandle call.
(__spawni): Do the remaining delayed dup2 invocations after the loop
over the actions.

2 years agoposix_spawn-internal: Refactor.
Bruno Haible [Sat, 10 Sep 2022 00:30:14 +0000 (02:30 +0200)]
posix_spawn-internal: Refactor.

* lib/windows-spawn.h (struct IHANDLE): New type.
(struct inheritable_handles): Combine handles and flags into a single
array.
* lib/windows-spawn.c (init_inheritable_handles, compose_handles_block,
spawnpvech): Update.
* lib/spawni.c (grow_inheritable_handles, shrink_inheritable_handles,
do_open, do_dup2, do_close): Update.

2 years agoposix_spawn-internal: Optimize DuplicateHandle calls on native Windows.
Bruno Haible [Sat, 10 Sep 2022 00:27:54 +0000 (02:27 +0200)]
posix_spawn-internal: Optimize DuplicateHandle calls on native Windows.

* lib/spawni.c (open_handle): Return an inheritable HANDLE.
(do_open): Don't call DuplicateHandle. Remove curr_process parameter.
(__spawni): Update.

2 years agoposix_spawn-internal: Optimize DuplicateHandle calls on native Windows.
Bruno Haible [Sat, 10 Sep 2022 00:27:05 +0000 (02:27 +0200)]
posix_spawn-internal: Optimize DuplicateHandle calls on native Windows.

* lib/windows-spawn.h (KEEP_OPEN_IN_PARENT): New macro.
* lib/windows-spawn.c (init_inheritable_handles): When a handle is
already inheritable, don't bother duplicating it; instead, just mark it
as KEEP_OPEN_IN_PARENT.
* lib/spawni.c (shrink_inheritable_handles, close_inheritable_handles,
do_open, do_dup2, do_close): Don't close handles that are marked as
KEEP_OPEN_IN_PARENT.

2 years agoposix_spawn-internal: Don't lose flags while duplicating an fd.
Bruno Haible [Sat, 10 Sep 2022 00:26:18 +0000 (02:26 +0200)]
posix_spawn-internal: Don't lose flags while duplicating an fd.

* lib/spawni.c (do_dup2): Fix the flags of the new fd.

2 years agospawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).
Bruno Haible [Fri, 9 Sep 2022 14:49:10 +0000 (16:49 +0200)]
spawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).

* lib/windows-spawn.h (struct inheritable_handles): Widen the per-fd
flags from 8 bits to 16 bits.
(KEEP_OPEN_IN_CHILD): New macro.
(init_inheritable_handles): Change description of what it does when
duplicate == true.
* lib/windows-spawn.c (init_inheritable_handles): If duplicate == true,
add all fds to the array, regardless whether they are scheduled to be
preserved in the child process.
(compose_handles_block): Update.
(spawnpvech): Update.
* lib/spawni.c (grow_inheritable_handles): Update.
(shrink_inheritable_handles): Also close the handles not marked with
KEEP_OPEN_IN_CHILD.
(do_open, do_dup2): Mark the new fd with KEEP_OPEN_IN_CHILD.

2 years agoautoupate
Karl Berry [Fri, 9 Sep 2022 14:41:01 +0000 (07:41 -0700)]
autoupate

2 years agospawn-pipe: Fix possible hangs in programs that spawn several children.
Bruno Haible [Fri, 9 Sep 2022 13:14:45 +0000 (15:14 +0200)]
spawn-pipe: Fix possible hangs in programs that spawn several children.

* lib/spawn-pipe.c (create_pipe) [Unix]: Create the ifd[] and ofd[] file
descriptors with the close-on-exec flag set.

2 years agopipe-filter-gi tests: Fix long-standing failure on native Windows.
Bruno Haible [Tue, 6 Sep 2022 13:09:41 +0000 (15:09 +0200)]
pipe-filter-gi tests: Fix long-standing failure on native Windows.

* tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.

2 years agoposix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.
Bruno Haible [Fri, 9 Sep 2022 12:26:54 +0000 (14:26 +0200)]
posix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.

* modules/posix_spawn_file_actions_addclose-tests (Files): Add
m4/musl.m4.

2 years agostdbool-tests: match stdbool
Paul Eggert [Fri, 9 Sep 2022 04:46:19 +0000 (23:46 -0500)]
stdbool-tests: match stdbool

* tests/test-stdbool.c: Omit test for
__bool_true_false_are_defined since AC_CHECK_HEADER_STDBOOL no
longer checks for this obsolescent macro.

2 years agomktime: back in sync with GNUlib
Paul Eggert [Fri, 9 Sep 2022 04:11:59 +0000 (23:11 -0500)]
mktime: back in sync with GNUlib

* config/srclist.txt: glibc has synced mktime from Gnulib.

2 years agoautoupdate
Paul Eggert [Fri, 9 Sep 2022 04:10:20 +0000 (23:10 -0500)]
autoupdate

2 years agoposix_spawn_file_actions_addclose tests: Avoid test failure on musl.
Bruno Haible [Wed, 7 Sep 2022 21:33:31 +0000 (23:33 +0200)]
posix_spawn_file_actions_addclose tests: Avoid test failure on musl.

Reported by Valery Ushakov <uwe@stderr.spb.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-09/msg00041.html>.

* modules/posix_spawn_file_actions_addclose-tests (configure.ac): Invoke
gl_MUSL_LIBC.
* tests/test-posix_spawn_file_actions_addclose.c (main): Skip one of the
tests on musl libc.

2 years agoautoupdate
Karl Berry [Tue, 6 Sep 2022 14:18:41 +0000 (07:18 -0700)]
autoupdate

2 years agognumakefile: Improve tarball reproducibility.
Simon Josefsson [Tue, 6 Sep 2022 12:32:05 +0000 (14:32 +0200)]
gnumakefile: Improve tarball reproducibility.

* top/GNUmakefile (TAR_OPTIONS): Add --sort=name.  Suggested by
Tzvetelin Katchov <katchov@gnu.org>.
* DEPENDENCIES: Mention tar 1.28 dependency.

2 years agopthread-h: Fix compilation error on mingw with --enable-threads=windows.
Bruno Haible [Mon, 5 Sep 2022 19:54:10 +0000 (21:54 +0200)]
pthread-h: Fix compilation error on mingw with --enable-threads=windows.

* lib/pthread.in.h: In C++ mode, if mingw's <pthread.h> has not been
used, import many pthread_* symbols from the GNULIB_NAMESPACE into the
global namespace.

2 years agoautoupdate
Karl Berry [Mon, 5 Sep 2022 14:55:49 +0000 (07:55 -0700)]
autoupdate

2 years agoFix various test link errors on MSVC.
Bruno Haible [Sun, 4 Sep 2022 23:53:28 +0000 (01:53 +0200)]
Fix various test link errors on MSVC.

* modules/crypto/gc-arcfour-tests (Makefile.am): Link test-gc-arcfour
with $(LIB_GETRANDOM).
* modules/crypto/gc-arctwo-tests (Makefile.am): Link test-gc-arctwo with
$(LIB_GETRANDOM).
* modules/crypto/gc-des-tests (Makefile.am): Link test-gc-des with
$(LIB_GETRANDOM).
* modules/crypto/gc-hmac-md5-tests (Makefile.am): Link test-gc-hmac-md5
with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha1-tests (Makefile.am): Link
test-gc-hmac-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha256-tests (Makefile.am): Link
test-gc-hmac-sha256 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha512-tests (Makefile.am): Link
test-gc-hmac-sha512 with $(LIB_GETRANDOM).
* modules/crypto/gc-md2-tests (Makefile.am): Link test-gc-md2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md4-tests (Makefile.am): Link test-gc-md4 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md5-tests (Makefile.am): Link test-gc-md5 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-tests (Makefile.am): Link test-gc-pbkdf2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-sha1-tests (Makefile.am): Link
test-gc-pbkdf2-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-rijndael-tests (Makefile.am): Link test-gc-rijndael
with $(LIB_GETRANDOM).
* modules/crypto/gc-sha1-tests (Makefile.am): Link test-gc-sha1 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha256-tests (Makefile.am): Link test-gc-sha256 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha512-tests (Makefile.am): Link test-gc-sha512 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sm3-tests (Makefile.am): Link test-gc-sm3 with
$(LIB_GETRANDOM).
* modules/sys_stat-c++-tests (Makefile.am): Link test-sys_stat-c++ with
$(LIB_GETRANDOM).
* modules/unistd-c++-tests (Makefile.am): Link test-unistd-c++ with
$(LIB_GETRANDOM).

2 years agocount-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.
Bruno Haible [Sun, 4 Sep 2022 23:34:36 +0000 (01:34 +0200)]
count-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.

* lib/count-leading-zeros.h: Correct syntax for #pragma intrinsic.
(COUNT_LEADING_ZEROS): Fix the return value.
(count_leading_zeros_ll): Use two _BitScanReverse invocations instead
of a _BitScanReverse64 invocation.

2 years agocount-trailing-zeros: Fix a link error on 32-bit MSVC.
Bruno Haible [Sun, 4 Sep 2022 23:29:26 +0000 (01:29 +0200)]
count-trailing-zeros: Fix a link error on 32-bit MSVC.

* lib/count-trailing-zeros.h: Correct syntax for #pragma intrinsic.
(count_trailing_zeros_ll): Use two _BitScanForward invocations instead
of a _BitScanForward64 invocation.

2 years agounictype/category-none tests: Fix a link error on MSVC.
Bruno Haible [Sun, 4 Sep 2022 22:31:33 +0000 (00:31 +0200)]
unictype/category-none tests: Fix a link error on MSVC.

* tests/unictype/test-categ_none.c (main): Disable the test on MSVC.

2 years agooset-c++: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 22:14:48 +0000 (00:14 +0200)]
oset-c++: Fix compilation error with MSVC 14.

* lib/gl_oset.hh: With MSVC, avoid 'friend'.

2 years agoglob tests: Fix link error on mingw.
Bruno Haible [Sun, 4 Sep 2022 22:02:44 +0000 (00:02 +0200)]
glob tests: Fix link error on mingw.

* modules/glob-tests (Makefile.am): Link test-glob with $(LIBINTL).

2 years agoautoupdate
Karl Berry [Sun, 4 Sep 2022 15:47:07 +0000 (08:47 -0700)]
autoupdate

2 years agotimespec_get: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 15:09:53 +0000 (17:09 +0200)]
timespec_get: Fix compilation error with MSVC 14.

* m4/gettime.m4 (gl_CHECK_FUNC_TIMESPEC_GET): New macro.
(gl_GETTIME): Use it instead of AC_CHECK_FUNCS_ONCE.
* m4/timespec_get.m4 (gl_FUNC_TIMESPEC_GET): Likewise.

2 years agostdbool: Fix compilation error in C++ mode with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 14:24:56 +0000 (16:24 +0200)]
stdbool: Fix compilation error in C++ mode with MSVC 14.

* lib/stdbool.in.h (_Bool, bool, false, true): In C++ mode with MSVC 14,
don't define these as macros.

2 years agofts: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 14:14:17 +0000 (16:14 +0200)]
fts: Fix compilation error with MSVC 14.

* lib/fts.c (S_IFBLK): Add fallback definition.