]> Savannah Git Hosting - gnulib.git/log
gnulib.git
8 months agowindows-mutex, windows-timedmutex: Follow pthread_mutex_trylock spec.
Bruno Haible [Tue, 6 Aug 2024 13:14:25 +0000 (15:14 +0200)]
windows-mutex, windows-timedmutex: Follow pthread_mutex_trylock spec.

* lib/windows-mutex.h (glwthread_mutex_t): Add 'owner' field.
* lib/windows-mutex.c: Include <stdlib.h>.
(glwthread_mutex_lock): Set the 'owner' field after entering the
critical section.
(glwthread_mutex_trylock): Detect whether the lock was previously locked
by this thread. Set the 'owner' field after entering the critical
section.
(glwthread_mutex_unlock): Clear the 'owner' field before leaving the
critical section.
* lib/windows-timedmutex.h (glwthread_timedmutex_t): Add 'owner' field.
* lib/windows-timedmutex.c: (glwthread_timedmutex_lock): Set the 'owner'
field after entering the critical section.
(glwthread_timedmutex_trylock): Detect whether the lock was previously
locked by this thread. Set the 'owner' field after entering the critical
section.
(glwthread_timedmutex_unlock): Clear the 'owner' field before leaving
the critical section.

8 months agodfa-tests: Detect test-dfa-match-aux error.
Bernhard Voelker [Sun, 4 Aug 2024 16:14:32 +0000 (18:14 +0200)]
dfa-tests: Detect test-dfa-match-aux error.

* tests/test-dfa-invalid-merge.sh: Set fail=1 if test-dfa-match-aux fails.
Remove redundant 'returns_ 0'.

8 months agotest-framework-sh: Improve returns_ example.
Bernhard Voelker [Sun, 4 Aug 2024 16:12:16 +0000 (18:12 +0200)]
test-framework-sh: Improve returns_ example.

In the shell test framework, an error is either flagged by setting
the shell variable fail=1, or by invoking the fail_ function with an
error diagnostic.

* tests/init.sh (returns_): Change example code in the comment to
use '|| fail=1' properly.

8 months agoFix misspelling of __clang_major__.
Bruno Haible [Mon, 29 Jul 2024 19:59:44 +0000 (21:59 +0200)]
Fix misspelling of __clang_major__.

* lib/cdefs.h (__THROW, __THROWNL, __NTH, __NTHNL): Fix misspelled macro
name.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.
* lib/malloc.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stddef.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stdlib.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/sys_stat.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.

8 months agochdir: Fix mistake in GNULIB_POSIXCHECK.
Bruno Haible [Mon, 29 Jul 2024 18:21:06 +0000 (20:21 +0200)]
chdir: Fix mistake in GNULIB_POSIXCHECK.

* lib/unistd.in.h: Don't attach the chdir warning to the 'chown'
function.

8 months agoatoll: Fix module dependencies.
Bruno Haible [Mon, 29 Jul 2024 18:17:06 +0000 (20:17 +0200)]
atoll: Fix module dependencies.

* modules/atoll (Depends-on): Add stdlib.

8 months agoautoupdate
Paul Eggert [Sun, 28 Jul 2024 20:07:43 +0000 (13:07 -0700)]
autoupdate

8 months agosys_time, sys_types: Remove sys directory at 'make mostlyclean'.
Collin Funk [Sat, 27 Jul 2024 01:37:09 +0000 (18:37 -0700)]
sys_time, sys_types: Remove sys directory at 'make mostlyclean'.

* modules/sys_time (Makefile.am): Add sys to MOSTLYCLEANDIRS.
* modules/sys_types (Makefile.am): Likewise.

8 months agoAvoid false select_used_without_requesting_gnulib_module_select.
Bruno Haible [Wed, 24 Jul 2024 23:29:22 +0000 (01:29 +0200)]
Avoid false select_used_without_requesting_gnulib_module_select.

* modules/select (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_select.in.h (select): Don't define to
select_used_without_requesting_gnulib_module_select if the gnulib module
'select' is in use under the same configure.ac.

8 months agoAvoid false shutdown_used_without_requesting_gnulib_module_shutdown.
Bruno Haible [Wed, 24 Jul 2024 23:27:32 +0000 (01:27 +0200)]
Avoid false shutdown_used_without_requesting_gnulib_module_shutdown.

* modules/shutdown (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (shutdown): Don't define to
shutdown_used_without_requesting_gnulib_module_shutdown if the gnulib
module 'shutdown' is in use under the same configure.ac.

8 months agoAvoid false setsockopt_used_without_requesting_gnulib_module_setsockopt.
Bruno Haible [Wed, 24 Jul 2024 23:23:52 +0000 (01:23 +0200)]
Avoid false setsockopt_used_without_requesting_gnulib_module_setsockopt.

* modules/setsockopt (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (setsockopt): Don't define to
setsockopt_used_without_requesting_gnulib_module_setsockopt if the
gnulib module 'setsockopt' is in use under the same configure.ac.

8 months agoAvoid false sendto_used_without_requesting_gnulib_module_sendto.
Bruno Haible [Wed, 24 Jul 2024 23:21:45 +0000 (01:21 +0200)]
Avoid false sendto_used_without_requesting_gnulib_module_sendto.

* modules/sendto (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (sendto): Don't define to
sendto_used_without_requesting_gnulib_module_sendto if the gnulib module
'sendto' is in use under the same configure.ac.

8 months agoAvoid false recvfrom_used_without_requesting_gnulib_module_recvfrom.
Bruno Haible [Wed, 24 Jul 2024 23:19:20 +0000 (01:19 +0200)]
Avoid false recvfrom_used_without_requesting_gnulib_module_recvfrom.

* modules/recvfrom (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (recvfrom): Don't define to
recvfrom_used_without_requesting_gnulib_module_recvfrom if the gnulib
module 'recvfrom' is in use under the same configure.ac.

8 months agoAvoid false send_used_without_requesting_gnulib_module_send.
Bruno Haible [Wed, 24 Jul 2024 23:17:33 +0000 (01:17 +0200)]
Avoid false send_used_without_requesting_gnulib_module_send.

* modules/send (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (send): Don't define to
send_used_without_requesting_gnulib_module_send if the gnulib module
'send' is in use under the same configure.ac.

8 months agoAvoid false recv_used_without_requesting_gnulib_module_recv.
Bruno Haible [Wed, 24 Jul 2024 23:16:05 +0000 (01:16 +0200)]
Avoid false recv_used_without_requesting_gnulib_module_recv.

* modules/recv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (recv): Don't define to
recv_used_without_requesting_gnulib_module_recv if the gnulib module
'recv' is in use under the same configure.ac.

8 months agoAvoid false listen_used_without_requesting_gnulib_module_listen.
Bruno Haible [Wed, 24 Jul 2024 23:14:25 +0000 (01:14 +0200)]
Avoid false listen_used_without_requesting_gnulib_module_listen.

* modules/listen (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (listen): Don't define to
listen_used_without_requesting_gnulib_module_listen if the gnulib module
'listen' is in use under the same configure.ac.

8 months agoAvoid false getsockopt_used_without_requesting_gnulib_module_getsockopt.
Bruno Haible [Wed, 24 Jul 2024 23:12:43 +0000 (01:12 +0200)]
Avoid false getsockopt_used_without_requesting_gnulib_module_getsockopt.

* modules/getsockopt (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getsockopt): Don't define to
getsockopt_used_without_requesting_gnulib_module_getsockopt if the
gnulib module 'getsockopt' is in use under the same configure.ac.

8 months agoAvoid false getsockname_used_without_requesting_gnulib_module_getsockname.
Bruno Haible [Wed, 24 Jul 2024 22:53:05 +0000 (00:53 +0200)]
Avoid false getsockname_used_without_requesting_gnulib_module_getsockname.

* modules/getsockname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getsockname): Don't define to
getsockname_used_without_requesting_gnulib_module_getsockname if the
gnulib module 'getsockname' is in use under the same configure.ac.

8 months agoAvoid false getpeername_used_without_requesting_gnulib_module_getpeername.
Bruno Haible [Wed, 24 Jul 2024 22:51:27 +0000 (00:51 +0200)]
Avoid false getpeername_used_without_requesting_gnulib_module_getpeername.

* modules/getpeername (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getpeername): Don't define to
getpeername_used_without_requesting_gnulib_module_getpeername if the
gnulib module 'getpeername' is in use under the same configure.ac.

8 months agoAvoid false bind_used_without_requesting_gnulib_module_bind.
Bruno Haible [Wed, 24 Jul 2024 22:49:21 +0000 (00:49 +0200)]
Avoid false bind_used_without_requesting_gnulib_module_bind.

* modules/bind (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (bind): Don't define to
bind_used_without_requesting_gnulib_module_bind if the gnulib module
'bind' is in use under the same configure.ac.

8 months agoAvoid false accept_used_without_requesting_gnulib_module_accept.
Bruno Haible [Wed, 24 Jul 2024 22:47:45 +0000 (00:47 +0200)]
Avoid false accept_used_without_requesting_gnulib_module_accept.

* modules/accept (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (accept): Don't define to
accept_used_without_requesting_gnulib_module_accept if the gnulib module
'accept' is in use under the same configure.ac.

8 months agoAvoid false socket_used_without_requesting_gnulib_module_connect.
Bruno Haible [Wed, 24 Jul 2024 22:41:00 +0000 (00:41 +0200)]
Avoid false socket_used_without_requesting_gnulib_module_connect.

* modules/connect (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (connect): Don't define to
socket_used_without_requesting_gnulib_module_connect if the gnulib
module 'connect' is in use under the same configure.ac. Fix typo.

8 months agoAvoid false socket_used_without_requesting_gnulib_module_socket.
Bruno Haible [Wed, 24 Jul 2024 22:38:08 +0000 (00:38 +0200)]
Avoid false socket_used_without_requesting_gnulib_module_socket.

* modules/socket (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (socket): Don't define to
socket_used_without_requesting_gnulib_module_socket if the gnulib module
'socket' is in use under the same configure.ac.

8 months agoAvoid false lstat_used_without_requesting_gnulib_module_lstat.
Bruno Haible [Wed, 24 Jul 2024 22:36:01 +0000 (00:36 +0200)]
Avoid false lstat_used_without_requesting_gnulib_module_lstat.

* modules/lstat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (lstat): Don't define to
lstat_used_without_requesting_gnulib_module_lstat if the gnulib module
'lstat' is in use under the same configure.ac.

8 months agoAvoid false fstatat_used_without_requesting_gnulib_module_fstatat.
Bruno Haible [Wed, 24 Jul 2024 22:34:09 +0000 (00:34 +0200)]
Avoid false fstatat_used_without_requesting_gnulib_module_fstatat.

* modules/fstatat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (fstatat): Don't define to
fstatat_used_without_requesting_gnulib_module_fstatat if the gnulib
module 'fstatat' is in use under the same configure.ac.

8 months agoAvoid false fstat_used_without_requesting_gnulib_module_fstat.
Bruno Haible [Wed, 24 Jul 2024 22:32:26 +0000 (00:32 +0200)]
Avoid false fstat_used_without_requesting_gnulib_module_fstat.

* modules/fstat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (fstat): Don't define to
fstat_used_without_requesting_gnulib_module_fstat if the gnulib module
'fstat' is in use under the same configure.ac.

8 months agoAvoid false stat_used_without_requesting_gnulib_module_stat.
Bruno Haible [Wed, 24 Jul 2024 22:30:26 +0000 (00:30 +0200)]
Avoid false stat_used_without_requesting_gnulib_module_stat.

* modules/stat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (stat): Don't define to
stat_used_without_requesting_gnulib_module_stat if the gnulib module
'stat' is in use under the same configure.ac.

8 months agoAvoid false ioctl_used_without_requesting_gnulib_module_ioctl.
Bruno Haible [Wed, 24 Jul 2024 21:59:15 +0000 (23:59 +0200)]
Avoid false ioctl_used_without_requesting_gnulib_module_ioctl.

* modules/ioctl (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_ioctl.in.h (ioctl): Don't define to
ioctl_used_without_requesting_gnulib_module_ioctl if the gnulib module
'ioctl' is in use under the same configure.ac.

8 months agoAvoid false localeconv_used_without_requesting_gnulib_module_localeconv.
Bruno Haible [Wed, 24 Jul 2024 21:56:33 +0000 (23:56 +0200)]
Avoid false localeconv_used_without_requesting_gnulib_module_localeconv.

* modules/localeconv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/locale.in.h (localeconv): Don't define to
localeconv_used_without_requesting_gnulib_module_localeconv if the
gnulib module 'localeconv' is in use under the same configure.ac.

8 months agoAvoid false gethostname_used_without_requesting_gnulib_module_gethostname.
Bruno Haible [Wed, 24 Jul 2024 21:53:53 +0000 (23:53 +0200)]
Avoid false gethostname_used_without_requesting_gnulib_module_gethostname.

* modules/gethostname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (gethostname): Don't define to
gethostname_used_without_requesting_gnulib_module_gethostname if the
gnulib module 'gethostname' is in use under the same configure.ac.

8 months agoAvoid false error close_used_without_requesting_gnulib_module_close.
Bruno Haible [Wed, 24 Jul 2024 21:35:53 +0000 (23:35 +0200)]
Avoid false error close_used_without_requesting_gnulib_module_close.

Reported by Frédéric at <https://savannah.gnu.org/bugs/?65958>.

* modules/close (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (close): Don't define to
close_used_without_requesting_gnulib_module_close if the gnulib module
'close' is in use under the same configure.ac.

8 months agogetopt-posix, getopt-gnu tests: Avoid test failure on mingw.
Bruno Haible [Wed, 24 Jul 2024 00:02:45 +0000 (02:02 +0200)]
getopt-posix, getopt-gnu tests: Avoid test failure on mingw.

* tests/test-getopt.h (test_getopt): Don't special-case mingw.

8 months agostrtod, strtold: Fix underflow behaviour of system function.
Bruno Haible [Tue, 23 Jul 2024 10:40:19 +0000 (12:40 +0200)]
strtod, strtold: Fix underflow behaviour of system function.

* m4/strtod.m4 (gl_FUNC_STRTOD): Test for strtod's behaviour upon
underflow. Conditionally define STRTOD_HAS_UNDERFLOW_BUG,
STRTOD_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* m4/strtold.m4 (gl_FUNC_STRTOLD): Test for strtold's behaviour upon
gradual underflow. Conditionally define
STRTOLD_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* lib/strtod.c (HAVE_UNDERLYING_STRTOD): Test STRTOD_HAS_UNDERFLOW_BUG.
(HAS_GRADUAL_UNDERFLOW_PROBLEM): New macro.
(SET_ERRNO_UPON_GRADUAL_UNDERFLOW): New macro.
(STRTOD): Use it.

8 months agostrtod, strtold: Set errno upon gradual underflow.
Bruno Haible [Tue, 23 Jul 2024 08:39:28 +0000 (10:39 +0200)]
strtod, strtold: Set errno upon gradual underflow.

* lib/strtod.c (scale_radix_exp): If the result is a denormalized
number, set errno to ERANGE.

8 months agobootstrap: Avoid failure when gnulib-tool removed gettext.m4.
Bruno Haible [Sun, 21 Jul 2024 12:02:58 +0000 (14:02 +0200)]
bootstrap: Avoid failure when gnulib-tool removed gettext.m4.

* top/bootstrap-funclib.sh (autogen): When gnulib-tool has removed
gettext.m4 but the package needs gettext.m4, repeat the autopoint and
gnulib-tool invocations.
* build-aux/bootstrap: Regenerated.

9 months agostrnlen: port to Android 5.0 (API 21)
Paul Eggert [Mon, 15 Jul 2024 21:14:55 +0000 (14:14 -0700)]
strnlen: port to Android 5.0 (API 21)

This is needed for GNU Emacs, which attempts to port to these
old Android versions.
* m4/strnlen.m4 (AC_FUNC_STRNLEN): Replace if Autoconf 2.72 or
earlier, with code that detects the Android problem with strnlen.
This version works around some further bugs in the test, notably,
misplaced 'volatile' and need for volatile in the AIX 4.3 bug
check too.

9 months agomanywarnings: Don't enable -Wsystem-headers.
Bruno Haible [Mon, 15 Jul 2024 21:02:58 +0000 (23:02 +0200)]
manywarnings: Don't enable -Wsystem-headers.

* build-aux/gcc-warning.spec: Add -Wsystem-headers.
* build-aux/g++-warning.spec: Likewise.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Don't enable
-Wsystem-headers.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL): Likewise.

9 months agoqcopy-acl: Fix copying of ACLs on CentOS 7 (regression 2023-01-12).
Bruno Haible [Mon, 15 Jul 2024 12:48:41 +0000 (14:48 +0200)]
qcopy-acl: Fix copying of ACLs on CentOS 7 (regression 2023-01-12).

* lib/qcopy-acl.c: Include <string.h>, <linux/xattr.h>.
(XATTR_NAME_NFSV4_ACL, XATTR_NAME_POSIX_ACL_ACCESS,
XATTR_NAME_POSIX_ACL_DEFAULT): New macros, from file-has-acl.c.
(is_attr_permissions): Test for these names explicitly.
* m4/acl.m4 (gl_QCOPY_ACL): New macro.
* modules/qcopy-acl (Files): Add m4/acl.m4.
(configure.ac): Invoke gl_QCOPY_ACL.

9 months agostdlib: Avoid syntax errors in libstdc++ header files.
Bruno Haible [Sun, 14 Jul 2024 18:45:46 +0000 (20:45 +0200)]
stdlib: Avoid syntax errors in libstdc++ header files.

* lib/stdlib.in.h: Include <string> before strtol, strtoll, strtoul, or
strtoull gets defined as a macro.

9 months agoActivate strtold workarounds.
Bruno Haible [Sun, 14 Jul 2024 16:39:29 +0000 (18:39 +0200)]
Activate strtold workarounds.

* modules/c-strtold-tests (Depends-on): Add strtold.
* modules/ldtoastr (Depends-on): Add strtold.

9 months agostrtold: Work around major mingw bugs.
Bruno Haible [Sun, 14 Jul 2024 16:38:16 +0000 (18:38 +0200)]
strtold: Work around major mingw bugs.

* lib/strtod.c (HAVE_UNDERLYING_STRTOD) [USE_LONG_DOUBLE]: Set to 0 on
mingw versions before 10.0.
* doc/posix-functions/strtold.texi: Mention the mingw bugs.

9 months agostdlib: Support use of clang++ on Ubuntu.
Bruno Haible [Sat, 13 Jul 2024 22:53:57 +0000 (00:53 +0200)]
stdlib: Support use of clang++ on Ubuntu.

* lib/stdlib.in.h: Ignore __need_system_stdlib_h when GCC's
c++/11/stdlib.h is being included or has been included.

9 months agopthread-cond: Fix compilation error on native Windows.
Bruno Haible [Sun, 7 Jul 2024 00:53:37 +0000 (02:53 +0200)]
pthread-cond: Fix compilation error on native Windows.

* lib/pthread-cond.c: Include windows-cond.h, not windows-thread.h.

9 months agoAvoid some possibly wrong configure test results.
Bruno Haible [Mon, 1 Jul 2024 15:33:17 +0000 (17:33 +0200)]
Avoid some possibly wrong configure test results.

Reported by Arsen Arsenović <arsen@gentoo.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00000.html>.

* m4/memmem.m4 (gl_FUNC_MEMMEM): Update comment.
* m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise.
* m4/strstr.m4 (gl_FUNC_STRSTR): Likewise.
* m4/wcsstr.m4 (gl_FUNC_WCSSTR): Likewise.

10 months agostrnlen: avoid undefined memcmp behavior
Paul Eggert [Sun, 30 Jun 2024 10:27:48 +0000 (11:27 +0100)]
strnlen: avoid undefined memcmp behavior

Problem reported by Po Lu in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00288.html
* config/srclist.txt: Don’t mention strnlen.c even in a comment,
as the Gnulib and glibc implementations have diverged for
portability reasons, and they’re never likely to merge.
* lib/strnlen.c (strnlen): Avoid undefined behavior if
the array S points to has fewer than MAXLEN bytes.

10 months agotime: Fix test failure on FreeBSD.
Bruno Haible [Fri, 28 Jun 2024 09:10:59 +0000 (11:10 +0200)]
time: Fix test failure on FreeBSD.

* m4/time.m4 (gl_FUNC_TIME): Guess no for FreeBSD in general.
* doc/posix-functions/time.texi: Mention FreeBSD in general.

10 months agoc-vasnprintf: Fix link errors.
Bruno Haible [Tue, 25 Jun 2024 17:35:20 +0000 (19:35 +0200)]
c-vasnprintf: Fix link errors.

* modules/c-vasnprintf (configure.ac): Ensure printf-args.c and
printf-parse.c get compiled. Invoke gl_PREREQ_PRINTF_ARGS,
gl_PREREQ_PRINTF_PARSE.

10 months agotest-framework-sh: Fix typo in function invocation (regression 2024-06-11).
Collin Funk [Mon, 24 Jun 2024 01:28:26 +0000 (18:28 -0700)]
test-framework-sh: Fix typo in function invocation (regression 2024-06-11).

* tests/init.sh (mktempd_): Invoke fail_ properly.

10 months agotest-framework-sh: Fix side effect on dfa tests (regression 2024-06-11).
Bruno Haible [Thu, 20 Jun 2024 14:36:28 +0000 (16:36 +0200)]
test-framework-sh: Fix side effect on dfa tests (regression 2024-06-11).

* tests/init.sh (returns_): Silence the 'local is_tracing' assignment.

10 months agocopysignl tests: Avoid failure on Solaris 11.4.
Bruno Haible [Wed, 19 Jun 2024 00:58:34 +0000 (02:58 +0200)]
copysignl tests: Avoid failure on Solaris 11.4.

* tests/test-copysignl.c: Include <float.h>.
(LDBL_BYTES): New macro.
(main): Use it instead of sizeof (long double).
* modules/copysignl-tests (Depends-on): Add float.

10 months agombsnlen: Fix bug (regression 2023-09-26).
Bruno Haible [Wed, 19 Jun 2024 00:31:30 +0000 (02:31 +0200)]
mbsnlen: Fix bug (regression 2023-09-26).

* lib/mbsnlen.c (mbsnlen): Fix bug in GNULIB_MCEL_PREFER implementation.

10 months agotest-framework-sh: Fix 'returns_' to not turn off tracing permanently.
Bruno Haible [Tue, 11 Jun 2024 18:42:12 +0000 (20:42 +0200)]
test-framework-sh: Fix 'returns_' to not turn off tracing permanently.

* tests/init.sh (returns_): Restore tracing if it was enabled before.

10 months agoc32width tests: Avoid a test failure on Solaris 11 OpenIndiana, OmniOS.
Bruno Haible [Sun, 9 Jun 2024 23:51:30 +0000 (01:51 +0200)]
c32width tests: Avoid a test failure on Solaris 11 OpenIndiana, OmniOS.

* tests/test-c32width.c (main): On Solaris, disable two tests that fail
on Solaris 11 OpenIndiana and Solaris 11 OmniOS.

10 months agoc32ispunct tests: Avoid a test failure on Solaris 11 OmniOS.
Bruno Haible [Sun, 9 Jun 2024 17:32:34 +0000 (19:32 +0200)]
c32ispunct tests: Avoid a test failure on Solaris 11 OmniOS.

* tests/test-c32ispunct.c (main): On Solaris, disable two tests that
fail in the zh_CN.GB18030 locale on Solaris 11 OmniOS.

10 months agoc32rtomb: Add a sanity check, working around Solaris 11 OmniOS.
Bruno Haible [Sun, 9 Jun 2024 17:16:01 +0000 (19:16 +0200)]
c32rtomb: Add a sanity check, working around Solaris 11 OmniOS.

* m4/c32rtomb.m4 (gl_CHECK_FUNC_C32RTOMB): New macro, extracted from
gl_FUNC_C32RTOMB.
(gl_C32RTOMB_SANITYCHECK): New macro.
(gl_FUNC_C32RTOMB): Require gl_CHECK_FUNC_C32RTOMB and
gl_C32RTOMB_SANITYCHECK. If HAVE_WORKING_C32RTOMB is 0, set
REPLACE_C32RTOMB.
* lib/c32rtomb.c (c32rtomb): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.

* m4/mbrtoc32.m4 (gl_PREREQ_MBRTOC32): Require gl_C32RTOMB_SANITYCHECK.
* lib/mbrtoc32.c (mbrtoc32): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/mbrtoc32 (Files): Add m4/c32rtomb.m4.

* lib/btoc32.c (btoc32): Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/mbsrtoc32s.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/mbsnrtoc32s.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/c32tob.c (c32tob): Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.
* modules/c32tob (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

* lib/c32srtombs.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/c32snrtombs.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/c32is-impl.h (FUNC): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/c32isalnum (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isalpha (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isblank (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32iscntrl (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isdigit (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isgraph (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32islower (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isprint (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32ispunct (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isspace (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isupper (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isxdigit (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

* lib/c32to-impl.h (FUNC): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/c32tolower (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32toupper (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

* lib/c32width.c (c32width): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/c32width (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

10 months agoc32isblank tests: Avoid test failure on NetBSD 10.0.
Bruno Haible [Sat, 8 Jun 2024 19:03:39 +0000 (21:03 +0200)]
c32isblank tests: Avoid test failure on NetBSD 10.0.

* tests/test-c32isblank.c (main): Disable test of '\f', that fails in
the fr_FR.UTF-8 locale.

10 months agomktempd: use GNU-style -t if available
Paul Eggert [Tue, 11 Jun 2024 22:09:55 +0000 (15:09 -0700)]
mktempd: use GNU-style -t if available

This better satisfies Jim Meyering’s point in:
https://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00074.html
that it’s more useful when each temporary test directory name
includes the corresponding test’s name.
* build-aux/mktempd: Try mktemp -t only with GNU syntax, so that
NetBSD mktemp fails.  Also, reject templates beginning with "-" so
that they are not treated as options.
* tests/init.sh (mktempd_): Likewise.

10 months agomktempd: Invoke mktemp portably.
Collin Funk [Tue, 11 Jun 2024 21:16:34 +0000 (14:16 -0700)]
mktempd: Invoke mktemp portably.

* build-aux/mktempd (mktempd): Don't use -t when invoking mktemp since
some implementations expect an argument while others do not.

10 months agotest-framework-sh: Don't leave temporary directories on NetBSD.
Collin Funk [Sat, 8 Jun 2024 09:56:48 +0000 (02:56 -0700)]
test-framework-sh: Don't leave temporary directories on NetBSD.

Reported by Taylor R Campbell <riastradh@NetBSD.org> in
<https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58319>

* tests/init.sh (mktempd_): Don't use mktemp with the -t option as it
leads to uncleaned temporary directories on NetBSD.

10 months agonstrftime: Support time zone names on MSVC.
Bruno Haible [Thu, 6 Jun 2024 16:29:51 +0000 (18:29 +0200)]
nstrftime: Support time zone names on MSVC.

* lib/nstrftime.c: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
(tzname): Remove declaration.
* modules/nstrftime (Depends-on): Add tzname.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't require
AC_STRUCT_TIMEZONE.

10 months agoparse-datetime: Support time zone names on MSVC.
Bruno Haible [Thu, 6 Jun 2024 16:22:21 +0000 (18:22 +0200)]
parse-datetime: Support time zone names on MSVC.

* lib/parse-datetime.y (parse_datetime_body): Use HAVE_TZNAME_ARRAY
instead of HAVE_TZNAME. Don't declare tzname.
* modules/parse-datetime (Depends-on): Add tzname.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't invoke
AC_STRUCT_TIMEZONE.

10 months agotime_rz: Support time zone names on MSVC.
Bruno Haible [Thu, 6 Jun 2024 16:17:23 +0000 (18:17 +0200)]
time_rz: Support time zone names on MSVC.

* lib/time-internal.h: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
* lib/time_rz.c (tzalloc, save_abbr, mktime_z): Likewise.
* modules/time_rz (Depends-on): Add tzname.
* m4/time_rz.m4 (gl_TIME_RZ): Don't require AC_STRUCT_TIMEZONE.

10 months agotzname: Add tests.
Bruno Haible [Thu, 6 Jun 2024 16:05:57 +0000 (18:05 +0200)]
tzname: Add tests.

* tests/test-tzname.c: New file.
* modules/tzname-tests: New file.

10 months agotzname: New module.
Bruno Haible [Thu, 6 Jun 2024 15:47:21 +0000 (17:47 +0200)]
tzname: New module.

* lib/time.in.h (tzname): New declaration.
* m4/tzname.m4: New file.
* m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS): Initialize GNULIB_TZNAME.
* modules/time-h (Makefile.am): Substitute GNULIB_TZNAME.
* modules/tzname: New file.

10 months agosetenv: On native Windows, don't modify _environ directly.
Bruno Haible [Thu, 6 Jun 2024 00:33:41 +0000 (02:33 +0200)]
setenv: On native Windows, don't modify _environ directly.

* m4/setenv.m4 (gl_PREREQ_SETENV): Check for _putenv.
* lib/setenv.c: On native Windows, include <windows.h> and define
SetEnvironmentVariable.
(setenv) [HAVE_DECL__PUTENV]: New implementation for platforms with
_putenv.
* modules/setenv (Depends-on): Add malloc-posix.

10 months agounsetenv: On native Windows, don't modify _environ directly.
Bruno Haible [Wed, 5 Jun 2024 23:21:28 +0000 (01:21 +0200)]
unsetenv: On native Windows, don't modify _environ directly.

* m4/setenv.m4 (gl_PREREQ_UNSETENV): Check for _putenv.
* lib/unsetenv.c (unsetenv): Add native Windows handling, from
lib/putenv.c.
* modules/unsetenv (Depends-on): Add free-posix, malloc-posix.
* m4/putenv.m4 (gl_FUNC_PUTENV): Use AC_CHECK_DECLS_ONCE.
* lib/putenv.c (_unsetenv): Moved to lib/unsetenv.c.
(putenv): Invoke unsetenv instead of _unsetenv.
* modules/putenv (Depends-on): Add unsetenv.

10 months agoputenv: Don't crash upon out-of-memory.
Bruno Haible [Thu, 6 Jun 2024 00:24:44 +0000 (02:24 +0200)]
putenv: Don't crash upon out-of-memory.

* lib/putenv.c (_unsetenv): Handle malloc failure.

10 months agoputenv: Improve comments.
Bruno Haible [Wed, 5 Jun 2024 23:08:45 +0000 (01:08 +0200)]
putenv: Improve comments.

* lib/putenv.c (_unsetenv, putenv): Improve comments regarding native
Windows.

10 months agoboot-time, readutmp: Fix missing MinGW include (regr. 2024-05-24).
Collin Funk [Tue, 4 Jun 2024 18:21:04 +0000 (11:21 -0700)]
boot-time, readutmp: Fix missing MinGW include (regr. 2024-05-24).

Reported by Eli Zaretskii in:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-06/msg00044.html>.

* lib/boot-time.c [_WIN32 && !__CYGWIN__]: Remove unnecessary
<sysinfoapi.h> include. Some systems do not have this header and
<windows.h> should have the correct declarations.
* lib/readutmp.c [_WIN32 && !__CYGWIN__]: Likewise.

10 months agoreadlinkat: Work around a Cygwin 3.3.6 bug.
Bruno Haible [Tue, 4 Jun 2024 01:59:37 +0000 (03:59 +0200)]
readlinkat: Work around a Cygwin 3.3.6 bug.

* m4/readlinkat.m4 (gl_FUNC_READLINKAT): Set REPLACE_READLINKAT to 1 on
Cygwin.
* lib/readlinkat.c (rpl_readlinkat): On Cygwin, for /dev/* files, don't
return results that start with a backslash.
* doc/posix-functions/readlinkat.texi: Mention the Cygwin bug.

10 months agoreadlink: Work around a Cygwin 3.3.6 bug.
Bruno Haible [Mon, 3 Jun 2024 23:48:04 +0000 (01:48 +0200)]
readlink: Work around a Cygwin 3.3.6 bug.

* m4/readlink.m4 (gl_FUNC_READLINK): Set REPLACE_READLINK to 1 on Cygwin.
* lib/readlink.c (rpl_readlink): On Cygwin, for /dev/* files, don't
return results that start with a backslash.
* tests/test-readlink.h (test_readlink): Add a test of /dev/null.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* doc/posix-functions/readlink.texi: Mention the Cygwin bug.

10 months agonstrftime tests: Avoid some failures on native Windows.
Bruno Haible [Thu, 6 Jun 2024 22:54:16 +0000 (00:54 +0200)]
nstrftime tests: Avoid some failures on native Windows.

* tests/test-nstrftime.c (TZ): Use time zone names that are supported by
native Windows.
(LT): Disable two more tests on native Windows.

10 months agoacl-permissions: Fix test-file-has-acl-2.sh failure on Cygwin.
Bruno Haible [Mon, 3 Jun 2024 15:20:20 +0000 (17:20 +0200)]
acl-permissions: Fix test-file-has-acl-2.sh failure on Cygwin.

* lib/acl-internal.c: Include <sys/types.h>, <grp.h>, <string.h>.
(acl_access_nontrivial): On Cygwin, ignore group:SYSTEM:*,
group:Administrators:*, group:Users:*, mask::* entries.
* doc/acl-resources.txt: Add one more reference.

10 months agodprintf-posix tests: Skip the memory leak test on macOS.
Bruno Haible [Mon, 3 Jun 2024 13:34:21 +0000 (15:34 +0200)]
dprintf-posix tests: Skip the memory leak test on macOS.

* tests/test-dprintf-posix2.c: Skip the test on macOS.
(main): Return a different exit code at each point. Allow 100 KB extra
memory consumption.
* tests/test-dprintf-posix2.sh: Update.

10 months agopthread-* tests, regex tests: Prepare for use of 'alarm'.
Bruno Haible [Mon, 3 Jun 2024 10:51:08 +0000 (12:51 +0200)]
pthread-* tests, regex tests: Prepare for use of 'alarm'.

* modules/pthread-cond-tests (configure.ac): Test whether 'alarm' is
declared.
* modules/pthread-mutex-tests (configure.ac): Likewise.
* modules/pthread-once-tests (configure.ac): Likewise.
* modules/pthread-rwlock-tests (configure.ac): Likewise.
* modules/pthread-tss-tests (configure.ac): Likewise.
* modules/regex-tests (configure.ac): Likewise.

10 months agomtx tests: Fix a possible link error.
Bruno Haible [Mon, 3 Jun 2024 10:43:06 +0000 (12:43 +0200)]
mtx tests: Fix a possible link error.

* modules/mtx-tests (Files): Add m4/semaphore.m4.
(configure.ac): Require gl_SEMAPHORE.
(Makefile.am): Link test-mtx with @LIB_SEMAPHORE@.

10 months agopthread-mutex, pthread-rwlock: Fix a compilation error.
Bruno Haible [Mon, 3 Jun 2024 10:30:32 +0000 (12:30 +0200)]
pthread-mutex, pthread-rwlock: Fix a compilation error.

* modules/pthread-mutex-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
* modules/pthread-rwlock-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.

10 months agoc-strtod, c-strtof, c-strtold: Fix link error on AIX.
Bruno Haible [Sun, 2 Jun 2024 20:35:23 +0000 (22:35 +0200)]
c-strtod, c-strtof, c-strtold: Fix link error on AIX.

* lib/c-strtod.c (newlocale): Undefine before use.

10 months agototalorder*: Avoid compilation error by IBM XL C compiler.
Bruno Haible [Sun, 2 Jun 2024 17:31:46 +0000 (19:31 +0200)]
totalorder*: Avoid compilation error by IBM XL C compiler.

* tests/test-totalorder.h (main) [__IBMC__]: Skip the test.

10 months agoisnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
Bruno Haible [Sun, 2 Jun 2024 16:34:36 +0000 (18:34 +0200)]
isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.

* lib/isnanf-nolibm.h (HAVE_ISNANF_NOLIBM): New macro.
* lib/isnand-nolibm.h (HAVE_ISNAND_NOLIBM): New macro.
* lib/isnanl-nolibm.h (HAVE_ISNANL_NOLIBM): New macro.
* lib/math.h (isnanf): Don't define via isnan if HAVE_ISNANF_NOLIBM is
defined.
(isnand): Don't define via isnan if HAVE_ISNAND_NOLIBM is defined.
(isnanl): Don't define via isnan if HAVE_ISNANL_NOLIBM is defined.

10 months agowindows-once: Improve comments.
Bruno Haible [Sat, 1 Jun 2024 00:31:25 +0000 (02:31 +0200)]
windows-once: Improve comments.

* lib/windows-once.c (glwthread_once): Mention the 'started' field in
the comments.

11 months agoassert-h, verify: Fix compilation error with g++ (4.8.5) -std=gnu++11.
Bruno Haible [Thu, 30 May 2024 18:06:58 +0000 (20:06 +0200)]
assert-h, verify: Fix compilation error with g++ (4.8.5) -std=gnu++11.

Reported by Harmen <harmen@stoppels.ch> at
<https://savannah.gnu.org/bugs/index.php?65811>.

* lib/verify.h (static_assert): In C++ mode with g++ < 6 and
-std=gnu++11, define in a way that supports also the 1-argument
invocations and the invocations inside C++ struct and class.

11 months agowindows-once: Free allocated resources when done.
Bruno Haible [Thu, 30 May 2024 08:23:22 +0000 (10:23 +0200)]
windows-once: Free allocated resources when done.

Based on an observation regarding Cygwin's pthread_once implementation
by Takashi Yano <takashi.yano@nifty.ne.jp> at
<https://cygwin.com/pipermail/cygwin/2024-January/255182.html> and
<https://cygwin.com/pipermail/cygwin-patches/2024q1/012600.html>

* lib/windows-once.h (glwthread_once_t): Change type of inited to LONG.
Add field 'num_threads'.
(GLWTHREAD_ONCE_INIT): Initialize it to zero.
* lib/windows-once.c (glwthread_once): Use InterlockedCompareExchange
instead of InterlockedIncrement. Increment num_threads while the thread
uses the lock. Let the last thread that uses the lock destroy it.

11 months agocall_once: Work around Cygwin 3.5.3 bug.
Bruno Haible [Thu, 30 May 2024 08:55:40 +0000 (10:55 +0200)]
call_once: Work around Cygwin 3.5.3 bug.

* m4/call_once.m4 (gl_FUNC_CALL_ONCE): Require AC_CANONICAL_HOST.
On Cygwin, set REPLACE_CALL_ONCE to 1.
* lib/call_once.c (call_once): On Cygwin, use a cast, to avoid a
compiler warning.
* modules/call_once (Depends-on): Add pthread-once.
* doc/posix-functions/call_once.texi: Mention the Cygwin bug.

11 months agolock: Work around Cygwin 3.5.3 bug.
Bruno Haible [Wed, 29 May 2024 10:06:46 +0000 (12:06 +0200)]
lock: Work around Cygwin 3.5.3 bug.

* modules/lock (Depends-on): Add pthread-once.

11 months agopthread-once: Work around Cygwin 3.5.3 bug.
Bruno Haible [Tue, 28 May 2024 20:35:54 +0000 (22:35 +0200)]
pthread-once: Work around Cygwin 3.5.3 bug.

* m4/pthread-once.m4 (gl_PTHREAD_ONCE): On Cygwin, set
REPLACE_PTHREAD_ONCE to 1.
* lib/pthread-once.c (pthread_once): Add an implementation for Cygwin.
* doc/posix-functions/pthread_once.texi: Mention the Cygwin bug.

11 months agocall_once tests: Fix link error on mingw.
Bruno Haible [Wed, 29 May 2024 14:59:59 +0000 (16:59 +0200)]
call_once tests: Fix link error on mingw.

* modules/call_once-tests (Depends-on): Add mtx.

11 months agombfile tests: Avoid test failure on mingw.
Bruno Haible [Wed, 29 May 2024 12:13:33 +0000 (14:13 +0200)]
mbfile tests: Avoid test failure on mingw.

* tests/test-mbfile.c: Include <string.h>, localcharset.h.
(main): Verify that setlocale() has installed an UTF-8 locale.
* modules/mbfile-tests (Depends-on): Add localcharset.

11 months agopthread-once tests: Fix crash on mingw.
Bruno Haible [Wed, 29 May 2024 11:41:20 +0000 (13:41 +0200)]
pthread-once tests: Fix crash on mingw.

* modules/pthread-once-tests (Depends-on): Add pthread-rwlock.

11 months agonstrftime: Make %r work on macOS, FreeBSD, native Windows.
Bruno Haible [Mon, 27 May 2024 21:29:36 +0000 (23:29 +0200)]
nstrftime: Make %r work on macOS, FreeBSD, native Windows.

* doc/posix-functions/strftime.texi: Mention the %r problem.
* lib/nstrftime.c (__strftime_internal): On macOS, FreeBSD, and native
Windows, for %r, use the English AM/PM format.

11 months agonstrftime: Make %h work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:17:01 +0000 (23:17 +0200)]
nstrftime: Make %h work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %h problem.
* lib/nstrftime.c (__strftime_internal): On native Windows, for %h, do a
%b directive.

11 months agonstrftime: Make %c work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:01:50 +0000 (23:01 +0200)]
nstrftime: Make %c work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %c problem.
* lib/nstrftime.c: Include <locale.h>. Include hard-locale.h.
(__strftime_internal): For %c, use a subformat that contains the weekday
name (or abbrev.) and the month name (or abbrev.).
* modules/nstrftime (Depends-on): Add hard-locale.
(Link): New section.
* modules/nstrftime-tests (Makefile.am): Link test-nstrftime with
$(HARD_LOCALE_LIB).

11 months agotests: Fix internationalization problems on native Windows.
Bruno Haible [Mon, 27 May 2024 20:33:33 +0000 (22:33 +0200)]
tests: Fix internationalization problems on native Windows.

* doc/posix-functions/setlocale.texi: Clarify the deficiency of
setlocale() on native Windows.
* modules/dfa-tests (Depends-on): Add setlocale.
* modules/hard-locale-tests (Depends-on): Likewise.
* modules/localcharset-tests (Depends-on): Likewise.
* modules/nstrftime-tests (Depends-on): Likewise.

11 months agoparse-datetime tests: Avoid failure on native Windows.
Bruno Haible [Mon, 27 May 2024 15:42:20 +0000 (17:42 +0200)]
parse-datetime tests: Avoid failure on native Windows.

* tests/test-parse-datetime.c (SOME_TIMEPOINT): New macro.
(main): Use it. On native Windows, use Windows time zone names.
Invoke tzset() after setting TZ.
* doc/posix-functions/gmtime.texi: Mention the native Windows problem.
* doc/posix-functions/localtime.texi: Likewise.

11 months agotests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.
Bruno Haible [Mon, 27 May 2024 11:13:38 +0000 (13:13 +0200)]
tests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.

* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Add a sanity check with mbrtowc.

11 months agoeuidaccess: Fix test failure on native Windows.
Bruno Haible [Sat, 25 May 2024 13:48:32 +0000 (15:48 +0200)]
euidaccess: Fix test failure on native Windows.

* lib/euidaccess.c: Don't include <io.h>.
(euidaccess): On native Windows, invoke access, not _access.

11 months agomcel tests: Avoid test failures due to broken GB18030 converter.
Bruno Haible [Sat, 25 May 2024 10:27:44 +0000 (12:27 +0200)]
mcel tests: Avoid test failures due to broken GB18030 converter.

* tests/test-mcel.c (main): Skip most GB18030 tests on platforms where
the GB18030 converter is known to be broken.

11 months agomcel tests: Fix typo.
Bruno Haible [Sat, 25 May 2024 10:16:53 +0000 (12:16 +0200)]
mcel tests: Fix typo.

* tests/test-mcel.c (main): Increment j instead of i.

11 months agouchar-c23: Speed up mbrtoc32 on Solaris 11.4.
Bruno Haible [Sat, 25 May 2024 10:14:29 +0000 (12:14 +0200)]
uchar-c23: Speed up mbrtoc32 on Solaris 11.4.

* lib/lc-charset-unicode.c (get_converters): Cache the return value.

11 months agoboot-time, readutmp: Add a Native Windows boot time fallback.
Collin Funk [Sat, 25 May 2024 02:23:25 +0000 (19:23 -0700)]
boot-time, readutmp: Add a Native Windows boot time fallback.

* lib/boot-time-aux.h (initialize, get_windows_boot_time_fallback): New
functions.
* lib/boot-time.c [_WIN32 && !__CYGWIN__]: Include Windows headers and
<sys/time.h>.
(get_boot_time_uncached): Use the fallback.
* lib/readutmp.c [_WIN32 && !__CYGWIN__]: Include Windows headers and
<sys/time.h>.
(read_utmp_from_file): Use the fallback.
* modules/boot-time (Depends-on): Add gettimeofday.
* modules/readutmp (Depends-on): Add gettimeofday.