Bruno Haible [Wed, 25 Dec 2024 18:13:53 +0000 (19:13 +0100)]
xprintf, xprintf-posix, xprintf-gnu: Use *zprintf.
* lib/xprintf.h (xprintf, xvprintf, xfprintf, xvfprintf): Change return
type to off64_t. Move documentation from xprintf.c to here. Mention
EOVERFLOW as another possible error unrelated to file I/O.
* lib/xprintf.c (xprintf): Change return type to off64_t.
(xvprintf): Likewise. Use vzprintf.
(xfprintf): Change return type to off64_t.
(xvfprintf): Likewise. Use vfzprintf.
* modules/xprintf (Description): Mention also fprintf. Mention EOVERFLOW
as another possible error unrelated to file I/O.
(Depends-on): Add vzprintf, vfzprintf.
* modules/xprintf-posix (Description): Mention also fprintf. Mention
EOVERFLOW as another possible error unrelated to file I/O.
(Depends-on): Add vzprintf-posix, vfzprintf-posix. Remove vprintf-posix,
vfprintf-posix.
* modules/xprintf-gnu (Description): Mention also fprintf. Mention
EOVERFLOW as another possible error unrelated to file I/O.
(Depends-on): Add vzprintf-gnu, vfzprintf-gnu. Remove vprintf-gnu,
vfprintf-gnu.
* tests/test-xprintf-posix.c (RETTYPE): Change to off64_t.
* tests/test-xfprintf-posix.c (RETTYPE): Likewise.
* NEWS: Document the change.
Bruno Haible [Wed, 25 Dec 2024 00:34:23 +0000 (01:34 +0100)]
access, euidaccess tests: Avoid test failure in Cygwin 3.5.5.
* tests/test-access.h [__CYGWIN__]: Include <grp.h>, <string.h>,
<unistd.h>.
(is_administrator): New function.
(is_root): New macro.
(test_access): Reenable F_OK test for non-administrators on Cygwin.
Disable X_OK test for administrators on Cygwin.
Paul Eggert [Tue, 24 Dec 2024 21:41:04 +0000 (13:41 -0800)]
stdlib: support including stdlib.h from config.h
Emacs <config.h> includes <stdlib.h> in some situations, causing
problems on macOS as described by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2024-12/msg00923.html
Although this usage is not recommended, it is easier to support
it for POSIX-required headers, than to fix Emacs.
* doc/extern-inline.texi (extern inline): Document the Emacs problem.
* lib/endian.c, lib/math.c, lib/stdbit.c, lib/stdlib.c:
* lib/sys_socket.c, lib/unistd.c, lib/wctype-h.c:
Define #define _GL_..._INLINE to _GL_EXTERN_INLINE
before including <config.h>, not merely before including
the .h file that defines the inline function.
Bruno Haible [Tue, 24 Dec 2024 10:22:40 +0000 (11:22 +0100)]
threads-h: Support several gnulib-tool invocations better.
* lib/threads.in.h (_GL_ALREADY_INCLUDING_THREADS_H): Rename to a macro
that depends on GUARD_PREFIX.
(struct thrd_with_exitcode): Avoid duplicate definition.
Bruno Haible [Tue, 24 Dec 2024 10:21:51 +0000 (11:21 +0100)]
sys_socket: Support several gnulib-tool invocations better.
* lib/sys_socket.in.h (_GL_ALREADY_INCLUDING_SYS_SOCKET_H): Rename to a
macro that depends on GUARD_PREFIX.
(struct msghdr): Avoid duplicate definition.
Bruno Haible [Tue, 24 Dec 2024 10:19:49 +0000 (11:19 +0100)]
stdio: Support several gnulib-tool invocations better.
* lib/stdio.in.h: Test _GL_SKIP_GNULIB_STDIO_H.
(_GL_ALREADY_INCLUDING_STDIO_H): Rename to a macro that depends on
GUARD_PREFIX.
* lib/fopen.c: Set _GL_SKIP_GNULIB_STDIO_H instead of
_GL_ALREADY_INCLUDING_STDIO_H.
* lib/freopen.c: Likewise.
Paul Eggert [Mon, 23 Dec 2024 20:57:12 +0000 (12:57 -0800)]
stdlib: fix MB_CUR_MAX on older Android
Android NDK r16 MB_CUR_MAX doesn’t link when compiling C.
Problem found in GNU Emacs, which worked around it this way:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=39a7e6b79fdeafc539a36f6831d922a2622cb679
... but this ran afoul of the recent Gnulib change that
added lib/stdlib.c.
* lib/stdlib.in.h (gl_MB_CUR_MAX): If @REPLACE_MB_CUR_MAX@
is positive, use its value directly.
* m4/stdlib_h.m4 (gl_STDLIB_H): Set REPLACE_MB_CUR_MAX to (-1)
if the Solaris bug, and to 4 if the Android bug. Use AS_CASE
so that Emacs can navigate this code better.
* tests/test-stdlib.c (main): Check that MB_CUR_MAX compiles
and is nonzero.
Bruno Haible [Mon, 23 Dec 2024 15:59:20 +0000 (16:59 +0100)]
mbrtowc tests: Test in the UTF-8 environment on native Windows.
* tests/test-mbrtowc-w32utf8.sh: New file.
* tests/test-mbrtowc-w32utf8.c: New file.
* modules/mbrtowc-tests (Files): Add these files and
m4/windows-rc.m4, tests/windows-utf8.rc, tests/windows-utf8.manifest.
(Depends-on): Add test-xfail.
(configure.ac): Invoke gl_WINDOWS_RC.
(Makefile.am): Arrange to compile test-mbrtowc-w32utf8 and run
test-mbrtowc-w32utf8.sh.
Bruno Haible [Mon, 23 Dec 2024 15:58:53 +0000 (16:58 +0100)]
setlocale tests: Test in the UTF-8 environment on native Windows.
* tests/test-setlocale-w32utf8.sh: New file.
* tests/test-setlocale-w32utf8.c: New file.
* modules/setlocale-tests (Files): Add these files and
m4/windows-rc.m4, tests/windows-utf8.rc, tests/windows-utf8.manifest.
(Depends-on): Add test-xfail.
(configure.ac): Invoke gl_WINDOWS_RC.
(Makefile.am): Arrange to compile test-setlocale-w32utf8 and run
test-setlocale-w32utf8.sh.
Bruno Haible [Mon, 23 Dec 2024 15:57:15 +0000 (16:57 +0100)]
setlocale: Support the UTF-8 environment on native Windows.
* lib/setlocale.c: Include <windows.h>.
(setlocale_unixlike): In the UTF-8 environment, append a suffix ".65001"
to the locale names passed to the native setlocale().
Bruno Haible [Mon, 23 Dec 2024 15:57:02 +0000 (16:57 +0100)]
localename tests: Test in the UTF-8 environment on native Windows.
* tests/test-localename-w32utf8.sh: New file.
* tests/test-localename-w32utf8.c: New file.
* modules/localename-tests (Files): Add these files and
m4/windows-rc.m4, tests/windows-utf8.rc, tests/windows-utf8.manifest.
(Depends-on): Add test-xfail.
(configure.ac): Invoke gl_WINDOWS_RC.
(Makefile.am): Arrange to compile test-localename-w32utf8 and run
test-localename-w32utf8.sh.
Bruno Haible [Mon, 23 Dec 2024 15:56:37 +0000 (16:56 +0100)]
localcharset tests: Test in the UTF-8 environment on native Windows.
* m4/windows-rc.m4: New file.
* tests/test-localcharset-w32utf8.sh: New file.
* tests/test-localcharset-w32utf8.c: New file.
* tests/windows-utf8.rc: New file.
* tests/windows-utf8.manifest: New file.
* modules/localcharset-tests (Files): Add these files.
(Depends-on): Add test-xfail.
(configure.ac): Invoke gl_WINDOWS_RC.
(Makefile.am): Arrange to compile test-localcharset-w32utf8 and run
test-localcharset-w32utf8.sh.
Bruno Haible [Sun, 22 Dec 2024 11:03:22 +0000 (12:03 +0100)]
test-framework-sh: Avoid test suite failures on MSYS2.
* tests/init.sh (compare_) [MSys]: Use a temporary file on MSYS2.
* tests/test-update-copyright.sh: Use the test framework.
(compare): Remove function.
* modules/update-copyright-tests (Depends-on): Add test-framework-sh.
Bruno Haible [Sun, 22 Dec 2024 03:38:48 +0000 (04:38 +0100)]
execl, execle, execlp: Fix compilation error with gcc 14.
* lib/execl.c (execl): Cast second argument of execv.
* lib/execle.c (execle): Cast second argument of execve.
* lib/execlp.c (execlp): Cast second argument of execvp.
Bruno Haible [Sun, 22 Dec 2024 00:09:17 +0000 (01:09 +0100)]
crc-x86_64: Fix compilation error with clang in a simpler way.
Suggested by Collin Funk.
* modules/crc-x86_64 (Makefile.am): Revert last change.
* lib/crc-x86_64-pclmul.c: Normalize includes.
(crc32_update_no_xor_pclmul): Use __attribute__ ((__target (...))).
* m4/crc-x86_64.m4 (gl_CRC_X86_64_PCLMUL): Use
__attribute__ ((__target (...))) here as well. Don't use modified
CFLAGS.
Pádraig Brady [Wed, 18 Dec 2024 12:53:02 +0000 (12:53 +0000)]
crc-x86_64: fix build failure due to indentation
* modules/crc-x86_64: Remove indentation on lib_SOURCES,
as otherwise it's replaced with libcoreutils_a_SOURCES
rather than the required lib_libcoreutils_a_SOURCES, resulting in:
lib/gnulib.mk:1090: error: libcoreutils_a_SOURCES must be set with '=' before using '+='
lib/gnulib.mk:1090: warning: variable 'libcoreutils_a_SOURCES' is defined but no program or
lib/gnulib.mk:1090: library has 'libcoreutils_a' as canonical name (possible typo)
Sam Russell [Tue, 17 Dec 2024 07:49:50 +0000 (08:49 +0100)]
crc: Add PCLMUL implementation
* lib/crc-x86_64-pclmul.c: Implement CRC32 with PCLMUL intrinsics.
* lib/crc-x86_64.h: Add header for CRC32 with PCLMUL instrinsics.
* lib/crc.c: Use PCLMUL implementation if available.
* m4/crc-x86_64.m4: Detect PCLMUL and build accordingly.
* modules/crc-x86_64: New module for crc-x86_64.
Signed-off-by: Simon Josefsson <simon@josefsson.org>
Paul Eggert [Wed, 11 Dec 2024 20:17:18 +0000 (12:17 -0800)]
doc: isdigit and isxdigit are locale-independent
* doc/posix-functions/isdigit.texi:
* doc/posix-functions/isxdigit.texi:
Document that mingw and MSVC do not conform to the C standard,
which says that isdigit and isxdigit are independent of locale.
Issue pointed out by Florian Weimer in:
https://sourceware.org/pipermail/libc-alpha/2024-December/162362.html
Bruno Haible [Mon, 9 Dec 2024 12:31:23 +0000 (13:31 +0100)]
unicodeio: Use the translation domain "gnulib".
* lib/unicodeio.h (unicode_to_mb): Clarify that the message passed to
the failure callback may already be localized.
* lib/unicodeio.c (unicode_to_mb): For the messages defined in this
file, use the translation domain "gnulib".
Bruno Haible [Mon, 9 Dec 2024 12:18:21 +0000 (13:18 +0100)]
Localizations: Fix omissions from the POT file.
Reported by Benno Schulenberg.
* po/Makefile ($(DOMAIN).pot): Remove the file pre-filtering; just pass
all source files to xgettext.
* po/Makevars (XGETTEXT_OPTIONS): Recognize gettext_noop as a keyword.
Bruno Haible [Mon, 9 Dec 2024 08:51:01 +0000 (09:51 +0100)]
quotearg tests: Fix test failure (regression yesterday).
* tests/testlocale/fr/LC_MESSAGES/gnulib.po: Renamed from
tests/testlocale/fr/LC_MESSAGES/test-quotearg.po.
* tests/testlocale/fr/LC_MESSAGES/gnulib.mo: Renamed from
tests/testlocale/fr/LC_MESSAGES/test-quotearg.mo.
* tests/test-quotearg.c (main): Use bindtextdomain for the domain
"gnulib", not "test-quotearg".
* tests/test-quotearg.sh: Fix typo in comments.
* modules/quotearg-tests (Files): Update.
Bruno Haible [Sun, 8 Dec 2024 17:15:49 +0000 (18:15 +0100)]
Document the new approach for gnulib localization.
* doc/gnulib-tool.texi (Localization): Recommend to use the gnulib-l10n
package. Deprecate the two previous approaches.
* gnulib-tool.sh (func_usage): Deprecate the --po-base and --po-domain
options.
* pygnulib/GLInfo.py (GLInfo.usage): Likewise.
Bruno Haible [Sun, 8 Dec 2024 16:40:53 +0000 (17:40 +0100)]
Add infrastructure for handling gnulib localizations.
* po/Makefile: New file.
* po/Makevars: New file, based on the template from GNU gettext.
* gnulib-l10n/README: New file.
* gnulib-l10n/configure.ac: New file.
* gnulib-l10n/Makefile.am: New file.
* gnulib-l10n/m4/Makefile.am: New file.
* gnulib-l10n/autogen.sh: New file.
* gnulib-l10n/autoclean.sh: New file.
* Makefile (gnulib.pot, gnulib-tp-snapshot, gnulib-l10n-release): New
targets.
Bruno Haible [Sun, 8 Dec 2024 16:13:00 +0000 (17:13 +0100)]
bison-i18n: Improve usability.
* modules/bison-i18n (Depends-on): Remove 'gettext'.
* m4/bison-i18n.m4 (BISON_I18N): Instead of bailing out if there is no
AM_GNU_GETTEXT invocation, just warn. Define BISON_LOCALEDIR also in
config.h, removing the need to do it in the Makefile.
Bruno Haible [Fri, 6 Dec 2024 08:16:37 +0000 (09:16 +0100)]
Update build-aux/po/Makefile.in.in.
Reported by Assaf Gordon in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00045.html>
and by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00020.html>.
* build-aux/po/Makefile.in.in: Sync from GNU gettext 0.23.
Fixes:
- Don't fail when 'make' is used with option -j.
- Pass the option --quiet to 'msgmerge'.
- Simplify by assuming that 'sed' groks comments.
* build-aux/po/remove-potcdate.sed: Renamed from
build-aux/po/remove-potcdate.sin.
* doc/gnulib.texi (Developer tools): Update file list.
* gnulib-tool.sh (func_import): Copy remove-potcdate.sed instead of
remove-potcdate.sin.
* pygnulib/GLImport.py (GLImport.execute): Likewise.