]>
Savannah Git Hosting - gnulib.git/log
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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'.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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++" { ... }'.
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.
Bruno Haible [Sun, 9 Feb 2025 21:02:27 +0000 (22:02 +0100)]
string-buffer, string-buffer-reversed: Allow for better static analysis.
* lib/string-buffer.h (sb_appendvf, sb_appendf, sb_xappendvf,
sb_xappendf): Don't declare if SB_NO_APPENDF is defined.
(sb_xdupfree_c): Declare a non-NULL return value if SB_NO_APPENDF is
defined.
* lib/string-buffer-reversed.h (sbr_prependvf, sbr_prependf,
sbr_xprependvf, sbr_xprependf): Don't declare if SBR_NO_PREPENDF is
defined.
(sbr_xdupfree_c): Declare a non-NULL return value if SBR_NO_PREPENDF is
defined.
Bruno Haible [Sun, 9 Feb 2025 21:02:14 +0000 (22:02 +0100)]
xstring-desc: Allow for better static analysis.
* lib/xstring-desc.h (xsd_c): Declare a non-NULL return value.
Bruno Haible [Sun, 9 Feb 2025 20:40:08 +0000 (21:40 +0100)]
mbsstr, mbscasestr, mbspcasecmp, unistr, unigbrk: Simplify.
Suggested by Paul Eggert.
* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): On ISO C compliant
compilers, use the _Generic based macro instead of the 'typeof' based
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.
Bruno Haible [Sun, 9 Feb 2025 15:56:39 +0000 (16:56 +0100)]
string-buffer, string-buffer-reversed: Make OOM handling consistent.
* lib/string-buffer.h (struct string_buffer): New field 'oom'.
* lib/string-buffer.c (sb_init): Initialize the 'oom' field.
(sb_append1, sb_append_desc, sb_append_c): Upon out-of-memory, set
buffer->oom, not buffer->error.
(sb_dupfree, sb_dupfree_c): If there was an OOM, return NULL.
* lib/string-buffer-printf.c (sb_appendvf, sb_appendf): Upon
out-of-memory, set buffer->oom, not buffer->error.
* lib/string-buffer-reversed.h (struct string_buffer_reversed): New
field 'oom'.
* lib/string-buffer-reversed.c (sbr_init): Initialize the 'oom' field.
(sbr_prepend1, sbr_prepend_desc, sbr_prepend_c): Upon out-of-memory, set
buffer->oom, not buffer->error.
(sbr_dupfree, sbr_dupfree_c): If there was an OOM, return NULL.
* lib/string-buffer-reversed-printf.c (sbr_prependvf, sbr_prependf):
Upon out-of-memory, set buffer->oom, not buffer->error.
Bruno Haible [Sun, 9 Feb 2025 10:27:56 +0000 (11:27 +0100)]
unistr, unigbrk: Use const-improved function macros for 30 functions.
Reported by Kang-Che Sung <explorer09@gmail.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2025-02/msg00000.html>.
* lib/unistr.in.h (u*_check, u*_next, u*_prev): Define as macros that
cast the result to a non-const pointer when the argument is a non-const
pointer.
(u*_chr, u*_strchr, u*_strrchr, u*_strpbrk, u*_strstr): Define as macros
that cast the result to a const pointer when the argument is a const
pointer.
* lib/unistr/u8-check.c: Define _LIBUNISTRING_NO_CONST_GENERICS.
* lib/unistr/u16-check.c: Likewise.
* lib/unistr/u32-check.c: Likewise.
* lib/unistr/u8-next.c: Likewise.
* lib/unistr/u16-next.c: Likewise.
* lib/unistr/u32-next.c: Likewise.
* lib/unistr/u8-prev.c: Likewise.
* lib/unistr/u16-prev.c: Likewise.
* lib/unistr/u32-prev.c: Likewise.
* lib/unistr/u8-chr.c: Likewise.
* lib/unistr/u16-chr.c: Likewise.
* lib/unistr/u32-chr.c: Likewise.
* lib/unistr/u8-strchr.c: Likewise.
* lib/unistr/u16-strchr.c: Likewise.
* lib/unistr/u32-strchr.c: Likewise.
* lib/unistr/u8-strrchr.c: Likewise.
* lib/unistr/u16-strrchr.c: Likewise.
* lib/unistr/u32-strrchr.c: Likewise.
* lib/unistr/u8-strpbrk.c: Likewise.
* lib/unistr/u16-strpbrk.c: Likewise.
* lib/unistr/u32-strpbrk.c: Likewise.
* lib/unistr/u8-strstr.c: Likewise.
* lib/unistr/u16-strstr.c: Likewise.
* lib/unistr/u32-strstr.c: Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Define as
macros that cast the result to a non-const pointer when the argument is
a non-const pointer.
* lib/unigbrk/u8-grapheme-next.c: Define _LIBUNISTRING_NO_CONST_GENERICS.
* lib/unigbrk/u16-grapheme-next.c: Likewise.
* lib/unigbrk/u32-grapheme-next.c: Likewise.
* lib/unigbrk/u8-grapheme-prev.c: Likewise.
* lib/unigbrk/u16-grapheme-prev.c: Likewise.
* lib/unigbrk/u32-grapheme-prev.c: Likewise.
Bruno Haible [Sun, 9 Feb 2025 10:16:03 +0000 (11:16 +0100)]
mbsstr, mbscasestr, mbspcasecmp: Fix use of 'typeof'.
* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Perform array to
pointer conversion in argument of 'typeof'.
Bruno Haible [Sun, 9 Feb 2025 08:03:53 +0000 (09:03 +0100)]
mbsstr, mbscasestr, mbspcasecmp: Use const-improved C++ templates.
* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): In C++, define
through a template that supports both 'char *' and 'const char *'.
Bruno Haible [Sun, 9 Feb 2025 07:18:18 +0000 (08:18 +0100)]
mbsstr, mbscasestr, mbspcasecmp: Use const-improved function macros.
* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Define as macros
that cast the result to 'const char *' when the first argument is a
'const char *'.
* lib/mbsstr.c: Define _GL_NO_CONST_GENERICS.
* lib/mbscasestr.c: Likewise.
* lib/mbspcasecmp.c: Likewise.