]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 months agolanginfo-h, nl_langinfo: Support abbreviated alternative month names.
Bruno Haible [Fri, 21 Feb 2025 18:26:23 +0000 (19:26 +0100)]
langinfo-h, nl_langinfo: Support abbreviated alternative month names.

* lib/langinfo.in.h (ABALTMON_1...ABALTMON_12): New macros.
* m4/langinfo_h.m4 (gl_LANGINFO_H): Define HAVE_LANGINFO_ABALTMON.
* modules/langinfo-h (Makefile.am): Substitute HAVE_LANGINFO_ABALTMON.
* tests/test-langinfo-h.c (items): Add ABALTMON_1 to ABALTMON_12.
* lib/nl_langinfo.c (rpl_nl_langinfo): Treat ABALTMON_i like ABMON_i.
* tests/test-nl_langinfo.c (main): Test ABALTMON_*.
* doc/posix-headers/langinfo.texi: Document support of ABALTMON_*.
* doc/posix-functions/nl_langinfo.texi: Likewise.

2 months agolanginfo-h tests: Verify that ALTMON_* are defined.
Bruno Haible [Fri, 21 Feb 2025 17:42:22 +0000 (18:42 +0100)]
langinfo-h tests: Verify that ALTMON_* are defined.

* tests/test-langinfo-h.c (items): Add ALTMON_1 to ALTMON_12.

2 months agohost-cpu-c-abi: Improve support for loongarch32.
Bruno Haible [Fri, 21 Feb 2025 10:38:35 +0000 (11:38 +0100)]
host-cpu-c-abi: Improve support for loongarch32.

Reported by <wuruilong@loongson.cn>
in <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098478>
via Simon Josefsson.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Prepare template for
__loongarch32__ in config.h.
(gl_HOST_CPU_C_ABI_32BIT): Speed up the configure test on loongarch*.

2 months agogetlocalename_l-simple: Add tests.
Bruno Haible [Fri, 21 Feb 2025 10:25:54 +0000 (11:25 +0100)]
getlocalename_l-simple: Add tests.

* tests/test-getlocalename_l.c: New file.
* modules/getlocalename_l-simple-tests: New file.

2 months agogetlocalename_l-simple: New module.
Bruno Haible [Fri, 21 Feb 2025 10:25:51 +0000 (11:25 +0100)]
getlocalename_l-simple: New module.

* lib/locale.in.h (newlocale, duplocale, freelocale): Now enabled by
module 'getlocalename_l-simple'.
(getlocalename_l): New declaration.
* lib/getlocalename_l.c: New file, based on lib/localename-unsafe.c,
with modifications for glibc systems, NetBSD, OpenBSD, Android.
* lib/localename-table.h (LCMIN): New macro.
* lib/struniq.h: Update a comment.
* lib/localename-unsafe.c: Don't define the
LOCALENAME_ENHANCE_LOCALE_FUNCS overrides here. Moved to
lib/getlocalename_l.c.
(gl_locale_name_thread_unsafe): Invoke getlocalename_l. Previous code
moved to lib/getlocalename_l.c.
* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Improve support
for OpenBSD: Set gt_nameless_locales to yes and
gt_localename_enhances_locale_funcs to yes also when $gt_fake_locales is
yes.
* m4/getlocalename_l.m4: New file, based on m4/localename.m4.
* m4/localename.m4 (gl_LOCALENAME_UNSAFE, gl_LOCALENAME_UNSAFE_LIMITED):
Remove code that was moved to m4/getlocalename_l.m4.
* m4/locale_h.m4 (gl_LOCALE_H): Test whether getlocalename_l is
declared.
(gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETLOCALENAME_L.
(gl_LOCALE_H_DEFAULTS): Initialize HAVE_GETLOCALENAME_L.
* modules/locale-h (Makefile.am): Substitute GNULIB_GETLOCALENAME_L,
HAVE_GETLOCALENAME_L.
* modules/getlocalename_l-simple: New file.
* modules/localename-unsafe (Files): Remove lib/localename-table.h,
lib/localename-table.c, lib/struniq.h.
(Depends-on): Add getlocalename_l-simple. Remove bool, flexmember,
free-posix, langinfo-h, thread-optim.
(Makefile.am): Don't compile localename-table.c.
* modules/localename-unsafe-limited (Depends-on): Add
getlocalename_l-simple.
* modules/newlocale (Link): New section.
* modules/duplocale (Link): Link with $(GETLOCALENAME_L_LIB).
* modules/freelocale (Link): New section.
* modules/newlocale-tests (Makefile.am): Link the test program with
$(GETLOCALENAME_L_LIB).
* modules/duplocale-tests (Makefile.am): Likewise.
* modules/freelocale-tests (Makefile.am): Likewise.
* modules/is*_l-tests (Makefile.am): Likewise.
* modules/tolower_l-tests (Makefile.am): Likewise.
* modules/toupper_l-tests (Makefile.am): Likewise.
* modules/strcasecmp_l-tests (Makefile.am): Likewise.
* modules/strncasecmp_l-tests (Makefile.am): Likewise.
* modules/strerror_l-tests (Makefile.am): Likewise.
* doc/posix-functions/getlocalename_l.texi: Mention the new module.

2 months agosetlocale-messages: New module.
Bruno Haible [Fri, 21 Feb 2025 08:31:12 +0000 (09:31 +0100)]
setlocale-messages: New module.

* lib/setlocale-messages.h: New file.
* lib/setlocale-messages.c: New file, based on lib/setlocale.c.
* modules/setlocale-messages: New file.
* lib/setlocale.c: Include setlocale-messages.h.
(lc_messages_name): Remove variable.
(setlocale_single): Just invoke setlocale_messages.
* modules/setlocale (Depends-on): Add setlocale-messages.

2 months agolocalename-unsafe: Remove dead code.
Bruno Haible [Fri, 21 Feb 2025 07:37:16 +0000 (08:37 +0100)]
localename-unsafe: Remove dead code.

* lib/localename-unsafe.c (gl_locale_name_thread_unsafe): On Solaris,
assume HAVE_NAMELESS_LOCALES is undefined.

2 months agolocalename-unsafe: Remove support for nonexistent Solaris 12.
Bruno Haible [Fri, 21 Feb 2025 07:37:10 +0000 (08:37 +0100)]
localename-unsafe: Remove support for nonexistent Solaris 12.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Remove test for
getlocalename_l.
* lib/localename-unsafe.c: Ignore HAVE_GETLOCALENAME_L.

2 months agosetlocale: Relicense under LGPLv2+.
Bruno Haible [Fri, 21 Feb 2025 07:29:45 +0000 (08:29 +0100)]
setlocale: Relicense under LGPLv2+.

* modules/setlocale (License): Change to LGPLv2+.
* lib/setlocale.c: Update license notice.

2 months ago*_l: Fix mistake.
Bruno Haible [Thu, 20 Feb 2025 15:09:49 +0000 (16:09 +0100)]
*_l: Fix mistake.

* lib/is_l-impl.h (FUNC): Fix array index on old NetBSD and OpenBSD.
* lib/to_l-impl.h (FUNC): Likewise.
* lib/strcasecmp_l.c (strcasecmp_l): Likewise.
* lib/strncasecmp_l.c (strncasecmp_l): Likewise.
* lib/strerror_l.c (strerror_l_r): Likewise.

2 months agoreadutmp: Let callers distinguish LOGINs from USERs.
Bruno Haible [Wed, 19 Feb 2025 22:46:37 +0000 (23:46 +0100)]
readutmp: Let callers distinguish LOGINs from USERs.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00123.html>.

* lib/readutmp.h (LOGIN_PROCESS, UT_TYPE_LOGIN_PROCESS): New macros.
* lib/readutmp.c (read_utmp_from_systemd): Possibly use LOGIN_PROCESS
instead of USER_PROCESS, depending on the session's class.

2 months agostrerror_l: Add tests.
Bruno Haible [Tue, 18 Feb 2025 11:22:30 +0000 (12:22 +0100)]
strerror_l: Add tests.

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

2 months agostrerror_l: New module.
Bruno Haible [Tue, 18 Feb 2025 11:20:41 +0000 (12:20 +0100)]
strerror_l: New module.

* lib/string.in.h: Include <locale.h>.
(strerror_l, strerror_l_r): New declarations.
* lib/strerror_l.c: New file.
* m4/strerror_l.m4: New file.
* m4/string_h.m4 (gl_STRING_H): Test for strerror_l.
(gl_STRING_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRERROR_L.
(gl_STRING_H_DEFAULTS): Initialize HAVE_STRERROR_L, REPLACE_STRERROR_L.
* modules/string-h (Makefile.am): Substitute GNULIB_STRERROR_L,
HAVE_STRERROR_L, REPLACE_STRERROR_L.
* modules/strerror_l: New file.
* tests/test-string-h-c++.cc: Check declaration of strerror_l.
* doc/posix-functions/strerror_l.texi: Mention the new module.

2 months agoerrno-iter: New module.
Bruno Haible [Tue, 18 Feb 2025 11:11:29 +0000 (12:11 +0100)]
errno-iter: New module.

* lib/errno-iter.h: New file.
* lib/errno-iter.c: New file, based on lib/strerrorname_np.c.
* modules/errno-iter: New file.

2 months agoat-init: Add tests.
Bruno Haible [Tue, 18 Feb 2025 11:03:37 +0000 (12:03 +0100)]
at-init: Add tests.

* tests/test-at-init.sh: New file.
* tests/test-at-init.c: New file.
* tests/test-at-init-2.c: New file.
* tests/test-at-init-3.c: New file.
* modules/at-init-tests: New file.

2 months agoat-init: New module.
Bruno Haible [Tue, 18 Feb 2025 11:01:59 +0000 (12:01 +0100)]
at-init: New module.

* lib/at-init.h: New file.
* lib/at-init.c: New file.
* modules/at-init: New file.

2 months agofts: expose fts_debug
Paul Eggert [Mon, 17 Feb 2025 22:15:37 +0000 (14:15 -0800)]
fts: expose fts_debug

* lib/fts_.h (fts_debug) [GNULIB_FTS_DEBUG]: New decl.
Coreutils was accessing this by the back door; let’s make it public.

2 months agocrc-tests: use consistent type for randomb
Paul Eggert [Mon, 17 Feb 2025 22:14:07 +0000 (14:14 -0800)]
crc-tests: use consistent type for randomb

* tests/randomb.c (randomb): Now array of char, not unsigned char,
since callers all want char.  All uses changed.

2 months agoreadutmp, boot-time: Improve documentation.
Bruno Haible [Mon, 17 Feb 2025 12:08:38 +0000 (13:08 +0100)]
readutmp, boot-time: Improve documentation.

* DEPENDENCIES: Mention requirements of 'readutmp' and 'boot-time'.

2 months agogetaddrinfo tests: Skip test cases that may fail on Debian 12.
Bruno Haible [Mon, 17 Feb 2025 11:03:37 +0000 (12:03 +0100)]
getaddrinfo tests: Skip test cases that may fail on Debian 12.

* tests/test-getaddrinfo.c (main): Skip some test cases on glibc.

2 months agostrncasecmp_l: Fix replacement implementation.
Bruno Haible [Mon, 17 Feb 2025 07:26:28 +0000 (08:26 +0100)]
strncasecmp_l: Fix replacement implementation.

* lib/strncasecmp_l.c (strncasecmp_l): Use tolower_l, not tolower.

2 months agostrcasecmp, strncasecmp: Fix compilation error on MSVC.
Bruno Haible [Mon, 17 Feb 2025 07:11:57 +0000 (08:11 +0100)]
strcasecmp, strncasecmp: Fix compilation error on MSVC.

* modules/strcasecmp (configure.ac): Invoke gl_STRINGS_MODULE_INDICATOR.
* modules/strncasecmp (configure.ac): Likewise.

2 months agogetaddrinfo tests: Make failures more verbose.
Bruno Haible [Mon, 17 Feb 2025 06:34:23 +0000 (07:34 +0100)]
getaddrinfo tests: Make failures more verbose.

* tests/test-getaddrinfo.c (simple): Print some info before returning 1.

2 months agodoc: Adjust platforms that define O_CLOEXEC in unistd.h.
Collin Funk [Sun, 16 Feb 2025 21:58:35 +0000 (13:58 -0800)]
doc: Adjust platforms that define O_CLOEXEC in unistd.h.

Suggested by Bruno Haible.
* posix-headers/unistd.texi: Mention that macOS 12 and AIX 7.3 do not
define O_CLOEXEC in this header. Remove redundant MSVC.

2 months agostrncasecmp_l: Add tests.
Bruno Haible [Sun, 16 Feb 2025 21:32:37 +0000 (22:32 +0100)]
strncasecmp_l: Add tests.

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

2 months agostrncasecmp_l: New module.
Bruno Haible [Sun, 16 Feb 2025 21:32:33 +0000 (22:32 +0100)]
strncasecmp_l: New module.

* lib/strings.in.h (strncasecmp_l): New declaration.
* lib/strncasecmp_l.c: New file, based on lib/strncasecmp.c.
* m4/strncasecmp_l.m4: New file.
* m4/strings_h.m4 (gl_STRINGS_H): Test for strncasecmp_l.
(gl_STRINGS_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRNCASECMP_L.
(gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRNCASECMP_L,
REPLACE_STRNCASECMP_L.
* modules/strings-h (Makefile.am): Substitute GNULIB_STRNCASECMP_L,
HAVE_STRNCASECMP_L, REPLACE_STRNCASECMP_L.
* modules/strncasecmp_l: New file.
* tests/test-strings-h-c++.cc: Check declaration of strncasecmp_l.
* doc/posix-functions/strncasecmp_l.texi: Mention the new module and the
macOS, Solaris, Cygwin bugs.

2 months agostrcasecmp_l: Add tests.
Bruno Haible [Sun, 16 Feb 2025 21:32:19 +0000 (22:32 +0100)]
strcasecmp_l: Add tests.

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

2 months agostrcasecmp_l: New module.
Bruno Haible [Sun, 16 Feb 2025 21:32:02 +0000 (22:32 +0100)]
strcasecmp_l: New module.

* lib/strings.in.h: Include <locale.h>.
(strcasecmp_l): New declaration.
* lib/strcasecmp_l.c: New file, based on lib/strcasecmp.c.
* m4/strcasecmp_l.m4: New file.
* m4/strings_h.m4 (gl_STRINGS_H): Test for strcasecmp_l.
(gl_STRINGS_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRCASECMP_L.
(gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRCASECMP_L,
REPLACE_STRCASECMP_L.
* modules/strings-h (Makefile.am): Substitute GNULIB_STRCASECMP_L,
HAVE_STRCASECMP_L, REPLACE_STRCASECMP_L.
* modules/strcasecmp_l: New file.
* tests/test-strings-h-c++.cc: Check declaration of strcasecmp_l.
* doc/posix-functions/strcasecmp_l.texi: Mention the new module and the
macOS, Solaris, Cygwin bugs.

2 months agounistd-h tests: Check that unistd.h defines O_CLOEXEC.
Collin Funk [Sun, 16 Feb 2025 20:29:36 +0000 (12:29 -0800)]
unistd-h tests: Check that unistd.h defines O_CLOEXEC.

* tests/test-unistd-h.c: Prefer #error to emitting a syntax error. Check
that O_CLOEXEC is defined.

2 months agounistd-h: Make sure O_CLOEXEC is defined.
Collin Funk [Sun, 16 Feb 2025 20:23:57 +0000 (12:23 -0800)]
unistd-h: Make sure O_CLOEXEC is defined.

* modules/unistd-h (Depends-on): Add fcntl-h.
* lib/unistd.in.h: Include fcntl.h if inclusion of unistd.h does not
define O_CLOEXEC.
* doc/posix-headers/unistd.texi: Document the platforms that do not
define O_CLOEXEC in unistd.h.

2 months agostrcasecmp, strncasecmp: Work around Solaris, Cygwin bug, part 3.
Bruno Haible [Sun, 16 Feb 2025 18:32:54 +0000 (19:32 +0100)]
strcasecmp, strncasecmp: Work around Solaris, Cygwin bug, part 3.

* m4/strings_h.m4 (gl_STRINGS_H_DEFAULTS): Fix initializations.

2 months agostrncasecmp: Work around Solaris, Cygwin bug, part 2.
Bruno Haible [Sun, 16 Feb 2025 17:42:44 +0000 (18:42 +0100)]
strncasecmp: Work around Solaris, Cygwin bug, part 2.

* lib/strings.in.h (strcasecmp, strncasecmp): Fix mistake in previous commit.

2 months agostrncasecmp: Add tests.
Bruno Haible [Sun, 16 Feb 2025 17:24:16 +0000 (18:24 +0100)]
strncasecmp: Add tests.

* tests/test-strncasecmp-1.sh: New file.
* tests/test-strncasecmp-2.sh: New file.
* tests/test-strncasecmp.c: New file.
* modules/strncasecmp-tests: New file.

2 months agostrncasecmp: Work around Solaris, Cygwin bug.
Bruno Haible [Sun, 16 Feb 2025 17:22:31 +0000 (18:22 +0100)]
strncasecmp: Work around Solaris, Cygwin bug.

* lib/strings.in.h (strncasecmp): Consider REPLACE_STRNCASECMP. Use the
usual idioms.
* m4/strings_h.m4 (gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRNCASECMP,
REPLACE_STRNCASECMP.
* m4/strncasecmp.m4 (gl_FUNC_STRNCASECMP): Invoke gl_STRNCASECMP_WORKS.
Set REPLACE_STRNCASECMP. Assume that HAVE_STRNCASECMP is initialized.
* modules/strncasecmp (Files): Add m4/strcasecmp.m4.
(configure.ac): Consider REPLACE_STRNCASECMP.
* modules/strings-h (Makefile.am): Substitute HAVE_STRNCASECMP,
REPLACE_STRNCASECMP.
* doc/posix-functions/strncasecmp.texi: Mention the Solaris, Cygwin bug.

2 months agostrcasecmp: Add tests.
Bruno Haible [Sun, 16 Feb 2025 17:02:00 +0000 (18:02 +0100)]
strcasecmp: Add tests.

* tests/test-strcasecmp-1.sh: New file.
* tests/test-strcasecmp-2.sh: New file.
* tests/test-strcasecmp.c: New file.
* modules/strcasecmp-tests: New file.

2 months agostrcasecmp: Work around Solaris, Cygwin bug.
Bruno Haible [Sun, 16 Feb 2025 16:59:48 +0000 (17:59 +0100)]
strcasecmp: Work around Solaris, Cygwin bug.

* lib/strings.in.h (strcasecmp): Consider REPLACE_STRCASECMP. Use the
usual idioms.
* m4/strings_h.m4 (gl_STRINGS_H_DEFAULTS): Initialize
REPLACE_STRCASECMP.
* m4/strcasecmp.m4 (gl_STRCASECMP_WORKS): New macro.
(gl_FUNC_STRCASECMP): Invoke it. Set REPLACE_STRCASECMP.
* modules/strcasecmp (configure.ac): Consider REPLACE_STRCASECMP.
* modules/strings-h (Makefile.am): Substitute REPLACE_STRCASECMP.
* doc/posix-functions/strcasecmp.texi: Mention the Solaris, Cygwin bug.

2 months agostrcasecmp, strncasecmp: Fix header reference.
Bruno Haible [Sun, 16 Feb 2025 13:12:26 +0000 (14:12 +0100)]
strcasecmp, strncasecmp: Fix header reference.

* lib/strcasecmp.c: Include <strings.h>, not <string.h>.
* lib/strncasecmp.c: Likewise.

2 months agorealloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04).
Bruno Haible [Sun, 16 Feb 2025 14:46:06 +0000 (15:46 +0100)]
realloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04).

* lib/stdlib.in.h (rpl_realloc): Ensure C linkage, not C++ linkage, in
C++ mode.

2 months agoc-strcasecmp, c-strncasecmp: New modules.
Bruno Haible [Sun, 16 Feb 2025 12:02:25 +0000 (13:02 +0100)]
c-strcasecmp, c-strncasecmp: New modules.

* modules/c-strcasecmp: New file.
* modules/c-strncasecmp: New file.
* modules/c-strcase: Merely depend on c-strcasecmp, c-strncasecmp.
* lib/strings.in.h (strcasecmp, strncasecmp): Update warning message.
* tests/test-c-strcasecmp.sh: New file, based on
tests/test-c-strcase.sh.
* tests/test-c-strncasecmp.sh: New file, based on
tests/test-c-strcase.sh.
* tests/test-c-strcase.sh: Remove file.
* modules/c-strcasecmp-tests: New file.
* modules/c-strncasecmp-tests: New file.
* modules/c-strcase-tests: Remove file.
* doc/c-strcasecmp.texi: New file, based on doc/c-strcase.texi.
* doc/c-strncasecmp.texi: New file, based on doc/c-strcase.texi.
* doc/c-strcase.texi: Remove file.
* doc/c-locale.texi: Include c-strcasecmp.texi and c-strncasecmp.texi
separately.
* modules/c-strcaseeq (Depends-on): Add c-strcasecmp. Remove c-strcase.
* modules/iconv_open (Depends-on): Likewise.
* modules/nl_langinfo-tests (Depends-on): Likewise.
* modules/propername (Depends-on): Likewise.
* modules/propername-lite (Depends-on): Likewise.
* modules/striconv (Depends-on): Likewise.
* modules/striconveh (Depends-on): Likewise.
* modules/striconveha (Depends-on): Likewise.
* modules/c-strcasestr (Depends-on): Add c-strncasecmp. Remove
c-strcase.

2 months agostrings-h: Don't declare strcasecmp, strncasecmp without the module.
Bruno Haible [Sun, 16 Feb 2025 11:30:58 +0000 (12:30 +0100)]
strings-h: Don't declare strcasecmp, strncasecmp without the module.

* lib/strings.in.h (strcasecmp): Don't declare if module 'strcasecmp' is
not present.
(strncasecmp): Don't declare if module 'strncasecmp' is not present.
* m4/strings_h.m4 (gl_STRINGS_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STRCASECMP, GNULIB_STRNCASECMP.
* modules/strings-h (Makefile.am): Substitute GNULIB_STRCASECMP,
GNULIB_STRNCASECMP.

2 months agostrcasecmp, strncasecmp: New modules.
Bruno Haible [Sun, 16 Feb 2025 11:21:53 +0000 (12:21 +0100)]
strcasecmp, strncasecmp: New modules.

* modules/strcasecmp: New file.
* modules/strncasecmp: New file.
* modules/strcase: Merely depend on strcasecmp, strncasecmp.
* m4/strcasecmp.m4: New file, based on m4/strcase.m4.
* m4/strncasecmp.m4: New file, based on m4/strcase.m4.
* m4/strcase.m4: Remove file.
* lib/strings.in.h (strcasecmp, strncasecmp): Fix typo in warning
message.
* lib/strcasecmp.c: Improve comment.
* lib/strncasecmp.c: Likewise.
* doc/posix-functions/strcasecmp.texi: Mention module strcasecmp, not
module strcase.
* doc/posix-functions/strncasecmp.texi: Mention module strncasecmp, not
module strcase.
* doc/strings.texi (Comparison of string APIs): Reference modules
strcasecmp, strncasecmp.
* modules/argp (Depends-on): Add strcasecmp. Remove strcase.
* modules/strcasestr-simple (Depends-on): Add strncasecmp. Remove
strcase.
* modules/strptime (Depends-on): Likewise.

2 months agoctype-h: Make ctype.h self-contained again (regr. 2025-02-14).
Bruno Haible [Sun, 16 Feb 2025 10:34:23 +0000 (11:34 +0100)]
ctype-h: Make ctype.h self-contained again (regr. 2025-02-14).

* lib/ctype.in.h: Add comments re _GL_ARG_NONNULL.
* modules/ctype-h (Depends-on): Add snippet/arg-nonnull.
(Makefile.am): Substitute $(ARG_NONNULL_H) into ctype.h.

2 months agobootstrap: Fix recognition of --depth option with recent git releases.
Bruno Haible [Sun, 16 Feb 2025 12:43:40 +0000 (13:43 +0100)]
bootstrap: Fix recognition of --depth option with recent git releases.

Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00106.html>.

* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Assume that
'git clone' and 'git fetch' support the --depth option.
* build-aux/bootstrap: Regenerated.

2 months agotoupper_l: Add tests.
Bruno Haible [Sun, 16 Feb 2025 06:02:50 +0000 (07:02 +0100)]
toupper_l: Add tests.

* tests/test-toupper_l.c: New file, based on tests/test-c32toupper.c.
* modules/toupper_l-tests: New file.

2 months agotoupper_l: New module.
Bruno Haible [Sun, 16 Feb 2025 05:55:52 +0000 (06:55 +0100)]
toupper_l: New module.

* lib/ctype.in.h: (toupper_l): New declaration.
* lib/toupper_l.c: New file.
* m4/toupper_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for toupper_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOUPPER_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_TOUPPER_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_TOUPPER_L,
HAVE_TOUPPER_L.
* modules/toupper_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of toupper_l.
* doc/posix-functions/toupper_l.texi: Mention the new module.

2 months agotolower_l: Add tests.
Bruno Haible [Sun, 16 Feb 2025 05:46:30 +0000 (06:46 +0100)]
tolower_l: Add tests.

* tests/test-tolower_l.c: New file, based on tests/test-c32tolower.c.
* modules/tolower_l-tests: New file.

2 months agotolower_l: New module.
Bruno Haible [Sun, 16 Feb 2025 05:45:57 +0000 (06:45 +0100)]
tolower_l: New module.

* lib/ctype.in.h: (tolower_l): New declaration.
* lib/tolower_l.c: New file.
* lib/to_l-impl.h: New file.
* m4/tolower_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for tolower_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOLOWER_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_TOLOWER_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_TOLOWER_L,
HAVE_TOLOWER_L.
* modules/tolower_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of tolower_l.
* doc/posix-functions/tolower_l.texi: Mention the new module.

2 months agoisxdigit_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 20:57:10 +0000 (21:57 +0100)]
isxdigit_l: Add tests.

* tests/test-isxdigit_l.c: New file, based on tests/test-c32isxdigit.c.
* modules/isxdigit_l-tests: New file.

2 months agoisxdigit_l: New module.
Bruno Haible [Sat, 15 Feb 2025 20:56:15 +0000 (21:56 +0100)]
isxdigit_l: New module.

* lib/ctype.in.h: (isxdigit_l): New declaration.
* lib/isxdigit_l.c: New file.
* m4/isxdigit_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isxdigit_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISXDIGIT_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISXDIGIT_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISXDIGIT_L,
HAVE_ISXDIGIT_L.
* modules/isxdigit_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isxdigit_l.
* doc/posix-functions/isxdigit_l.texi: Mention the new module.

2 months agoisupper_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 20:50:42 +0000 (21:50 +0100)]
isupper_l: Add tests.

* tests/test-isupper_l.c: New file, based on tests/test-c32isupper.c.
* modules/isupper_l-tests: New file.

2 months agoisupper_l: New module.
Bruno Haible [Sat, 15 Feb 2025 20:50:08 +0000 (21:50 +0100)]
isupper_l: New module.

* lib/ctype.in.h: (isupper_l): New declaration.
* lib/isupper_l.c: New file.
* m4/isupper_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isupper_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISUPPER_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISUPPER_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISUPPER_L,
HAVE_ISUPPER_L.
* modules/isupper_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isupper_l.
* doc/posix-functions/isupper_l.texi: Mention the new module.

2 months agoisspace_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 20:36:49 +0000 (21:36 +0100)]
isspace_l: Add tests.

* tests/test-isspace_l.c: New file, based on tests/test-c32isspace.c.
* modules/isspace_l-tests: New file.

2 months agoisspace_l: New module.
Bruno Haible [Sat, 15 Feb 2025 20:35:14 +0000 (21:35 +0100)]
isspace_l: New module.

* lib/ctype.in.h: (isspace_l): New declaration.
* lib/isspace_l.c: New file.
* m4/isspace_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isspace_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISSPACE_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISSPACE_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISSPACE_L,
HAVE_ISSPACE_L.
* modules/isspace_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isspace_l.
* doc/posix-functions/isspace_l.texi: Mention the new module.

2 months agoispunct_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 19:43:30 +0000 (20:43 +0100)]
ispunct_l: Add tests.

* tests/test-ispunct_l.c: New file, based on tests/test-c32ispunct.c.
* modules/ispunct_l-tests: New file.

2 months agoispunct_l: New module.
Bruno Haible [Sat, 15 Feb 2025 19:42:59 +0000 (20:42 +0100)]
ispunct_l: New module.

* lib/ctype.in.h: (ispunct_l): New declaration.
* lib/ispunct_l.c: New file.
* m4/ispunct_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for ispunct_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISPUNCT_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISPUNCT_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISPUNCT_L,
HAVE_ISPUNCT_L.
* modules/ispunct_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of ispunct_l.
* doc/posix-functions/ispunct_l.texi: Mention the new module.

2 months agoisprint_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 19:11:32 +0000 (20:11 +0100)]
isprint_l: Add tests.

* tests/test-isprint_l.c: New file, based on tests/test-c32isprint.c.
* modules/isprint_l-tests: New file.

2 months agoisprint_l: New module.
Bruno Haible [Sat, 15 Feb 2025 19:10:53 +0000 (20:10 +0100)]
isprint_l: New module.

* lib/ctype.in.h: (isprint_l): New declaration.
* lib/isprint_l.c: New file.
* m4/isprint_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isprint_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISPRINT_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISPRINT_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISPRINT_L,
HAVE_ISPRINT_L.
* modules/isprint_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isprint_l.
* doc/posix-functions/isprint_l.texi: Mention the new module.

2 months agoislower_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 19:02:23 +0000 (20:02 +0100)]
islower_l: Add tests.

* tests/test-islower_l.c: New file, based on tests/test-c32islower.c.
* modules/islower_l-tests: New file.

2 months agoislower_l: New module.
Bruno Haible [Sat, 15 Feb 2025 19:01:04 +0000 (20:01 +0100)]
islower_l: New module.

* lib/ctype.in.h: (islower_l): New declaration.
* lib/islower_l.c: New file.
* m4/islower_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for islower_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISLOWER_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISLOWER_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISLOWER_L,
HAVE_ISLOWER_L.
* modules/islower_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of islower_l.
* doc/posix-functions/islower_l.texi: Mention the new module.

2 months agoisgraph_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 18:53:17 +0000 (19:53 +0100)]
isgraph_l: Add tests.

* tests/test-isgraph_l.c: New file, based on tests/test-c32isgraph.c.
* modules/isgraph_l-tests: New file.

2 months agoisgraph_l: New module.
Bruno Haible [Sat, 15 Feb 2025 18:49:54 +0000 (19:49 +0100)]
isgraph_l: New module.

* lib/ctype.in.h: (isgraph_l): New declaration.
* lib/isgraph_l.c: New file.
* m4/isgraph_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isgraph_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISGRAPH_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISGRAPH_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISGRAPH_L,
HAVE_ISGRAPH_L.
* modules/isgraph_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isgraph_l.
* doc/posix-functions/isgraph_l.texi: Mention the new module.

2 months agoisdigit_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 18:30:24 +0000 (19:30 +0100)]
isdigit_l: Add tests.

* tests/test-isdigit_l.c: New file, based on tests/test-c32isdigit.c.
* modules/isdigit_l-tests: New file.

2 months agoisdigit_l: New module.
Bruno Haible [Sat, 15 Feb 2025 18:25:49 +0000 (19:25 +0100)]
isdigit_l: New module.

* lib/ctype.in.h: (isdigit_l): New declaration.
* lib/isdigit_l.c: New file.
* m4/isdigit_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isdigit_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISDIGIT_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISDIGIT_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISDIGIT_L,
HAVE_ISDIGIT_L.
* modules/isdigit_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isdigit_l.
* doc/posix-functions/isdigit_l.texi: Mention the new module.

2 months agoiscntrl_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 09:58:51 +0000 (10:58 +0100)]
iscntrl_l: Add tests.

* tests/test-iscntrl_l.c: New file, based on tests/test-c32iscntrl.c.
* modules/iscntrl_l-tests: New file.

2 months agoiscntrl_l: New module.
Bruno Haible [Sat, 15 Feb 2025 09:58:23 +0000 (10:58 +0100)]
iscntrl_l: New module.

* lib/ctype.in.h: (iscntrl_l): New declaration.
* lib/iscntrl_l.c: New file.
* m4/iscntrl_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for iscntrl_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISCNTRL_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISCNTRL_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISCNTRL_L,
HAVE_ISCNTRL_L.
* modules/iscntrl_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of iscntrl_l.
* doc/posix-functions/iscntrl_l.texi: Mention the new module.

2 months agoisblank_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 09:46:21 +0000 (10:46 +0100)]
isblank_l: Add tests.

* tests/test-isblank_l.c: New file, based on tests/test-c32isblank.c.
* modules/isblank_l-tests: New file.

2 months agoisblank_l: New module.
Bruno Haible [Sat, 15 Feb 2025 09:45:48 +0000 (10:45 +0100)]
isblank_l: New module.

* lib/ctype.in.h: (isblank_l): New declaration.
* lib/isblank_l.c: New file.
* m4/isblank_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isblank_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISBLANK_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISBLANK_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISBLANK_L,
HAVE_ISBLANK_L.
* modules/isblank_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isblank_l.
* doc/posix-functions/isblank_l.texi: Mention the new module.

2 months agoisalpha_l: Add tests.
Bruno Haible [Sat, 15 Feb 2025 09:32:11 +0000 (10:32 +0100)]
isalpha_l: Add tests.

* tests/test-isalpha_l.c: New file, based on tests/test-c32isalpha.c.
* modules/isalpha_l-tests: New file.

2 months agoisalpha_l: New module.
Bruno Haible [Sat, 15 Feb 2025 09:31:25 +0000 (10:31 +0100)]
isalpha_l: New module.

* lib/ctype.in.h: (isalpha_l): New declaration.
* lib/isalpha_l.c: New file.
* m4/isalpha_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isalpha_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISALPHA_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISALPHA_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISALPHA_L,
HAVE_ISALPHA_L.
* modules/isalpha_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isalpha_l.
* doc/posix-functions/isalpha_l.texi: Mention the new module.

2 months agoisascii: stop using it
Paul Eggert [Sat, 15 Feb 2025 02:04:54 +0000 (18:04 -0800)]
isascii: stop using it

* doc/pastposix-functions/isascii.texi: There is no isascii module.
* m4/mbswidth.m4 (gl_MBSWIDTH): Do not check for isascii,
as it no longer seems to be used here.
* tests/test-c-ctype.c (test_agree_with_C_locale):
Do not assume isascii exists, as POSIX no longer requires it.

2 months agodoc: “C11” → “C standard” for <sys/types.h>
Paul Eggert [Sat, 15 Feb 2025 02:02:04 +0000 (18:02 -0800)]
doc: “C11” → “C standard” for <sys/types.h>

* doc/gnulib-readme.texi (C language versions): Don’t be overly
specific about <sys/types.h>’s absence from the C standard.

2 months agoisalnum_l: Fix errors in C++ mode.
Bruno Haible [Fri, 14 Feb 2025 22:59:09 +0000 (23:59 +0100)]
isalnum_l: Fix errors in C++ mode.

* lib/ctype.in.h (isalnum_l): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
* tests/test-ctype-h-c++.cc (isalnum_l): Fix typo.
* doc/posix-functions/isalnum_l.texi: Correct platforms list.

2 months agoisalnum_l: Add tests.
Bruno Haible [Fri, 14 Feb 2025 08:01:06 +0000 (09:01 +0100)]
isalnum_l: Add tests.

* tests/test-isalnum_l.c: New file, based on tests/test-c32isalnum.c.
* modules/isalnum_l-tests: New file.

2 months agoisalnum_l: New module.
Bruno Haible [Fri, 14 Feb 2025 05:17:24 +0000 (06:17 +0100)]
isalnum_l: New module.

* lib/ctype.in.h: Include <locale.h>.
(isalnum_l): New declaration.
* lib/isalnum_l.c: New file.
* lib/is_l-impl.h: New file.
* m4/isalnum_l.m4: New file.
* m4/ctype_h.m4 (gl_CTYPE_H): Test for isalnum_l.
(gl_CTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_ISALNUM_L.
(gl_CTYPE_H_DEFAULTS): Initialize HAVE_ISALNUM_L.
* modules/ctype-h (Makefile.am): Substitute GNULIB_ISALNUM_L,
HAVE_ISALNUM_L.
* modules/isalnum_l: New file.
* tests/test-ctype-h-c++.cc: Check declaration of isalnum_l.
* doc/posix-functions/isalnum_l.texi: Mention the new module.

2 months agofreelocale: Allow non-POSIX prototype on macOS.
Bruno Haible [Fri, 14 Feb 2025 08:42:18 +0000 (09:42 +0100)]
freelocale: Allow non-POSIX prototype on macOS.

* tests/test-freelocale.c: Skip the signature check on macOS.
* doc/posix-functions/freelocale.texi: Mention the macOS problem.

2 months agonewlocale: Work around NetBSD bug.
Bruno Haible [Fri, 14 Feb 2025 14:42:22 +0000 (15:42 +0100)]
newlocale: Work around NetBSD bug.

* lib/newlocale.c (newlocale) [NetBSD]: Test whether the locale name is
valid; fail with error ENOENT if not.
* doc/posix-functions/newlocale.texi: Mention the NetBSD bug.

2 months agonewlocale: Work around macOS, NetBSD, Solaris 11 OpenIndiana bug.
Bruno Haible [Fri, 14 Feb 2025 14:24:54 +0000 (15:24 +0100)]
newlocale: Work around macOS, NetBSD, Solaris 11 OpenIndiana bug.

* m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Test for the "null base" bug.
Set REPLACE_NEWLOCALE to 1 if it has the bug.
* lib/newlocale.c (newlocale): Add alternative implementation that uses
the system's newlocale().
* modules/newlocale (configure.ac): Consider REPLACE_NEWLOCALE.
* tests/test-newlocale.c: Include <langinfo.h>.
(main): Verify fix for the "null base" bug.
* modules/newlocale-tests (configure.ac): Test for nl_langinfo_l.
* doc/posix-functions/newlocale.texi: Mention the "null base" bug.

2 months agonewlocale, freelocale: Tweak configuration.
Bruno Haible [Fri, 14 Feb 2025 13:32:30 +0000 (14:32 +0100)]
newlocale, freelocale: Tweak configuration.

* m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Make consistent with
m4/localename.m4.
* m4/freelocale.m4 (gl_FUNC_FREELOCALE): Likewise.

2 months agoduplocale: Support all platforms.
Bruno Haible [Fri, 14 Feb 2025 04:56:55 +0000 (05:56 +0100)]
duplocale: Support all platforms.

* lib/locale.in.h (duplocale): Declare also on platforms that don't
already have a duplocale function. Don't define HAVE_WORKING_DUPLOCALE.
* lib/duplocale.c: Include <stdlib.h>.
(duplocale): Renamed from rpl_duplocale. Add implementation for
platforms without native locale_t.
* modules/duplocale (Depends-on): Add newlocale, freelocale.
(configure.ac): Compile also on platforms without native locale_t.
* tests/test-duplocale.c: Ignore HAVE_WORKING_DUPLOCALE.
* tests/test-locale-h-c++.cc: Likewise.
* doc/posix-functions/duplocale.texi: Mention the change.

2 months agofreelocale: Fix typo.
Bruno Haible [Fri, 14 Feb 2025 04:55:48 +0000 (05:55 +0100)]
freelocale: Fix typo.

* lib/locale.in.h (freelocale): Fix mistake in last patch.

2 months agofreelocale: Add tests.
Bruno Haible [Fri, 14 Feb 2025 02:06:56 +0000 (03:06 +0100)]
freelocale: Add tests.

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

2 months agofreelocale: New module.
Bruno Haible [Fri, 14 Feb 2025 01:59:02 +0000 (02:59 +0100)]
freelocale: New module.

* lib/locale.in.h (freelocale): Consider GNULIB_FREELOCALE. Declare if
not declared.
* lib/freelocale.c: New file.
* m4/freelocale.m4: New file.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_FREELOCALE.
* modules/locale-h (Makefile.am): Substitute GNULIB_FREELOCALE.
* modules/freelocale: New file.
* tests/test-locale-h-c++.cc: Check declaration of freelocale.
* doc/posix-functions/freelocale.texi: Mention the new module.

2 months agonewlocale: Add tests.
Bruno Haible [Fri, 14 Feb 2025 01:52:01 +0000 (02:52 +0100)]
newlocale: Add tests.

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

2 months agonewlocale: New module.
Bruno Haible [Thu, 13 Feb 2025 22:01:52 +0000 (23:01 +0100)]
newlocale: New module.

* lib/locale.in.h (newlocale): Consider GNULIB_NEWLOCALE. Declare if
not declared. Don't define HAVE_WORKING_NEWLOCALE.
* lib/newlocale.c: New file.
* m4/newlocale.m4: New file.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_NEWLOCALE.
* modules/locale-h (Makefile.am): Substitute GNULIB_NEWLOCALE.
* modules/newlocale: New file.
* tests/test-locale-h-c++.cc: Check declaration of newlocale.
* tests/test-localename.c: Ignore HAVE_WORKING_NEWLOCALE.
* doc/posix-functions/newlocale.texi: Mention the new module.

2 months agolocalename-environ: New module.
Bruno Haible [Fri, 14 Feb 2025 01:02:58 +0000 (02:02 +0100)]
localename-environ: New module.

* lib/localename-environ.c: New file, extracted from
lib/localename-unsafe.c.
* lib/localename-unsafe.c (gl_locale_name_environ): Remove function.
* m4/localename.m4 (gl_LOCALENAME_ENVIRON): New macro.
* modules/localename-environ: New file.
* modules/localename-unsafe (Depends-on): Add localename-environ.
* modules/setlocale (Depends-on): Likewise.

2 months agolocale-h: Ensure locale_t type.
Bruno Haible [Thu, 13 Feb 2025 21:16:13 +0000 (22:16 +0100)]
locale-h: Ensure locale_t type.

* lib/locale.in.h (gl_log2_lc_mask, gl_log2_lcmask_to_index,
gl_index_to_log2_lcmask): New macros.
(LC_COLLATE_MASK, LC_CTYPE_MASK, LC_MESSAGES_MASK, LC_MONETARY_MASK,
LC_NUMERIC_MASK, LC_TIME_MASK, LC_ALL_MASK): New macros.
(struct gl_locale_category_t, struct gl_locale_t, locale_t): New types.
(LC_GLOBAL_LOCALE, GNULIB_defined_locale_t): New macros.
* m4/locale_h.m4 (gl_LOCALE_H): Set and define HAVE_WINDOWS_LOCALE_T.
(gl_LOCALE_T): Prepare for substituting HAVE_LOCALE_T.
* modules/locale-h (Depends-on): Add bool.
(Makefile.am): Substitute HAVE_LOCALE_T, HAVE_WINDOWS_LOCALE_T.
* tests/test-locale-h.c: Check that the LC_*_MASK macros and locale_t
are defined.
* doc/posix-headers/locale.texi: Document the change.

2 months agoduplocale: Relicense under LGPLv2+.
Bruno Haible [Thu, 13 Feb 2025 20:46:12 +0000 (21:46 +0100)]
duplocale: Relicense under LGPLv2+.

* modules/duplocale (License): Change to LGPLv2+.
* lib/duplocale.c: Update license notice.

2 months agoRename module ctype to ctype-h.
Bruno Haible [Thu, 13 Feb 2025 20:00:06 +0000 (21:00 +0100)]
Rename module ctype to ctype-h.

* modules/ctype-h: Renamed from modules/ctype.
* modules/ctype-h-tests: Renamed from modules/ctype-tests.
* modules/ctype-h-c++-tests: Renamed from modules/ctype-c++-tests.
* tests/test-ctype-h.c: Renamed from tests/test-ctype.c.
* tests/test-ctype-h-c++.cc: Renamed from tests/test-ctype-c++.cc.
* tests/test-ctype-h-c++2.cc: Renamed from tests/test-ctype-c++2.cc.
* doc/posix-headers/ctype.texi: Update.
* modules/* (Depends-on): Update.
* modules/ctype: New file.

2 months agogetaddrinfo: Fix a compilation error in C++ mode (regression yesterday).
Bruno Haible [Thu, 13 Feb 2025 11:02:16 +0000 (12:02 +0100)]
getaddrinfo: Fix a compilation error in C++ mode (regression yesterday).

Reported by KO Myung-Hun <komh78@gmail.com>.

* m4/getaddrinfo.m4 (gl_GETADDRINFO): Don't set REPLACE_GETADDRINFO to 1
if getaddrinfo does not exist.

2 months agosetlocale: Update info about Galician and Tamil.
Bruno Haible [Thu, 13 Feb 2025 01:18:05 +0000 (02:18 +0100)]
setlocale: Update info about Galician and Tamil.

* lib/setlocale.c (locales_with_principal_territory): Galician is
mostly spoken in Spain, not Portugal. Tamil is mostly spoken in India,
not Sri Lanka.

2 months agogettext-h: Fix compilation error on native Windows.
Bruno Haible [Wed, 12 Feb 2025 22:43:21 +0000 (23:43 +0100)]
gettext-h: Fix compilation error on native Windows.

* modules/gettext-h (Depends-on): Add locale-h.

2 months agogetaddrinfo: Support the AI_NUMERICSERV flag.
Bruno Haible [Wed, 12 Feb 2025 22:34:39 +0000 (23:34 +0100)]
getaddrinfo: Support the AI_NUMERICSERV flag.

* m4/getaddrinfo.m4 (gl_GETADDRINFO): Require AC_CANONICAL_HOST. Test
whether getaddrinfo supports AI_NUMERICSERV.
* lib/getaddrinfo.c (getaddrinfo): Accept and implement the
AI_NUMERICSERV flag.
* tests/test-getaddrinfo.c (simple): In pass 4, pass the AI_NUMERICSERV
flag.
(main): Test numeric services in pass 1. Add pass 4.
* doc/posix-functions/getaddrinfo.texi: Mention the native Windows bug.

2 months agogetaddrinfo: Support the AI_NUMERICHOST flag.
Bruno Haible [Wed, 12 Feb 2025 19:03:29 +0000 (20:03 +0100)]
getaddrinfo: Support the AI_NUMERICHOST flag.

* lib/getaddrinfo.c (is_numeric_host): New function.
(getaddrinfo): Accept and implement the AI_NUMERICHOST flag.
* modules/getaddrinfo (Depends-on): Add inet_pton.
* tests/test-getaddrinfo.c: Include <ctype.h>.
(simple): In pass 3, pass the AI_NUMERICHOST flag.
(main): Add a pass 3.

2 months agogetaddrinfo tests: Test both a NULL and a non-NULL hints argument.
Bruno Haible [Wed, 12 Feb 2025 18:05:20 +0000 (19:05 +0100)]
getaddrinfo tests: Test both a NULL and a non-NULL hints argument.

* tests/test-getaddrinfo.c (simple): Add a 'pass' argument.
(main): Make two passes of 'simple' invocations.

2 months agonetdb-h: Ensure AI_NUMERICHOST and AI_NUMERICSERV are defined.
Bruno Haible [Wed, 12 Feb 2025 17:43:59 +0000 (18:43 +0100)]
netdb-h: Ensure AI_NUMERICHOST and AI_NUMERICSERV are defined.

* lib/netdb.in.h (AI_NUMERICHOST): New macro.
* tests/test-netdb-h.c: Verify that AI_NUMERICHOST and AI_NUMERICSERV
are defined.
* doc/posix-headers/netdb.texi: Mention the platform support for
AI_NUMERICHOST and AI_NUMERICSERV.

2 months agoacl-permissions, file-has-acl: Depend on stdint-h for SIZE_MAX.
Collin Funk [Wed, 12 Feb 2025 02:44:33 +0000 (18:44 -0800)]
acl-permissions, file-has-acl: Depend on stdint-h for SIZE_MAX.

* lib/acl-internal.h: Include stdint.h.
(SIZE_MAX): Remove definition.
* lib/file-has-acl.c: Don't include stdint.h again.
* modules/acl-permissions (Depends-on): Add stdint-h.
* modules/file-has-acl (Depends-on): Likewise.

2 months agopopen: Set gl_cv_func_popen_works to "guessing no" on OS/2.
KO Myung-Hun [Mon, 10 Feb 2025 11:35:00 +0000 (20:35 +0900)]
popen: Set gl_cv_func_popen_works to "guessing no" on OS/2.

* doc/posix-functions/popen.texi: List OS/2 kLIBC case.
* m4/popen.m4 (gl_FUNC_POPEN): Set gl_cv_func_popen_works to
"guessing no" on OS/2.

Copyright-paperwork-exempt: Yes

2 months agombsstr, unistr, unigbrk: Support library namespacing.
Bruno Haible [Mon, 10 Feb 2025 15:22:19 +0000 (16:22 +0100)]
mbsstr, unistr, unigbrk: Support library namespacing.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Don't define
const-improved macro if the function is already declared as a macro.
* lib/unistr.in.h (u*_check, u*_next, u*_prev, u*_chr, u*_strchr,
u*_strrchr, u*_strpbrk, u*_strstr): Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.

2 months agombsstr, etc.: Fix compilation in C++ mode on AIX with xlc.
Bruno Haible [Mon, 10 Feb 2025 10:46:01 +0000 (11:46 +0100)]
mbsstr, etc.: Fix compilation in C++ mode on AIX with xlc.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Wrap template
declarations and definitions in 'extern "C++" { ... }'.

2 months agombsstr, unistr, unigbrk: Fix compilation with "gcc-4.8.5 -std=gnu11".
Bruno Haible [Mon, 10 Feb 2025 07:25:19 +0000 (08:25 +0100)]
mbsstr, unistr, unigbrk: Fix compilation with "gcc-4.8.5 -std=gnu11".

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Don't assume that
GCC and clang support '_Generic' with '-std=c11' or 'std=gnu11' option.
* lib/unistr.in.h (u*_check, u*_next, u*_prev, u*_chr, u*_strchr,
u*_strrchr, u*_strpbrk, u*_strstr): Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.