]> Savannah Git Hosting - gnulib.git/log
gnulib.git
13 months agognulib-tool.py: Fix gnulib-cache.m4 output.
Collin Funk [Wed, 6 Mar 2024 04:44:17 +0000 (20:44 -0800)]
gnulib-tool.py: Fix gnulib-cache.m4 output.

* pygnulib/GLImport.py (GLImport.gnulib_cache): Don't emit an extra '#'
to start the actioncmd comment.

13 months agognulib-tool.py: Tweak comment.
Bruno Haible [Wed, 6 Mar 2024 10:34:36 +0000 (11:34 +0100)]
gnulib-tool.py: Tweak comment.

* pygnulib/GLMakefileTable.py (GLMakefileTable.parent): Tweak 'gentests'
description.

13 months agognulib-tool.py: Follow gnulib-tool changes, part 42.
Collin Funk [Wed, 6 Mar 2024 04:32:29 +0000 (20:32 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 42.

Follow gnulib-tool change
2019-02-15  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Support --import with just a few tests, not --with-tests.

* pygnulib/GLImport.py (GLImport.execute): Use 'gentests' instead of
'inctests' when generating files.
* pygnulib/GLMakefileTable.py (GLMakefileTable.parent): Add 'gentests'
argument and use it instead of 'inctests'.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 41.
Collin Funk [Wed, 6 Mar 2024 00:30:20 +0000 (16:30 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 41.

Follow gnulib-tool change
2018-09-03  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Consider the dotfirst
flag.
(GLEmiter.tests_Makefile_am): Don't consider the dotfirst flag.
* pygnulib/GLImport.py (GLImport.execute): Set the dotfirst for tests.
* pygnulib/GLMakefileTable.py (GLMakefileTable.editor): Add optional
dotfirst flag to fix build order when $testsbase is a subdir of
$sourcebase.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 40.
Collin Funk [Tue, 5 Mar 2024 05:26:08 +0000 (21:26 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 40.

Follow gnulib-tool change
2021-12-18  Bruno Haible  <bruno@clisp.org>
stdint: Fix handling of limits.h (regression 2021-12-16).

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am)
(GLEmiter.tests_Makefile_am): If --gnu-make is used, assume that
AC_SUBSTed variables for conditionals are constructed by appending the
suffix '_CONDITION'.

14 months agognulib-tool.py: Fix incorrect tests Makefile.am generation.
Collin Funk [Tue, 5 Mar 2024 10:11:51 +0000 (02:11 -0800)]
gnulib-tool.py: Fix incorrect tests Makefile.am generation.

* pygnulib/GLImport.py: Call GLEmiter.tests_Makefile_am instead of
GLEmiter.lib_Makefile_am when creating the tests Makefile. Replace
incorrect actioncmd argument with witness_macro.

14 months agodoc: Update info about fopencookie.
Bruno Haible [Tue, 5 Mar 2024 18:11:09 +0000 (19:11 +0100)]
doc: Update info about fopencookie.

Reported by Michael Ford <fanquake@gmail.com>.

* doc/glibc-functions/fopencookie.texi: Update platforms list.

14 months agodoc: Fix a typo.
Bruno Haible [Tue, 5 Mar 2024 17:59:33 +0000 (18:59 +0100)]
doc: Fix a typo.

Reported by Tim Rice in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00023.html>.

* doc/build-automation.texi (Building gnulib): Fix typo.

14 months agoc-strtof, c-strtod, c-strtold: Make multithread-safe.
Bruno Haible [Tue, 5 Mar 2024 16:10:38 +0000 (17:10 +0100)]
c-strtof, c-strtod, c-strtold: Make multithread-safe.

* lib/c-strtod.c: Include <langinfo.h>, c-ctype.h.
(decimal_point_char): New function, copied from lib/vasnprintf.c.
(C_STRTOD): On platforms that don't have STRTOD_L nor a working
uselocale(), pre-parse the number and call STRTOD after having replaced
the '.' with the locale-dependent decimal point character.
* m4/c-strtod.m4 (gl_C_STRTOD, gl_C_STRTOF, gl_C_STRTOLD): Test for
nl_langinfo().
* modules/c-strtof (Depends-on): Add c-ctype. Remove strdup-posix.
* modules/c-strtod (Depends-on): Likewise.
* modules/c-strtold (Depends-on): Likewise.

14 months agoc-strtold: Add multithread-safety test.
Bruno Haible [Tue, 5 Mar 2024 12:44:13 +0000 (13:44 +0100)]
c-strtold: Add multithread-safety test.

* tests/test-c-strtold-mt.c: New file.
* tests/test-c-strtold-mt.sh: New file, based on
tests/test-c-strtold1.sh.
* modules/c-strtold-tests (Files): Add them.
(Depends-on): Add thread, nanosleep.
(Makefile.am): Arrange to build test-c-strtold-mt and run
test-c-strtold-mt.sh.

14 months agoc-strtod: Add multithread-safety test.
Bruno Haible [Tue, 5 Mar 2024 12:35:08 +0000 (13:35 +0100)]
c-strtod: Add multithread-safety test.

* tests/test-c-strtod-mt.c: New file.
* tests/test-c-strtod-mt.sh: New file, based on tests/test-c-strtod1.sh.
* modules/c-strtod-tests (Files): Add them.
(Depends-on): Add thread, nanosleep.
(Makefile.am): Arrange to build test-c-strtod-mt and run
test-c-strtod-mt.sh.

14 months agoc-strtof: Add multithread-safety test.
Bruno Haible [Tue, 5 Mar 2024 12:42:27 +0000 (13:42 +0100)]
c-strtof: Add multithread-safety test.

* tests/test-c-strtof-mt.c: New file.
* tests/test-c-strtof-mt.sh: New file, based on tests/test-c-strtof1.sh.
* modules/c-strtof-tests (Files): Add them.
(Depends-on): Add thread, nanosleep.
(Makefile.am): Arrange to build test-c-strtof-mt and run
test-c-strtof-mt.sh.

14 months agolocale-*.m4: Update comments.
Bruno Haible [Tue, 5 Mar 2024 11:56:17 +0000 (12:56 +0100)]
locale-*.m4: Update comments.

* m4/locale-ar.m4: Update comments for Solaris 10.
* m4/locale-fr.m4: Likewise.
* m4/locale-ja.m4: Likewise.
* m4/locale-tr.m4: Likewise.

14 months agoc-strtold: Add tests.
Bruno Haible [Tue, 5 Mar 2024 11:21:36 +0000 (12:21 +0100)]
c-strtold: Add tests.

* tests/test-strtold.h: New file, extracted from tests/test-strtold.c.
* tests/test-strtold.c: Include test-strtold.h.
(FABSL): Remove unused macro.
(main): Just invoke test_function.
* tests/test-strtold1.c: Add comment.
* modules/strtold-tests (Files): Add tests/test-strtold.h.
* tests/test-c-strtold.c: New file, based on tests/test-strtold.c.
* tests/test-c-strtold1.c: New file, based on tests/test-strtold1.c.
* tests/test-c-strtold1.sh: New file, based on tests/test-strtold1.sh.
* modules/c-strtold-tests: New file, based on modules/strtold-tests.

14 months agoc-strtod: Add tests.
Bruno Haible [Tue, 5 Mar 2024 11:19:29 +0000 (12:19 +0100)]
c-strtod: Add tests.

* tests/test-strtod.h: New file, extracted from tests/test-strtod.c.
* tests/test-strtod.c: Include test-strtod.h.
(FABS): Remove unused macro.
(main): Just invoke test_function.
* tests/test-strtod1.c: Add comment.
* modules/strtod-tests (Files): Add tests/test-strtod.h.
* tests/test-c-strtod.c: New file, based on tests/test-strtod.c.
* tests/test-c-strtod1.c: New file, based on tests/test-strtod1.c.
* tests/test-c-strtod1.sh: New file, based on tests/test-strtod1.sh.
* modules/c-strtod-tests: New file, based on modules/strtod-tests.

14 months agoc-strtof: Add tests.
Bruno Haible [Tue, 5 Mar 2024 11:18:01 +0000 (12:18 +0100)]
c-strtof: Add tests.

* tests/test-strtof.h: New file, extracted from tests/test-strtof.c.
* tests/test-strtof.c: Include test-strtof.h.
(FABS): Remove unused macro.
(main): Just invoke test_function.
* tests/test-strtof1.c: Add comment.
* modules/strtof-tests (Files): Add tests/test-strtof.h.
* tests/test-c-strtof.c: New file, based on tests/test-strtof.c.
* tests/test-c-strtof1.c: New file, based on tests/test-strtof1.c.
* tests/test-c-strtof1.sh: New file, based on tests/test-strtof1.sh.
* modules/c-strtof-tests: New file, based on modules/strtof-tests.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 39.
Collin Funk [Mon, 4 Mar 2024 20:35:15 +0000 (12:35 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 39.

Follow gnulib-tool change
2017-12-28  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Make --conditional-dependencies work better.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Add argument
referenceable_modules. Use referencable_modules for dependencies.
* pygnulib/GLImport.py (GLImport.__init__): Don't reject the combination
of --conditional-dependencies with --with-tests when mode is 'import'.
(GLImport.gnulib_comp): Pass it.
* pygnulib/GLTestDir.py (GLTestDir.execute): Pass it.

14 months agodoc: Tweak last commit.
Bruno Haible [Mon, 4 Mar 2024 17:26:43 +0000 (18:26 +0100)]
doc: Tweak last commit.

* doc/gnulib-tool.texi (Style of #include statements): Use
@itemize @asis{}. Recommended by Patrice Dumas.

14 months agodoc: Fix build errors.
Collin Funk [Mon, 4 Mar 2024 13:09:51 +0000 (05:09 -0800)]
doc: Fix build errors.

* doc/gnulib-tool.texi (Style of #include statements): Use @itemize w{}
instead of the incorrect @itemize @asis.

14 months agognulib-tool.py: Adjust construction of configure.ac path.
Collin Funk [Mon, 4 Mar 2024 00:00:57 +0000 (16:00 -0800)]
gnulib-tool.py: Adjust construction of configure.ac path.

* pygnulib/GLConfig.py (GLConfig.setAutoconfFile): Join destdir and
configure.ac instead of using relativize.

14 months agognulib-tool.py: Fix output of gnulib-comp.m4.
Collin Funk [Sun, 3 Mar 2024 02:43:26 +0000 (18:43 -0800)]
gnulib-tool.py: Fix output of gnulib-comp.m4.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Fix indentation.
Don't print nonstring values into gnulib-comp.m4.

14 months agognulib-tool.py: Make output of test Makefile.am match gnulib-tool.
Collin Funk [Sat, 2 Mar 2024 12:59:04 +0000 (04:59 -0800)]
gnulib-tool.py: Make output of test Makefile.am match gnulib-tool.

* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Don't sort EXTRA_DIST file
names for test modules.

14 months agognulib-tool.py: Fix last commit.
Bruno Haible [Sun, 3 Mar 2024 10:12:39 +0000 (11:12 +0100)]
gnulib-tool.py: Fix last commit.

* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Ignore libname and
libext here.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 38.
Collin Funk [Sat, 2 Mar 2024 07:39:26 +0000 (23:39 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 38.

Follow gnulib-tool change
2020-12-26  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Make --conditional-dependencies work with --with-tests.

* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Add missing
moduletable argument. Handle conditional dependencies like
GLEmiter.lib_Makefile_am.
* pygnulib/GLTestDir.py (GLTestDir.execute): Adjust arguments.

14 months agodoc: Update regarding --create-megatestdir.
Bruno Haible [Sun, 3 Mar 2024 09:52:53 +0000 (10:52 +0100)]
doc: Update regarding --create-megatestdir.

Reported by Alexei Sholomitskiy <asholomitskiy84@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-07/msg00071.html>
and by Collin Funk <collin.funk1@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00007.html>.

* doc/build-automation.texi (Building gnulib): Discourage the use of
--create-megatestdir with all modules.

14 months agognulib-tool.py: Clarify minimum supported Python version.
Bruno Haible [Fri, 1 Mar 2024 12:22:27 +0000 (13:22 +0100)]
gnulib-tool.py: Clarify minimum supported Python version.

* pygnulib/main.py: Add comment regarding the Python version.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 37.
Collin Funk [Fri, 1 Mar 2024 02:15:19 +0000 (18:15 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 37.

Follow gnulib-tool change
2018-10-22  Bruno Haible  <bruno@clisp.org>
Assume Automake >= 1.11.

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am)
(GLEmiter.tests_Makefile_am): Emit a Makefile.am that requires Automake
>= 1.11.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Likewise.
* pygnulib/constants.py: Update comment.

14 months agognulib-tool.py: Fix GNU Make conversion regular expressions.
Collin Funk [Fri, 1 Mar 2024 02:37:53 +0000 (18:37 -0800)]
gnulib-tool.py: Fix GNU Make conversion regular expressions.

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Reduce code
duplication. Use re.MULTILINE so '^' matches the start of each line
instead of only the start of a string.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 36.
Collin Funk [Thu, 29 Feb 2024 23:31:17 +0000 (15:31 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 36.

Follow gnulib-tool change
2017-03-14  Mathieu Lirzin  <mthl@gnu.org>
gnulib-tool: don't automatically distribute files from top/

* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Don't distribute files from
top/ automatically.

14 months agoxalloc: Don't use identifier 'nonnull'.
Bruno Haible [Thu, 29 Feb 2024 15:42:00 +0000 (16:42 +0100)]
xalloc: Don't use identifier 'nonnull'.

* lib/xmalloc.c (check_nonnull): Renamed from nonnull.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 35.
Collin Funk [Thu, 29 Feb 2024 06:15:04 +0000 (22:15 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 35.

Follow gnulib-tool change
2023-05-28  Bruno Haible  <bruno@clisp.org>
warnings, manywarnings: Assume autoconf >= 2.64.

* pygnulib/GLConfig.py (GLConfig.default, GLConfig.getAutoconfVersion)
(GLConfig.setAutoconfVersion, resetAutoconfVersion): Set required
Autoconf version to 2.64.
* pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Likewise.
* pygnulib/GLImport.py (GLImport.__init__): Likewise.
* pygnulib/constants.py (DEFAULT_AUTOCONF_MINVERSION): Likewise.
* pygnulib/main.py: Likewise.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 34.
Collin Funk [Thu, 29 Feb 2024 05:17:49 +0000 (21:17 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 34.

Follow gnulib-tool change
2017-05-15  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Fix generated code when libtests contains module 'alloca'.

* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Use @ALLOCA@ for
libtests.a instead of @LTALLOCA@.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 33.
Collin Funk [Thu, 29 Feb 2024 03:05:16 +0000 (19:05 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 33.

Follow gnulib-tool change
2017-03-14  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Don't produce a tests directory with only snippet .h files.

* pygnulib/GLModuleSystem.py
(GLModuleTable.transitive_closure_separately): Don't create a test
directory if all test related modules have applicability 'all'.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 32.
Collin Funk [Thu, 29 Feb 2024 00:35:36 +0000 (16:35 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 32.

Follow gnulib-tool change
2018-10-22  Bruno Haible  <bruno@clisp.org>
Fix failure of 'gnulib-tool --create-testdir' with all modules.

* pygnulib/GLTestDir.py (GLTestDir.execute): Exclude the 'timevar'
module from --create-testdir with all modules. Update comment.

14 months agognulib-tool.py: Emit year range on file copyright notices.
Collin Funk [Wed, 28 Feb 2024 21:12:05 +0000 (13:12 -0800)]
gnulib-tool.py: Emit year range on file copyright notices.

* pygnulib/GLInfo.py (GLInfo.copyright_range): New function. Return a
copyright string with a year range.
* pygnulib/GLEmiter.py (GLEmiter.copyright_notice): Use the new function
for file copyright headers.

14 months agognulib-tool.py: Make module sorting more similar to gnulib-tool.
Collin Funk [Wed, 28 Feb 2024 11:33:15 +0000 (03:33 -0800)]
gnulib-tool.py: Make module sorting more similar to gnulib-tool.

* pygnulib/GLImport.py (GLImport.__init__): Sort modules when mode is
'import'.
(GLImport.actioncmd): Don't sort modules while creating actioncmd. Use
preferred quoting style.

14 months agognulib-tool: Make --version output independent of git's configuration.
Bruno Haible [Wed, 28 Feb 2024 10:52:33 +0000 (11:52 +0100)]
gnulib-tool: Make --version output independent of git's configuration.

Reported by Collin Funk <collin.funk1@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00268.html>.

* pygnulib/GLInfo.py (GLInfo.date): Pass --format and --date options, to
override the user's git configuration.
* gnulib-tool (func_version): Likewise. Also pass options '-n 1', to
speed up the operation.

14 months agognulib-tool.py: Avoid exception when 'git log' output is unexpected.
Bruno Haible [Wed, 28 Feb 2024 10:38:00 +0000 (11:38 +0100)]
gnulib-tool.py: Avoid exception when 'git log' output is unexpected.

* pygnulib/GLInfo.py (GLInfo.date): When the 'git log' output does not
contain a line with the expected 'Date:' pattern, pass the empty string
to GNU date.

14 months agognulib-tool: Avoid references to functions that get defined later.
Bruno Haible [Wed, 28 Feb 2024 10:23:17 +0000 (11:23 +0100)]
gnulib-tool: Avoid references to functions that get defined later.

* gnulib-tool (func_fatal_error, func_warning, func_readlink): Move
before func_gnulib_dir.

14 months agoisnan: Fix compilation error in C++ mode on OpenBSD 7.5-beta.
Bruno Haible [Tue, 27 Feb 2024 23:33:49 +0000 (00:33 +0100)]
isnan: Fix compilation error in C++ mode on OpenBSD 7.5-beta.

Reported by Christian Weisgerber <naddy@mips.inka.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00261.html>.

* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISNAN): Define on all platforms
with clang ≥ 14.

14 months agognulib-tool.py: Fix configure.ac output.
Collin Funk [Tue, 27 Feb 2024 22:15:10 +0000 (14:15 -0800)]
gnulib-tool.py: Fix configure.ac output.

* pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Fix backslash escapes
in raw string.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 31.
Collin Funk [Tue, 27 Feb 2024 10:01:59 +0000 (02:01 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 31.

Follow gnulib-tool change
2021-06-04  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Stop doing license notice replacements.

* pygnulib/GLConfig.py (GLConfig.default): Remove 'copyrights' key. Add
'gnu_make' key which returns False.
(checkCopyrights): Remove function.
(setSymbolic, resetSymbolic): Remove 'copyrights' key.
* pygnulib/GLImport.py (GLImport.prepare): Remove copyrights variable.
Don't modify license notice on source files.
(GLImport.execute): Remove copyrights variable.

14 months agognulib-tool.py: Small fix of part 27.
Collin Funk [Tue, 27 Feb 2024 10:45:16 +0000 (11:45 +0100)]
gnulib-tool.py: Small fix of part 27.

* pygnulib/GLConfig.py (GLConfig.default): Add 'gnu_make' key which
returns False.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 30.
Collin Funk [Tue, 27 Feb 2024 05:46:30 +0000 (21:46 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 30.

Follow gnulib-tool change
2021-05-30  Bruno Haible  <bruno@clisp.org>
Write 'LGPLv3+ or GPLv2+' instead of 'LGPLv3+ or GPLv2'.

* pygnulib/GLImport.py (GLImport.prepare): Change.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 29.
Collin Funk [Tue, 27 Feb 2024 05:22:23 +0000 (21:22 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 29.

Follow gnulib-tool change
2021-03-06  Paul Eggert  <eggert@cs.ucla.edu>
parse-datetime2: fix licensing

* pygnulib/GLModuleSystem.py (GLModule.getLicense): Handle the special
licensing case for parse-datetime2 or any other module starting with
"parse-datetime". Update comment.

14 months agognulib-tool.py: Add more comments.
Bruno Haible [Tue, 27 Feb 2024 02:30:50 +0000 (03:30 +0100)]
gnulib-tool.py: Add more comments.

* pygnulib/main.py: Add comments regarding code style. Mention the
pycodestyle and pylint configurations.

14 months agognulib-tool.py: Add configuration files for Python tools.
Collin Funk [Tue, 27 Feb 2024 00:02:34 +0000 (16:02 -0800)]
gnulib-tool.py: Add configuration files for Python tools.

* pygnulib/.pylintrc: New file, used by pylintrc.
* pygnulib/setup.cfg: New file, currently only used for pycodestyle
options.

14 months agognulib-tool.py: Fix undefined variable access.
Collin Funk [Tue, 27 Feb 2024 00:13:46 +0000 (16:13 -0800)]
gnulib-tool.py: Fix undefined variable access.

* pygnulib/main.py (main): Don't use gnu_make before it is defined.

14 months agognulib-tool.py: Reorganize code.
Bruno Haible [Mon, 26 Feb 2024 22:44:01 +0000 (23:44 +0100)]
gnulib-tool.py: Reorganize code.

* pygnulib/main.py: New file, moved here from gnulib-tool.py.
* pygnulib/constants.py: Change the way APP['name'] and DIRS['root'] are
computed.
* gnulib-tool.py: New file, based on gnulib-tool.

14 months agobitset: Don't access errno when it's not set.
Bruno Haible [Sun, 25 Feb 2024 15:12:57 +0000 (16:12 +0100)]
bitset: Don't access errno when it's not set.

* lib/bitset/stats.c (bitset_stats_read): Don't use errno after neither
fread() nor ferror() has set it. On native Windows, don't use errno
after fclose().

14 months agobitset: Avoid newlines at the end of translatable strings.
Bruno Haible [Sun, 25 Feb 2024 14:48:47 +0000 (15:48 +0100)]
bitset: Avoid newlines at the end of translatable strings.

* lib/bitset/stats.c (bitset_percent_histogram_print,
bitset_log_histogram_print): Print a newline after msg.
(bitset_stats_print_1): Don't include a newline in the argument of
bitset_percent_histogram_print or bitset_log_histogram_print.
(bitset_stats_print): Move newlines outside of translatable strings.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 28.
Collin Funk [Sat, 24 Feb 2024 04:52:15 +0000 (20:52 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 28.

Follow gnulib-tool change
2018-07-17  Paul Eggert  <eggert@cs.ucla.edu>
gnulib-tool: limit line length for git send-email

* pygnulib/GLImport.py (GLImport.actioncmd): Break actioncmd into
multiple lines. Reorder emitting of arguments to match gnulib-tool. Emit
"--witness-c-macro" instead of "--witness_c_macro". Emit "--po-domain"
instead of "--podomain". Document ordering of unimplemented options. Add
updated comments documenting line length limitations of git send-email
and some implementations of AWK.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Remove comment which
was moved to pygnulib/GLImport.py. Remove length limitation on actioncmd
since it now spans multiple lines.

14 months agognulib-tool.py: Further fix last commit.
Bruno Haible [Sat, 24 Feb 2024 23:17:42 +0000 (00:17 +0100)]
gnulib-tool.py: Further fix last commit.

* gnulib-tool.py (main): Make the mode test match for 'create-testdir',
'create-megatestdir', 'test', 'megatest'.

14 months agognulib-tool.py: Fix conditional checking the incorrect variable.
Collin Funk [Sat, 24 Feb 2024 05:12:39 +0000 (21:12 -0800)]
gnulib-tool.py: Fix conditional checking the incorrect variable.

Reported by Bruno Haible <bruno@clisp.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00207.html>.

* gnulib-tool.py (main): Fix incorrect conditional. Check that mode, not
modules, is not None before treating it as a string.

14 months agostriconveha tests: Avoid test failure on macOS 12.5.
Bruno Haible [Sat, 24 Feb 2024 12:56:30 +0000 (13:56 +0100)]
striconveha tests: Avoid test failure on macOS 12.5.

* tests/test-striconveha.c (main): Skip transliteration tests when using
Apple's modified GNU libiconv or the bastard Apple iconv.

14 months agoDEPENDENCIES: Update entry about gperf.
Bruno Haible [Fri, 23 Feb 2024 23:56:18 +0000 (00:56 +0100)]
DEPENDENCIES: Update entry about gperf.

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00201.html>.

* DEPENDENCIES (gperf): Mention some more modules which require 'gperf'.

14 months agounictype/mirror: Update to Unicode 15.1.0, part 2.
Bruno Haible [Fri, 23 Feb 2024 22:41:20 +0000 (23:41 +0100)]
unictype/mirror: Update to Unicode 15.1.0, part 2.

* modules/unictype/mirror (configure.ac): Bump required libunistring
version.

14 months agounictype/mirror: Update to Unicode 15.1.0.
Bruno Haible [Fri, 23 Feb 2024 17:34:08 +0000 (18:34 +0100)]
unictype/mirror: Update to Unicode 15.1.0.

Reported by Daurnimator <quae@daurnimator.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2016-11/msg00010.html>.

* lib/gen-uni-tables.c (struct mirror_pair): New type.
(mirror_pairs): Don't initialize statically.
(mirror_pairs_count): New variable.
(fill_mirror): New function.
(get_mirror_value): Update.
(main): Expect the file name of BidiMirroring.txt as command-line
argument. Invoke fill_mirror.
* lib/unictype/mirror.h: Regenerated.

14 months agogen-uni-tables: Keep line number better up-to-date.
Bruno Haible [Fri, 23 Feb 2024 17:21:46 +0000 (18:21 +0100)]
gen-uni-tables: Keep line number better up-to-date.

* lib/gen-uni-tables.c (fill_width, fill_org_lbp): Increase lineno by 1
when reading a blank line.

14 months agoUpdate gnulib-tool.py.TODO after the last commit.
Bruno Haible [Fri, 23 Feb 2024 13:11:59 +0000 (14:11 +0100)]
Update gnulib-tool.py.TODO after the last commit.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 27.
Collin Funk [Fri, 23 Feb 2024 04:16:18 +0000 (20:16 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 27.

Follow gnulib-tool changes
2017-03-12  Paul Eggert  <eggert@cs.ucla.edu>
gnulib-tool: new option --gnu-make
2017-03-13  Paul Eggert  <eggert@cs.ucla.edu>
gnulib-tool: minor --gnu-make fixups
2017-03-14  Paul Eggert  <eggert@cs.ucla.edu>
gnulib-tool: fix typo in comment output
2017-05-14  Paul Eggert  <eggert@cs.ucla.edu>
gnulib-tool: improve GNU Make debugging
2018-07-04  Paul Eggert  <eggert@cs.ucla.edu>
gnulib-tool: minor tweaks for --gnu-make

* gnulib-tool.py (main): Add --gnu-make option. Do not allow --gnu-make
in test modes, since they all require Automake.
* pygnulib/GLConfig.py: Add gnu_make argument to constructor.
(getGnuMake, setGnuMake, resetGnuMake): New methods for accessing the
gnu_make instance variable.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use the "+=" operator
with GNU Make and Automake. Transform conditionals to GNU Make syntax if
--gnu-make is in use. Use a Autoconf subprocess to define values and
check the return code for errors.
(GLEmiter.tests_Makefile_am): Likewise.
* pygnulib/GLImport.py (GLImport.actioncmd): Add "--gnu-make" to the
output comment if it is in use.
(GLImport.gnulib_comp): Don't require "AM_PROG_CC_C_O" when using GNU
Make.
* pygnulib/GLInfo.py (GLInfo.usage): Update help message to reflect
addition of --gnu-make.
* pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Don't
add Automake snippets as unconditional dependencies when using
--gnu-make.

14 months agounistdio/*printf tests: Update expected test results regarding %n.
Bruno Haible [Fri, 23 Feb 2024 12:07:48 +0000 (13:07 +0100)]
unistdio/*printf tests: Update expected test results regarding %n.

* tests/unistdio/test-u8-printf1.h (test_xfunction): If
NEED_PRINTF_WITH_N_DIRECTIVE is not defined, expect a NULL result in the
%n test.
* tests/unistdio/test-u16-printf1.h (test_xfunction): Likewise.
* tests/unistdio/test-u32-printf1.h (test_xfunction): Likewise.
* tests/unistdio/test-ulc-printf1.h (test_xfunction): Likewise.

14 months agognulib-tool.py: Follow gnulib-tool changes, part 26.
Collin Funk [Thu, 22 Feb 2024 19:27:42 +0000 (11:27 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 26.

Follow gnulib-tool change
2017-04-20  Bruno Haible  <bruno@clisp.org>
verify tests: Fix spurious failure with parallel make.

* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Emit initialization
of EXTRA_PROGRAMS so that the verify-tests module does not cause
Automake to warn about the use of "+=" instead of "=".

14 months agognulib-tool.py: Follow gnulib-tool changes, part 25.
Collin Funk [Thu, 22 Feb 2024 05:32:10 +0000 (21:32 -0800)]
gnulib-tool.py: Follow gnulib-tool changes, part 25.

Follow gnulib-tool change
2017-06-11  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Clean up after autotools.

* pygnulib/GLTestDir.py (GLTestDir.execute): Remove
unnessecary autom4te.cache directory generated by Autotools.
(GLMegaTestDir.execute): Likewise.

14 months agoc-strtof: New module.
Bruno Haible [Thu, 22 Feb 2024 00:52:05 +0000 (01:52 +0100)]
c-strtof: New module.

* lib/c-strtod.h (c_strtof): New declaration.
* lib/c-strtod.c: Support FLOAT.
* lib/c-strtof.c: New file.
* m4/c-strtod.m4 (gl_C_STRTOF): New macro.
* modules/c-strtof: New file.

14 months agoc-strtold: Use strtold_l when available (regr. 2019-01-31).
Bruno Haible [Thu, 22 Feb 2024 00:49:44 +0000 (01:49 +0100)]
c-strtold: Use strtold_l when available (regr. 2019-01-31).

* lib/c-strtod.c: Fix typo: HAVE_GOOD_STRTOLD_L was never defined.

14 months agostrtof: Add tests.
Bruno Haible [Thu, 22 Feb 2024 00:27:30 +0000 (01:27 +0100)]
strtof: Add tests.

* tests/test-strtof.c: New file, based on tests/test-strtod.c.
* tests/test-strtof1.sh: New file, based on tests/test-strtod1.sh.
* tests/test-strtof1.c: New file, based on tests/test-strtod1.c.
* modules/strtof-tests: New file, based on modules/strtod-tests.

14 months agostrtof: New module.
Bruno Haible [Wed, 21 Feb 2024 21:45:47 +0000 (22:45 +0100)]
strtof: New module.

* lib/stdlib.in.h (strtof): New declaration.
* lib/strtod.c: Support USE_FLOAT.
* lib/strtof.c: New file.
* m4/strtof.m4: New file, based on m4/strtod.m4.
* m4/ldexpf.m4 (gl_CHECK_LDEXPF_NO_LIBM): New macro, based on
m4/ldexp.m4.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STRTOF.
* modules/stdlib (Makefile.am): Substitute GNULIB_STRTOF, HAVE_STRTOF,
REPLACE_STRTOF.
* modules/strtof: New file.
* tests/test-stdlib-c++.cc (strtof): Check signature.
* doc/posix-functions/strtof.texi: Mention the new module and the bugs
that it fixes.
(gl_STDLIB_H_DEFAULTS): Initialize HAVE_STRTOF, REPLACE_STRTOF.

14 months agostrtod, strtold tests: Avoid a test failure on native Windows.
Bruno Haible [Wed, 21 Feb 2024 23:47:21 +0000 (00:47 +0100)]
strtod, strtold tests: Avoid a test failure on native Windows.

* modules/strtod-tests (Depends-on): Add setlocale.
* modules/strtold-tests (Depends-on): Likewise.

14 months agognulib-tool.py: Fix undefined variable while emitting testdir.
Collin Funk [Wed, 21 Feb 2024 16:54:51 +0000 (08:54 -0800)]
gnulib-tool.py: Fix undefined variable while emitting testdir.

* pygnulib/GLTestDir.py (GLTestDir.execute): Fix undefined
variable refrence caused by commit
01cd78f9d682ff75cc5ab1c2d21b911bdd9215b8.
Restore the previous auxdir when finished writing the
configure.ac file in the test directory.

14 months ago*printf-posix: Disable support for the 'n' directive by default.
Bruno Haible [Wed, 21 Feb 2024 14:49:23 +0000 (15:49 +0100)]
*printf-posix: Disable support for the 'n' directive by default.

* m4/printf-with-n-directive.m4: New file.
* modules/printf-with-n-directive: New file.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): If
gl_PRINTF_SUPPORT_N_DIRECTIVE is not defined, ignore the value of the
gl_cv_func_printf_directive_n variable.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): If
gl_PRINTF_SUPPORT_N_DIRECTIVE is not defined, ignore the values of the
gl_cv_func_printf_directive_n and gl_cv_func_snprintf_directive_n
variables.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise.
* lib/printf-parse.c (PRINTF_PARSE): If NEED_PRINTF_WITH_N_DIRECTIVE is
not defined, treat the 'n' directive like an unknown directive.
* lib/vasnprintf.c (VASNPRINTF): If NEED_PRINTF_WITH_N_DIRECTIVE is not
defined, disable the processing of the 'n' directive.
* tests/test-snprintf-posix.h (test_function): If
NEED_PRINTF_WITH_N_DIRECTIVE is not defined, skip the %n test.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* doc/posix-functions/dprintf.texi: Mention that support for the 'n'
directive is only enabled together with the module
'printf-with-n-directive'.
* doc/posix-functions/fprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.
* NEWS: Mention the change.

14 months ago*printf-posix: Avoid crash in another configure test.
Bruno Haible [Wed, 21 Feb 2024 11:51:01 +0000 (12:51 +0100)]
*printf-posix: Avoid crash in another configure test.

* m4/printf.m4 (gl_SNPRINTF_DIRECTIVE_N): In the test program, catch the
SIGABRT signal, so that the program does not dump core.

14 months agounimetadata/u-version: Add tests.
Bruno Haible [Wed, 21 Feb 2024 00:02:35 +0000 (01:02 +0100)]
unimetadata/u-version: Add tests.

* tests/unimetadata/test-u-version.c: New file.
* modules/unimetadata/u-version-tests: New file.

14 months agounimetadata/u-version: New module.
Bruno Haible [Tue, 20 Feb 2024 23:59:05 +0000 (00:59 +0100)]
unimetadata/u-version: New module.

* lib/gen-uni-tables.c (output_version): New function.
(main): Invoke it.
* lib/unimetadata/u-version.c: New generated file.
* modules/unimetadata/u-version: New file.

14 months agounimetadata/base: New module.
Bruno Haible [Tue, 20 Feb 2024 23:53:41 +0000 (00:53 +0100)]
unimetadata/base: New module.

* lib/unimetadata.in.h: New file.
* m4/unimetadata_h.m4: New file.
* modules/unimetadata/base: New file.

14 months agomaint.mk: Fix include header typo.
Collin Funk [Tue, 20 Feb 2024 20:16:40 +0000 (12:16 -0800)]
maint.mk: Fix include header typo.

top/maint.mk: Change arpa_inet.h to arpa/inet.h.

14 months ago*printf-posix: Avoid crash in a configure test.
Bruno Haible [Tue, 20 Feb 2024 11:06:37 +0000 (12:06 +0100)]
*printf-posix: Avoid crash in a configure test.

* m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): In the test program, catch the
SIGABRT signal, so that the program does not dump core.

14 months agoautoupdate
Karl Berry [Mon, 19 Feb 2024 15:36:19 +0000 (07:36 -0800)]
autoupdate

14 months agomaint.mk: improve new syntax-check rule
Jim Meyering [Mon, 19 Feb 2024 04:23:28 +0000 (20:23 -0800)]
maint.mk: improve new syntax-check rule

* top/maint.mk (sc_prefer_angle_bracket_headers): Rename from
sc_verify_absolute_include_headers.  Simplify to run a single
invocation of grep, rather than usually many.  Derive a regular
expression matching the selected headers, and warn about any
offending matches via what is usually a single grep invocation.

14 months agognulib-tool.py: Fix function call on incorrect object.
Collin Funk [Mon, 19 Feb 2024 00:52:45 +0000 (16:52 -0800)]
gnulib-tool.py: Fix function call on incorrect object.

* pygnulib/GLImport.py: Call checkInclTestCategory on the
GLConfig member instead of the GLImport object itself.
* pygnulib/__init__.py: Update copyright dates.
* pygnulib/constants.py: Update copyright dates.

14 months agomaint.mk: Add more comments.
Bruno Haible [Sun, 18 Feb 2024 20:34:01 +0000 (21:34 +0100)]
maint.mk: Add more comments.

* top/maint.mk: Reference the Gnulib documentation where suitable.

14 months agomaint.mk: Add syntax-check rule to check for #include syntax.
Collin Funk [Sun, 18 Feb 2024 20:02:33 +0000 (12:02 -0800)]
maint.mk: Add syntax-check rule to check for #include syntax.

* top/maint.mk (sc_verify_absolute_include_headers): New rule
to check for #includes that might cause
-Winclude-next-absolute-path warnings.

14 months agodoc: Mention requirement regarding #include syntax.
Bruno Haible [Sun, 18 Feb 2024 12:17:38 +0000 (13:17 +0100)]
doc: Mention requirement regarding #include syntax.

* doc/gnulib-tool.texi (-I options, Include <config.h>,
Style of #include statements): New subsections.

14 months agoqsort_r-tests: minor visibility cleanup
Paul Eggert [Sun, 18 Feb 2024 07:27:13 +0000 (23:27 -0800)]
qsort_r-tests: minor visibility cleanup

* tests/test-qsort_r.c (cmp): Now static.

14 months agosavedir: work around GCC bug 113963
Paul Eggert [Sun, 18 Feb 2024 05:07:33 +0000 (21:07 -0800)]
savedir: work around GCC bug 113963

* lib/savedir.c: Ignore -Wanalyzer-malloc-leak and
-Wanalyzer-null-dereference.

14 months agoSolaris EOL update
Paul Eggert [Sun, 18 Feb 2024 03:22:18 +0000 (19:22 -0800)]
Solaris EOL update

* doc/solaris-versions: Solaris 11.4 EOL update.  Also mention 11.3.

14 months agomath: More clang -Winclude-next-absolute-path silencing.
Collin Funk [Sat, 17 Feb 2024 10:47:36 +0000 (11:47 +0100)]
math: More clang -Winclude-next-absolute-path silencing.

* lib/math.c: Write #include <math.h> instead of #include "math.h".

Copyright-paperwork-exempt: Yes

14 months agoerror: More clang -Winclude-next-absolute-path silencing.
Bruno Haible [Sat, 17 Feb 2024 10:43:32 +0000 (11:43 +0100)]
error: More clang -Winclude-next-absolute-path silencing.

* modules/error-h (Include): Suggest <error.h>, not "error.h".
* m4/error_h.m4: Write #include <error.h>.

14 months agonstrftime: Optimize module dependencies.
Bruno Haible [Thu, 15 Feb 2024 19:48:59 +0000 (20:48 +0100)]
nstrftime: Optimize module dependencies.

* modules/nstrftime (Depends-on): Remove localename-unsafe. Add
localename-unsafe-limited.

14 months agolocalename-unsafe-limited: New module.
Bruno Haible [Thu, 15 Feb 2024 19:47:28 +0000 (20:47 +0100)]
localename-unsafe-limited: New module.

* m4/localename.m4 (gl_LOCALENAME_UNSAFE_LIMITED): New macro.
* modules/localename-unsafe-limited: New file.
* modules/localename-unsafe (Depends-on): Add localename-unsafe-limited.
(Makefile.am): Compile localename-unsafe.c only if the module
localename-unsafe-limited does not already do it.

14 months agonstrftime, fprintftime: Optimize.
Bruno Haible [Thu, 15 Feb 2024 18:40:45 +0000 (19:40 +0100)]
nstrftime, fprintftime: Optimize.

* lib/strftime.c (should_remove_ampm): Call gl_locale_name_unsafe
instead of gl_locale_name.
* modules/nstrftime (Depends-on): Remove localename. Add
localename-unsafe.

14 months agolocalename-unsafe: Optimize.
Bruno Haible [Thu, 15 Feb 2024 18:34:16 +0000 (19:34 +0100)]
localename-unsafe: Optimize.

* lib/localename-unsafe.c (gl_locale_name_posix_unsafe): Call
setlocale_null_unlocked instead of setlocale_null.
* modules/localename-unsafe (Depends-on): Add setlocale-null-unlocked.

14 months agosetlocale_null-unlocked: Add tests.
Bruno Haible [Thu, 15 Feb 2024 09:32:57 +0000 (10:32 +0100)]
setlocale_null-unlocked: Add tests.

* tests/test-setlocale_null-unlocked.c: New file, based on
tests/test-setlocale_null.c.
* modules/setlocale-null-unlocked-tests: New file.

14 months agosetlocale_null-unlocked: New module.
Bruno Haible [Thu, 15 Feb 2024 09:30:54 +0000 (10:30 +0100)]
setlocale_null-unlocked: New module.

* lib/setlocale_null.h (setlocale_null_r_unlocked,
setlocale_null_unlocked): New declarations.
* lib/setlocale_null-unlocked.c: New file, based on
lib/setlocale_null.c.
* lib/setlocale_null.c: Don't include <wchar.h>.
(setlocale_null_unlocked, setlocale_null_r_unlocked): Remove functions.
* modules/setlocale-null-unlocked: New file.
* modules/setlocale-null (Depends-on): Add setlocale-null-unlocked.

14 months agosetlocale-null: Refactor.
Bruno Haible [Thu, 15 Feb 2024 08:47:08 +0000 (09:47 +0100)]
setlocale-null: Refactor.

* lib/setlocale_null.c
(setlocale_null_r_with_lock): Renamed from setlocale_null_with_lock.
(setlocale_null_r_unlocked): Renamed from setlocale_null_unlocked.
(setlocale_null_unlocked): Renamed from setlocale_null_androidfix.

14 months agolocalename-unsafe: New module.
Bruno Haible [Thu, 15 Feb 2024 18:23:25 +0000 (19:23 +0100)]
localename-unsafe: New module.

* lib/localename.h (gl_locale_name_unsafe, gl_locale_name_thread_unsafe,
gl_locale_name_posix_unsafe): New declarations.
* lib/localename-unsafe.c: New file, based on lib/localename.c.
(gl_locale_name_thread_unsafe): Renamed from gl_locale_name_thread.
(gl_locale_name_posix_unsafe): Renamed from gl_locale_name_posix.
(gl_locale_name_unsafe): Renamed from gl_locale_name.
(struniq): Define only on platforms that need it.
* lib/localename.c: Remove code that was moved to
lib/localename-unsafe.c.
(gl_locale_name_thread): Just call gl_locale_name_thread_unsafe and
struniq.
(gl_locale_name_posix): Just call gl_locale_name_posix_unsafe and
struniq.
* lib/locale.in.h: Test @GNULIB_LOCALENAME_UNSAFE@ instead of
@GNULIB_LOCALENAME@.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_LOCALENAME_UNSAFE instead of GNULIB_LOCALENAME.
* modules/locale (Makefile.am): Substitute GNULIB_LOCALENAME_UNSAFE
instead of GNULIB_LOCALENAME.
* m4/localename.m4 (gl_LOCALENAME_UNSAFE): Renamed from gl_LOCALENAME.
* modules/localename-unsafe: New file, based on modules/localename.
* modules/localename: Greatly simplify.
(Depends-on): Add localename-unsafe.

14 months agolocalename: Refactor.
Bruno Haible [Thu, 15 Feb 2024 16:55:39 +0000 (17:55 +0100)]
localename: Refactor.

* lib/struniq.h: New file, extracted from lib/localename.c.
* lib/localename.c: Include it.
* modules/localename (Files): Add lib/struniq.h.

14 months agolocalename: Speed up lookup of the LC_MESSAGES name on AIX ≥ 7.2.
Bruno Haible [Thu, 15 Feb 2024 15:00:59 +0000 (16:00 +0100)]
localename: Speed up lookup of the LC_MESSAGES name on AIX ≥ 7.2.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): On AIX, test
for the 'locale_name' member.
* lib/localename.c (get_locale_t_name): For the LC_MESSAGES category,
use the 'locale_name' member if available.

14 months agolocalename: Add more comments.
Bruno Haible [Thu, 15 Feb 2024 13:35:53 +0000 (14:35 +0100)]
localename: Add more comments.

* m4/intl-thread-locale.m4: Document expected configuration results.
* doc/posix-functions/uselocale.texi: Update platforms list.
* lib/localename.c: Likewise.

14 months agolocalename: Add parameter validation.
Bruno Haible [Thu, 15 Feb 2024 09:48:50 +0000 (10:48 +0100)]
localename: Add parameter validation.

* lib/localename.c (get_locale_t_name, gl_locale_name_thread_unsafe,
gl_locale_name_thread, gl_locale_name_posix, gl_locale_name): Verify
that the category argument is not LC_ALL.