]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agoAvoid some Autoconf "was expanded before it was required" warnings.
Bruno Haible [Sun, 23 Apr 2023 01:29:28 +0000 (03:29 +0200)]
Avoid some Autoconf "was expanded before it was required" warnings.

* m4/locale-ar.m4 (gt_LOCALE_AR): Define through AC_DEFUN_ONCE.
* m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
* m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.

2 years agostring-desc tests: Avoid test failure on native Windows.
Bruno Haible [Sat, 22 Apr 2023 15:38:28 +0000 (17:38 +0200)]
string-desc tests: Avoid test failure on native Windows.

* tests/test-string-desc.c: Include <fcntl.h>, <unistd.h>.
(main): Expect a file name argument. Write to this file, instead of to
fd 3.
* tests/test-string-desc.sh: Pass a file name as argument, instead of
using '3>'.
* modules/string-desc-tests (Depends-on): Add close.

2 years agothreadlib, pthread-h, threads-h: Avoid mingw's libwinpthread by default.
Bruno Haible [Sat, 22 Apr 2023 13:10:31 +0000 (15:10 +0200)]
threadlib, pthread-h, threads-h: Avoid mingw's libwinpthread by default.

* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Set
gl_use_winpthreads_default to 'no' by default.
(gl_AVOID_WINPTHREAD): Update comments.

2 years agoposixtm tests: Avoid test failure on native Windows.
Bruno Haible [Sat, 22 Apr 2023 11:56:55 +0000 (13:56 +0200)]
posixtm tests: Avoid test failure on native Windows.

* tests/test-posixtm.c (T): On native Windows, disable test cases that
would fail.

2 years agodfa tests: Fix test failure on mingw differently.
Bruno Haible [Sat, 22 Apr 2023 11:47:15 +0000 (13:47 +0200)]
dfa tests: Fix test failure on mingw differently.

Suggested by Paul Eggert.

* tests/test-dfa-invalid-char-class.sh: Revert last change.
* tests/test-dfa-match-aux.c: Include binary-io.h.
(main): Put stdout into binary mode.
* modules/dfa-tests (Depends-on): Add binary-io.

2 years agogetumask: Make it work on native Windows.
Bruno Haible [Thu, 20 Apr 2023 21:21:42 +0000 (23:21 +0200)]
getumask: Make it work on native Windows.

* lib/getumask.c (getumask): When TMPDIR is unset, try TMP and TEMP.
* tests/test-getumask.c (ASSUME_UMASK_CONSTANT): Define to 1 on native
Windows.

2 years agoposixtm tests: Fix link error.
Bruno Haible [Thu, 20 Apr 2023 18:02:13 +0000 (20:02 +0200)]
posixtm tests: Fix link error.

* modules/posixtm-tests (Depends-on): Add stpcpy.

2 years agoreadtokens tests: Fix test failure on mingw.
Bruno Haible [Thu, 20 Apr 2023 17:03:27 +0000 (19:03 +0200)]
readtokens tests: Fix test failure on mingw.

* tests/test-readtokens.sh: Transform CRLF to LF in the output, before
comparing with the expected output.

2 years agoparse-duration tests: Fix test failure on mingw.
Bruno Haible [Thu, 20 Apr 2023 16:51:48 +0000 (18:51 +0200)]
parse-duration tests: Fix test failure on mingw.

* tests/test-parse-duration.sh: Transform CRLF to LF in the output,
before analyzing the output.

2 years agodfa tests: Fix test failure on mingw.
Bruno Haible [Thu, 20 Apr 2023 16:39:33 +0000 (18:39 +0200)]
dfa tests: Fix test failure on mingw.

* tests/test-dfa-invalid-char-class.sh: Transform CRLF to LF in the
output, before comparing with the expected output.

2 years agoFix uses of libwinpthread on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 14:40:20 +0000 (16:40 +0200)]
Fix uses of libwinpthread on mingw 10.

* m4/threadlib.m4 (gl_WEAK_SYMBOLS): On mingw, set the result to
"guessing no".

2 years agoMove remaining call_once tests from mtx-tests to call_once-tests.
Bruno Haible [Thu, 20 Apr 2023 12:21:09 +0000 (14:21 +0200)]
Move remaining call_once tests from mtx-tests to call_once-tests.

* tests/test-call_once1.c: Renamed from tests/test-call_once.c.
* tests/test-call_once2.c: New file, based on tests/test-mtx.c.
* tests/test-mtx.c: Remove the code that was testing call_once.
* modules/call_once-tests (Files): Add test-call_once1.c,
test-call_once2.c. Remove test-call_once.c.
(Depends-on): Add thrd, lock, stdint.
(configure.ac): Check for alarm.
(Makefile.am): Test test-call_once1 instead of test-call_once. Also test
test-call_once2.

2 years agoexecute tests: Fix compilation error on mingw (regression 2023-01-17).
Bruno Haible [Thu, 20 Apr 2023 11:23:52 +0000 (13:23 +0200)]
execute tests: Fix compilation error on mingw (regression 2023-01-17).

* tests/test-execute-main.c (main): Don't use SIGPIPE if it's not
defined.

2 years agoassert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.
Bruno Haible [Thu, 20 Apr 2023 06:42:56 +0000 (08:42 +0200)]
assert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.

* lib/verify.h (_Static_assert): In C++ mode with MSVC 14.1 or newer,
define merely to static_assert.
(static_assert): In C++ mode with MSVC 14.1 or newer, don't define.

2 years agochown, lchown tests: Fix link error on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:51:43 +0000 (02:51 +0200)]
chown, lchown tests: Fix link error on mingw 10.

* modules/chown-tests (configure.ac): Test whether getgid() exists.
* modules/lchown-tests (configure.ac): Likewise.
* modules/fchownat-tests (configure.ac): Likewise.
* tests/test-chown.h (getgid): Define a fallback.
* tests/test-lchown.h (getgid): Likewise.

2 years agochown tests: Fix link error on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:29:26 +0000 (02:29 +0200)]
chown tests: Fix link error on mingw 10.

* modules/chown-tests (configure.ac): Test whether getgid() exists.
* modules/fchownat-tests (configure.ac): Likewise.
* tests/test-chown.h (getgid): Define a fallback.

2 years agoctime: Fix compilation errors in C++ mode on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:18:59 +0000 (02:18 +0200)]
ctime: Fix compilation errors in C++ mode on mingw 10.

* lib/c++defs.h (_GL_FUNCDECL_RPL): Add a comment.
* lib/time.in.h (ctime): Don't use _GL_ATTRIBUTE_DEPRECATED before
_GL_FUNCDECL_RPL in C++ mode.

2 years agorandom: Fix compilation errors in C++ on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:03:43 +0000 (02:03 +0200)]
random: Fix compilation errors in C++ on mingw 10.

* lib/stdlib.in.h (random, srandom): Disable _GL_CXXALIASWARN invocation
on non-glibc systems.

2 years agoyear2038-required: Fix configure failure with MSVC.
Bruno Haible [Wed, 19 Apr 2023 21:20:54 +0000 (14:20 -0700)]
year2038-required: Fix configure failure with MSVC.

* m4/largefile.m4 (_AC_SYS_LARGEFILE_PROBE): Distinguish the results
"support not detected" and "supported through gnulib". If the result is
"supported through gnulib", don't fail.

2 years agodoc: Add references to changes accepted for future POSIX revisions.
Bruno Haible [Wed, 19 Apr 2023 18:07:52 +0000 (20:07 +0200)]
doc: Add references to changes accepted for future POSIX revisions.

* doc/glibc-functions/bind_textdomain_codeset.texi: Add reference to
www.austingroupbugs.net issue.
* doc/glibc-functions/bindtextdomain.texi: Likewise.
* doc/glibc-functions/dcgettext.texi: Likewise.
* doc/glibc-functions/dcngettext.texi: Likewise.
* doc/glibc-functions/dgettext.texi: Likewise.
* doc/glibc-functions/dngettext.texi: Likewise.
* doc/glibc-functions/getentropy.texi: Likewise.
* doc/glibc-functions/getresgid.texi: Likewise.
* doc/glibc-functions/getresuid.texi: Likewise.
* doc/glibc-functions/gettext.texi: Likewise.
* doc/glibc-functions/ngettext.texi: Likewise.
* doc/glibc-functions/posix_spawn_file_actions_addchdir_np.texi:
Likewise.
* doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi:
Likewise.
* doc/glibc-functions/setresgid.texi: Likewise.
* doc/glibc-functions/setresuid.texi: Likewise.
* doc/glibc-functions/textdomain.texi: Likewise.
* doc/posix-functions/asctime_r.texi: Likewise.
* doc/posix-functions/ctime_r.texi: Likewise.

2 years agowcsncmp: Add tests.
Bruno Haible [Wed, 19 Apr 2023 15:59:58 +0000 (17:59 +0200)]
wcsncmp: Add tests.

* tests/test-wcsncmp.c: New file, based on tests/unistr/test-strncmp.h
and tests/test-wcscmp.c.
* modules/wcsncmp-tests: New file.

2 years agowcsncmp: Work around two ISO C compliance bugs on several platforms.
Bruno Haible [Wed, 19 Apr 2023 15:59:03 +0000 (17:59 +0200)]
wcsncmp: Work around two ISO C compliance bugs on several platforms.

* lib/wchar.in.h (wcsncmp): Consider REPLACE_WCSNCMP.
* lib/wcsncmp-impl.h (wcsncmp): Don't assume that the two wide
characters are in the range 0..INT_MAX.
* m4/wcsncmp.m4 (gl_FUNC_WCSNCMP): Test whether wcsncmp works for all
wide characters. Set REPLACE_WCSNCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSNCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WCSNCMP.
* modules/wcsncmp (Status, Notice): Un-obsolete this module.
(configure.ac): Consider REPLACE_WCSNCMP.
* doc/posix-functions/wcsncmp.texi: Mention the two bugs.

2 years agowcscmp: Add tests.
Bruno Haible [Wed, 19 Apr 2023 00:14:44 +0000 (02:14 +0200)]
wcscmp: Add tests.

* tests/test-wcscmp.c: New file, based on tests/unistr/test-strcmp.h.
* modules/wcscmp-tests: New file.

2 years agowcscmp: Work around two ISO C compliance bugs on several platforms.
Bruno Haible [Wed, 19 Apr 2023 00:14:09 +0000 (02:14 +0200)]
wcscmp: Work around two ISO C compliance bugs on several platforms.

* lib/wchar.in.h (wcscmp): Consider REPLACE_WCSCMP.
* lib/wcscmp-impl.h (wcscmp): Don't assume that the two wide characters
are in the range 0..INT_MAX.
* m4/wcscmp.m4 (gl_FUNC_WCSCMP): Test whether wcscmp works for all wide
characters. Set REPLACE_WCSCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WCSCMP.
* modules/wcscmp (Status, Notice): Un-obsolete this module.
(configure.ac): Consider REPLACE_WCSCMP.
* doc/posix-functions/wcscmp.texi: Mention the two bugs.

2 years agowmemcmp: Add tests.
Bruno Haible [Wed, 19 Apr 2023 00:10:23 +0000 (02:10 +0200)]
wmemcmp: Add tests.

* tests/test-wmemcmp.c (main): Add comment.

2 years agowmemcmp: Add tests.
Bruno Haible [Tue, 18 Apr 2023 23:10:32 +0000 (01:10 +0200)]
wmemcmp: Add tests.

* tests/test-wmemcmp.c: New file, based on tests/unistr/test-cmp.h.
* modules/wmemcmp-tests: New file.

2 years agowmemcmp: Work around ISO C compliance bug on several platforms.
Bruno Haible [Tue, 18 Apr 2023 23:01:56 +0000 (01:01 +0200)]
wmemcmp: Work around ISO C compliance bug on several platforms.

* lib/wchar.in.h (wmemcmp): Consider REPLACE_WMEMCMP.
* lib/wmemcmp-impl.h (wmemcmp): Don't assume that the two wide
characters are in the range 0..INT_MAX.
* m4/wmemcmp.m4 (gl_FUNC_WMEMCMP): Test whether wmemcmp works for all
wide characters. Set REPLACE_WMEMCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WMEMCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WMEMCMP.
* modules/wmemcmp (configure.ac): Consider REPLACE_WMEMCMP.
* doc/posix-functions/wmemcmp.texi: Mention the bug.

2 years agodoc: Update platform list for posix_spawnp.
Bruno Haible [Tue, 18 Apr 2023 22:17:15 +0000 (00:17 +0200)]
doc: Update platform list for posix_spawnp.

* doc/posix-functions/posix_spawnp.texi: Update platform list.

2 years agoGo back to dynamic largefile, year2038 tests
Paul Eggert [Tue, 18 Apr 2023 21:25:09 +0000 (14:25 -0700)]
Go back to dynamic largefile, year2038 tests

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2023-04/msg00134.html
* modules/largefile-tests, modules/year2038-tests (Depends-on):
Remove assert-h.
* tests/test-largefile.c, tests/test-year2038.c:
Test dynamically, not via static_assert.

2 years agodoc: mention when O_* defaults to 0
Paul Eggert [Tue, 18 Apr 2023 20:59:32 +0000 (13:59 -0700)]
doc: mention when O_* defaults to 0

* doc/posix-headers/fcntl.texi: Document in more detail which O_*
macros default to 0 in Gnulib.

2 years agodoc: Mention a Cygwin 3.4.6 bug.
Bruno Haible [Tue, 18 Apr 2023 13:01:22 +0000 (15:01 +0200)]
doc: Mention a Cygwin 3.4.6 bug.

* doc/posix-functions/readlinkat.texi: Mention a readlinkat bug on
Cygwin < 3.4.7.

2 years agoilogbl: Work around a Cygwin 3.4.6 bug.
Bruno Haible [Tue, 18 Apr 2023 11:24:42 +0000 (13:24 +0200)]
ilogbl: Work around a Cygwin 3.4.6 bug.

* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Also test the value of
ilogbl(NaN).
* doc/posix-functions/ilogbl.texi: Mention the new Cygwin bug.

2 years agofile-has-acl tests: Avoid test failures on Cygwin 3.4.6.
Bruno Haible [Tue, 18 Apr 2023 10:53:22 +0000 (12:53 +0200)]
file-has-acl tests: Avoid test failures on Cygwin 3.4.6.

* tests/test-file-has-acl.sh: Fix distinction between Linux setfacl and
Cygwin setfacl.

2 years agoc32isgraph: Avoid test failure on Cygwin 3.4.6.
Bruno Haible [Tue, 18 Apr 2023 07:51:21 +0000 (09:51 +0200)]
c32isgraph: Avoid test failure on Cygwin 3.4.6.

* tests/test-c32isgraph.c (main): Skip U+00A0 test on Cygwin.

2 years agoSlightly nicer largefile, year2038 tests
Paul Eggert [Mon, 17 Apr 2023 15:44:51 +0000 (08:44 -0700)]
Slightly nicer largefile, year2038 tests

* modules/largefile-tests, modules/year2038-tests (Depends-on):
Add assert-h, intprops.
* tests/test-largefile.c, tests/test-year2038.c:
Prefer compile-time to run-time tests.
Don’t assume CHAR_BIT == 8.

2 years agoMODULES.html.sh: Ensure hyperlinked files are displayable.
Bruno Haible [Mon, 17 Apr 2023 11:41:57 +0000 (13:41 +0200)]
MODULES.html.sh: Ensure hyperlinked files are displayable.

* MODULES.html.sh (repo_url_prefix): Use cgit instead of gitweb.

2 years agoMODULES.html.sh: Avoid a HTTP redirect.
Bruno Haible [Mon, 17 Apr 2023 11:07:28 +0000 (13:07 +0200)]
MODULES.html.sh: Avoid a HTTP redirect.

* MODULES.html.sh (repo_url_prefix): Use the unabbreviated name of the
git repository server.

2 years agoyear2038: Add tests.
Bruno Haible [Sun, 16 Apr 2023 21:35:47 +0000 (23:35 +0200)]
year2038: Add tests.

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

2 years agolargefile: Add tests.
Bruno Haible [Sun, 16 Apr 2023 21:30:36 +0000 (23:30 +0200)]
largefile: Add tests.

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

2 years agoyear2038: Revert the added module dependencies.
Bruno Haible [Sun, 16 Apr 2023 15:44:42 +0000 (17:44 +0200)]
year2038: Revert the added module dependencies.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00117.html>.

* modules/year2038 (Depends-on): Remove sched, sys_msg, sys_select,
sys_sem, sys_shm, sys_stat, sys_time, sys_types, time-h, utime-h.

2 years agoposix_spawn_file_actions_addclose tests: Avoid test failure on Cygwin.
Bruno Haible [Sun, 16 Apr 2023 11:41:17 +0000 (13:41 +0200)]
posix_spawn_file_actions_addclose tests: Avoid test failure on Cygwin.

* tests/test-posix_spawn_file_actions_addclose.c (main): Skip an
unportable test also on Cygwin.

2 years agoFix compilation errors of list, set, oset, map, omap in C++ mode.
Bruno Haible [Sat, 15 Apr 2023 16:05:57 +0000 (18:05 +0200)]
Fix compilation errors of list, set, oset, map, omap in C++ mode.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_BRACKET_BEFORE_ATTRIBUTE. In _GL_ATTRIBUTE_DEPRECATED,
_GL_ATTRIBUTE_MAYBE_UNUSED, _GL_ATTRIBUTE_NODISCARD, don't use the
bracket syntax if _GL_BRACKET_BEFORE_ATTRIBUTE is defined.

2 years agoDon't include module 'year2038-required' in all-of-gnulib testdirs.
Bruno Haible [Sat, 15 Apr 2023 14:55:34 +0000 (16:55 +0200)]
Don't include module 'year2038-required' in all-of-gnulib testdirs.

* all-modules (exclude): Add year2038-required.

2 years agoselinux-h: Fix compilation error (regression 2023-04-13).
Bruno Haible [Sat, 15 Apr 2023 11:44:34 +0000 (13:44 +0200)]
selinux-h: Fix compilation error (regression 2023-04-13).

* m4/selinux-selinux-h.m4 (gl_HEADERS_SELINUX_SELINUX_H): Instead of
defining the C macro HAVE_SELINUX_SELINUX_H to 0, set the Autoconf
variable HAVE_SELINUX_SELINUX_H to 0.

2 years ago* ChangeLog: fix year2038 wording
Paul Eggert [Sat, 15 Apr 2023 05:02:35 +0000 (22:02 -0700)]
* ChangeLog: fix year2038 wording

2 years agoyear2038: Fix configure failure on 32-bit mingw.
Bruno Haible [Sat, 15 Apr 2023 04:57:37 +0000 (21:57 -0700)]
year2038: Fix configure failure on 32-bit mingw.

* m4/largefile.m4 (_AC_SYS_YEAR2038_PROBE): Use the same option
spelling as in _AC_SYS_YEAR2038_OPTIONS.

2 years agoisnan: Fix compilation error in C++ mode on FreeBSD 13.2.
Bruno Haible [Fri, 14 Apr 2023 22:46:57 +0000 (00:46 +0200)]
isnan: Fix compilation error in C++ mode on FreeBSD 13.2.

* lib/math.in.h (isnan): On FreeBSD 13.2 or newer, don't declare isnan
through _GL_MATH_CXX_REAL_FLOATING_DECL_2.

2 years agofilemode: Fix double-inclusion guard.
Bruno Haible [Fri, 14 Apr 2023 17:23:19 +0000 (19:23 +0200)]
filemode: Fix double-inclusion guard.

* lib/filemode.h: Make the double-inclusion guard actually work.

2 years agoyear2038: Add reminder to include <config.h> before time_t gets defined.
Bruno Haible [Fri, 14 Apr 2023 10:52:25 +0000 (12:52 +0200)]
year2038: Add reminder to include <config.h> before time_t gets defined.

* lib/sched.in.h: Check that config.h was already included before the
* lib/sys_select.in.h: Likewise.
* lib/sys_stat.in.h: Likewise.
* lib/sys_time.in.h: Likewise.
* lib/sys_types.in.h: Likewise.
* lib/time.in.h: Likewise.
* lib/utime.in.h: Likewise.
* modules/year2038 (Depends-on): Add sched, sys_msg, sys_select,
sys_sem, sys_shm, sys_stat, sys_time, sys_types, time-h, utime-h.

2 years agosys_shm: New module.
Bruno Haible [Fri, 14 Apr 2023 10:48:46 +0000 (12:48 +0200)]
sys_shm: New module.

* lib/sys_shm.in.h: New file.
* m4/sys_shm_h.m4: New file.
* modules/sys_shm: New file.
* doc/posix-headers/sys_shm.texi: Mention the new module.

2 years agosys_sem: New module.
Bruno Haible [Fri, 14 Apr 2023 10:48:01 +0000 (12:48 +0200)]
sys_sem: New module.

* lib/sys_sem.in.h: New file.
* m4/sys_sem_h.m4: New file.
* modules/sys_sem: New file.
* doc/posix-headers/sys_sem.texi: Mention the new module.

2 years agosys_msg: New module.
Bruno Haible [Fri, 14 Apr 2023 10:47:03 +0000 (12:47 +0200)]
sys_msg: New module.

* lib/sys_msg.in.h: New file.
* m4/sys_msg_h.m4: New file.
* modules/sys_msg: New file.
* doc/posix-headers/sys_msg.texi: Mention the new module.

2 years agoAdd more reminders to include <config.h>.
Bruno Haible [Thu, 13 Apr 2023 21:48:40 +0000 (23:48 +0200)]
Add more reminders to include <config.h>.

* lib/aligned-malloc.h: Check that config.h was already included.
* lib/careadlinkat.h: Likewise.
* lib/filemode.h: Likewise.
* lib/freadptr.h: Likewise.
* lib/fseterr.h: Likewise.
* lib/glthread/lock.h: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/immutable.h: Likewise.
* lib/isapipe.h: Likewise.
* lib/isnand-nolibm.h: Likewise.
* lib/isnanf-nolibm.h: Likewise.
* lib/isnanl-nolibm.h: Likewise.
* lib/mbswidth.h: Likewise.
* lib/md5.h: Likewise.
* lib/minmax.h: Likewise.
* lib/msvc-inval.h: Likewise.
* lib/msvc-nothrow.h: Likewise.
* lib/pathmax.h: Likewise.
* lib/sha1.h: Likewise.
* lib/sha256.h: Likewise.
* lib/sha512.h: Likewise.
* lib/size_max.h: Likewise.
* lib/sm3.h: Likewise.
* lib/stat-size.h: Likewise.
* lib/termcap.h: Likewise.
* lib/terminfo.h: Likewise.
* lib/thread-optim.h: Likewise.
* lib/unlocked-io.h: Likewise.
* lib/vma-iter.h: Likewise.

2 years agoAdjust comments in <config.h> reminders.
Bruno Haible [Thu, 13 Apr 2023 21:18:19 +0000 (23:18 +0200)]
Adjust comments in <config.h> reminders.

* lib/*.h: In the comments, mention also HAVE_*.

2 years agoAdjust comments in <config.h> reminders.
Bruno Haible [Thu, 13 Apr 2023 20:17:02 +0000 (22:17 +0200)]
Adjust comments in <config.h> reminders.

* lib/*.in.h: In the comments, mention also HAVE_RAW_DECL_*.
* Makefile (sc_check_config_h_reminder): Search also for HAVE_RAW_DECL_.

2 years agoutmp: Avoid using HAVE_* macros in *.in.h files.
Bruno Haible [Thu, 13 Apr 2023 19:43:51 +0000 (21:43 +0200)]
utmp: Avoid using HAVE_* macros in *.in.h files.

* m4/pty_h.m4 (gl_PTY_CHECK_UTIL_H): New macro, extracted from gl_PTY_H.
(gl_PTY_H): Invoke it.
* m4/utmp_h.m4 (gl_UTMP_H): Invoke gl_PTY_CHECK_UTIL_H and set
HAVE_TERMIOS_H.
(gl_UTMP_H_DEFAULTS): Require gl_PTY_H_DEFAULTS, gl_TERMIOS_H_DEFAULTS.
* modules/utmp (Files): Add m4/pty_h.m4, m4/termios_h.m4.
(Makefile.am): Substitute also HAVE_UTIL_H, HAVE_LIBUTIL_H,
HAVE_TERMIOS_H.
* lib/utmp.in.h: Test HAVE_UTIL_H, HAVE_LIBUTIL_H, HAVE_TERMIOS_H as
Autoconf variables.

2 years agogetprogname: Avoid using HAVE_* macros in *.in.h files.
Bruno Haible [Thu, 13 Apr 2023 19:25:59 +0000 (21:25 +0200)]
getprogname: Avoid using HAVE_* macros in *.in.h files.

* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize
HAVE_DECL_PROGRAM_INVOCATION_NAME.
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Require gl_STDLIB_H_DEFAULTS
and gl_USE_SYSTEM_EXTENSIONS. Set HAVE_DECL_PROGRAM_INVOCATION_NAME.
* modules/stdlib (Makefile.am): Substitute
HAVE_DECL_PROGRAM_INVOCATION_NAME.
* lib/stdlib.in.h (getprogname): Test HAVE_DECL_PROGRAM_INVOCATION_NAME
as an Autoconf variable.

2 years agoselinux-h: Avoid using HAVE_* macros in *.in.h files.
Bruno Haible [Thu, 13 Apr 2023 19:12:45 +0000 (21:12 +0200)]
selinux-h: Avoid using HAVE_* macros in *.in.h files.

* m4/selinux-selinux-h.m4 (gl_HEADERS_SELINUX_SELINUX_H): Initialize
HAVE_SELINUX_SELINUX_H.
* modules/selinux-h (Makefile.am): Substitute HAVE_SELINUX_SELINUX_H.
* lib/se-selinux.in.h: Test HAVE_SELINUX_SELINUX_H as an Autoconf
variable.

2 years agoialloc, gethrxtime: Restore GCC diagnostics options.
Bruno Haible [Thu, 13 Apr 2023 12:26:50 +0000 (14:26 +0200)]
ialloc, gethrxtime: Restore GCC diagnostics options.

* lib/ialloc.h: Invoke _GL_INLINE_HEADER_END.
* lib/xtime.h: Likewise.
* Makefile (sc_check_GL_INLINE_HEADER_use): New rule.

2 years agoflexmember: Fix module description (regression 2016-09-07).
Bruno Haible [Thu, 13 Apr 2023 12:06:12 +0000 (14:06 +0200)]
flexmember: Fix module description (regression 2016-09-07).

* modules/flexmember (Include): Add "flexmember.h".

2 years agodoc: year2038 MIPS o32 nudge
Paul Eggert [Wed, 12 Apr 2023 22:12:47 +0000 (15:12 -0700)]
doc: year2038 MIPS o32 nudge

* doc/year2038.texi: Use more-common "o32" name for
32-bit MIPS ABI.

2 years agoAdd more reminders to include <config.h>.
Bruno Haible [Wed, 12 Apr 2023 12:49:29 +0000 (14:49 +0200)]
Add more reminders to include <config.h>.

* m4/gnulib-common.m4 (gl_COMMON): In config.h, define
_GL_CONFIG_H_INCLUDED.
* lib/acl-internal.h: Test _GL_CONFIG_H_INCLUDED instead of
_GL_INLINE_HEADER_BEGIN.
* lib/alignalloc.h: Likewise.
* lib/argp-fmtstream.h: Likewise.
* lib/argp.h: Likewise.
* lib/binary-io.h: Likewise.
* lib/bitrotate.h: Likewise.
* lib/c-ctype.h: Likewise.
* lib/count-leading-zeros.h: Likewise.
* lib/count-one-bits.h: Likewise.
* lib/count-trailing-zeros.h: Likewise.
* lib/eealloc.h: Likewise.
* lib/execinfo.in.h: Likewise.
* lib/gethrxtime.h: Likewise.
* lib/gl_list.h: Likewise.
* lib/gl_map.h: Likewise.
* lib/gl_omap.h: Likewise.
* lib/gl_openssl.h: Likewise.
* lib/gl_oset.h: Likewise.
* lib/gl_set.h: Likewise.
* lib/gl_xlist.h: Likewise.
* lib/gl_xmap.h: Likewise.
* lib/gl_xomap.h: Likewise.
* lib/gl_xoset.h: Likewise.
* lib/gl_xset.h: Likewise.
* lib/gl_xsublist.h: Likewise.
* lib/glthread/cond.h: Likewise.
* lib/hamt.h: Likewise.
* lib/ialloc.h: Likewise.
* lib/math.in.h: Likewise.
* lib/mbchar.h: Likewise.
* lib/mbfile.h: Likewise.
* lib/mbiter.h: Likewise.
* lib/mbuiter.h: Likewise.
* lib/openat.h: Likewise.
* lib/pipe-filter-aux.h: Likewise.
* lib/priv-set.h: Likewise.
* lib/safe-alloc.h: Likewise.
* lib/savewd.h: Likewise.
* lib/se-context.in.h: Likewise.
* lib/se-label.in.h: Likewise.
* lib/se-selinux.in.h: Likewise.
* lib/sig-handler.h: Likewise.
* lib/stat-time.h: Likewise.
* lib/string-desc-quotearg.h: Likewise.
* lib/string-desc.h: Likewise.
* lib/sys_socket.in.h: Likewise.
* lib/timespec.h: Likewise.
* lib/u64.h: Likewise.
* lib/uchar.in.h: Likewise.
* lib/unistd.in.h: Likewise.
* lib/utimens.h: Likewise.
* lib/wctype.in.h: Likewise.
* lib/xalloc.h: Likewise.
* lib/xbinary-io.h: Likewise.
* lib/xsize.h: Likewise.
* lib/xstring-desc.h: Likewise.
* lib/xtime.h: Likewise.
* lib/acl.h: Check that config.h was already included.
* lib/alignof.h: Likewise.
* lib/argmatch.h: Likewise.
* lib/argv-iter.h: Likewise.
* lib/arpa_inet.in.h: Likewise.
* lib/attribute.h: Likewise.
* lib/backupfile.h: Likewise.
* lib/base32.h: Likewise.
* lib/base64.h: Likewise.
* lib/basename-lgpl.h: Likewise.
* lib/bitset.h: Likewise.
* lib/bitsetv.h: Likewise.
* lib/c-snprintf.h: Likewise.
* lib/c-stack.h: Likewise.
* lib/c-strcase.h: Likewise.
* lib/c-vasnprintf.h: Likewise.
* lib/c-vasprintf.h: Likewise.
* lib/c-vsnprintf.h: Likewise.
* lib/c-xvasprintf.h: Likewise.
* lib/canon-host.h: Likewise.
* lib/canonicalize.h: Likewise.
* lib/clean-temp.h: Likewise.
* lib/concat-filename.h: Likewise.
* lib/ctype.in.h: Likewise.
* lib/dfa.h: Likewise.
* lib/di-set.h: Likewise.
* lib/dirent-safer.h: Likewise.
* lib/dirent.in.h: Likewise.
* lib/dirname.h: Likewise.
* lib/eloop-threshold.h: Likewise.
* lib/error.in.h: Likewise.
* lib/exclude.h: Likewise.
* lib/fatal-signal.h: Likewise.
* lib/fcntl.in.h: Likewise.
* lib/file-type.h: Likewise.
* lib/filenamecat.h: Likewise.
* lib/filevercmp.h: Likewise.
* lib/flexmember.h: Likewise.
* lib/fnmatch.in.h: Likewise.
* lib/fpending.h: Likewise.
* lib/freadable.h: Likewise.
* lib/freadahead.h: Likewise.
* lib/freading.h: Likewise.
* lib/fts_.h: Likewise.
* lib/fwritable.h: Likewise.
* lib/fwriting.h: Likewise.
* lib/gc.h: Likewise.
* lib/get_progname_of.h: Likewise.
* lib/glob.in.h: Likewise.
* lib/glthread/thread.h: Likewise.
* lib/hash-pjw-bare.h: Likewise.
* lib/hash-pjw.h: Likewise.
* lib/hash-triple.h: Likewise.
* lib/hash.h: Likewise.
* lib/i-ring.h: Likewise.
* lib/iconv.in.h: Likewise.
* lib/ino-map.h: Likewise.
* lib/inttostr.h: Likewise.
* lib/inttypes.in.h: Likewise.
* lib/javaversion.h: Likewise.
* lib/langinfo.in.h: Likewise.
* lib/locale.in.h: Likewise.
* lib/localename.h: Likewise.
* lib/malloc.in.h: Likewise.
* lib/malloca.h: Likewise.
* lib/memcasecmp.h: Likewise.
* lib/memchr2.h: Likewise.
* lib/memcmp2.h: Likewise.
* lib/modechange.h: Likewise.
* lib/monetary.in.h: Likewise.
* lib/mountlist.h: Likewise.
* lib/netdb.in.h: Likewise.
* lib/obstack.h: Likewise.
* lib/opendirat.h: Likewise.
* lib/pagealign_alloc.h: Likewise.
* lib/pipe-filter.h: Likewise.
* lib/poll.in.h: Likewise.
* lib/pthread.in.h: Likewise.
* lib/pty.in.h: Likewise.
* lib/quotearg.h: Likewise.
* lib/read-file.h: Likewise.
* lib/readline.h: Likewise.
* lib/readutmp.h: Likewise.
* lib/regex-quote.h: Likewise.
* lib/relocatable.h: Likewise.
* lib/savedir.h: Likewise.
* lib/sched.in.h: Likewise.
* lib/search.in.h: Likewise.
* lib/sh-quote.h: Likewise.
* lib/signal.in.h: Likewise.
* lib/sigpipe-die.h: Likewise.
* lib/sockets.h: Likewise.
* lib/spawn.in.h: Likewise.
* lib/ssfmalloc.h: Likewise.
* lib/stack.h: Likewise.
* lib/stdalign.in.h: Likewise.
* lib/stdarg.in.h: Likewise.
* lib/stddef.in.h: Likewise.
* lib/stdio-safer.h: Likewise.
* lib/stdio.in.h: Likewise.
* lib/stdlib.in.h: Likewise.
* lib/stdnoreturn.in.h: Likewise.
* lib/strerror-override.h: Likewise.
* lib/striconv.h: Likewise.
* lib/striconveh.h: Likewise.
* lib/striconveha.h: Likewise.
* lib/string-buffer.h: Likewise.
* lib/string.in.h: Likewise.
* lib/strings.in.h: Likewise.
* lib/strnlen1.h: Likewise.
* lib/sys_file.in.h: Likewise.
* lib/sys_ioctl.in.h: Likewise.
* lib/sys_random.in.h: Likewise.
* lib/sys_resource.in.h: Likewise.
* lib/sys_select.in.h: Likewise.
* lib/sys_stat.in.h: Likewise.
* lib/sys_time.in.h: Likewise.
* lib/sys_times.in.h: Likewise.
* lib/sys_utsname.in.h: Likewise.
* lib/sys_wait.in.h: Likewise.
* lib/system-quote.h: Likewise.
* lib/term-style-control.h: Likewise.
* lib/termios.in.h: Likewise.
* lib/textstyle.in.h: Likewise.
* lib/threads.in.h: Likewise.
* lib/time.in.h: Likewise.
* lib/trim.h: Likewise.
* lib/utime.in.h: Likewise.
* lib/utmp.in.h: Likewise.
* lib/vasnprintf.h: Likewise.
* lib/verror.h: Likewise.
* lib/version-etc.h: Likewise.
* lib/wchar.in.h: Likewise.
* lib/windows-spawn.h: Likewise.
* lib/windows-thread.h: Likewise.
* lib/xgetcwd.h: Likewise.
* lib/xgetdomainname.h: Likewise.
* lib/xgethostname.h: Likewise.
* lib/xmalloca.h: Likewise.
* lib/xmemdup0.h: Likewise.
* lib/xprintf.h: Likewise.
* lib/xreadlink.h: Likewise.
* lib/xstriconv.h: Likewise.
* lib/xstriconveh.h: Likewise.
* lib/xstrndup.h: Likewise.
* lib/xstrtol-error.h: Likewise.
* lib/xvasprintf.h: Likewise.
* Makefile (config_h_MACROS*): New variables.
(sc_check_config_h_reminder): New rule.

2 years agodoc: update year2038 list further
Paul Eggert [Tue, 11 Apr 2023 21:54:20 +0000 (14:54 -0700)]
doc: update year2038 list further

Prompted by Adhemerval Zanella Netto’s email in:
https://lists.gnu.org/r/bug-gnulib/2023-04/msg00083.html
Also, mention 32-bit Android.
* doc/year2038.texi: Mention Linux/ork1 and Android.
Append "32" to powerpc and sparc names.

2 years agoFix the "make sc_prohibit_AC_LIBOBJ_in_m4" findings.
Bruno Haible [Tue, 11 Apr 2023 17:40:15 +0000 (19:40 +0200)]
Fix the "make sc_prohibit_AC_LIBOBJ_in_m4" findings.

* Makefile (allow_AC_LIBOBJ): Update after 2023-03-24 change. Add
termcap, terminfo.

2 years agoFix some "make sc_prohibit_leading_TABs" findings.
Bruno Haible [Tue, 11 Apr 2023 17:37:24 +0000 (19:37 +0200)]
Fix some "make sc_prohibit_leading_TABs" findings.

* tests/test-calloc-gnu.c: Expand tabs.
* tests/test-regex.c: Likewise.

2 years agoMakefile: Fix a syntax alert.
Bruno Haible [Tue, 11 Apr 2023 17:34:50 +0000 (19:34 +0200)]
Makefile: Fix a syntax alert.

* Makefile: Indent commands with tabs, not spaces.

2 years agoalignasof: Ensure a correct _Alignas (regression 2023-01-15).
Bruno Haible [Tue, 11 Apr 2023 00:52:16 +0000 (02:52 +0200)]
alignasof: Ensure a correct _Alignas (regression 2023-01-15).

* m4/stdalign.m4 (gl_ALIGNASOF): Define _Alignas also when <stdalign.h>
exists.

2 years agoAdd ChangeLog entries for the last 3 commits.
Paul Eggert [Tue, 11 Apr 2023 00:46:39 +0000 (02:46 +0200)]
Add ChangeLog entries for the last 3 commits.

2 years agodoc: update list of year2038 platforms
Paul Eggert [Mon, 10 Apr 2023 22:15:37 +0000 (15:15 -0700)]
doc: update list of year2038 platforms

* doc/year2038.texi: Update list of platforms
by adding dates and version numbers and fixing some that
appear to have been misfiled.  Also, list working systems
and versions first, as that helps shorten the list of
failing systems by saying "older versions".

2 years agodoc: moved year2038 para up
Paul Eggert [Mon, 10 Apr 2023 22:18:19 +0000 (15:18 -0700)]
doc: moved year2038 para up

* doc/year2038.texi: Move a paragraph up,
as it’s lonely at the end.

2 years agodoc: document year2038 first
Paul Eggert [Mon, 10 Apr 2023 22:15:37 +0000 (15:15 -0700)]
doc: document year2038 first

* doc/year2038.texi: Document year2038 first, then
year2038-required.

2 years agodoc: Clarify list of platforms for year2038 support.
Bruno Haible [Mon, 10 Apr 2023 14:41:02 +0000 (16:41 +0200)]
doc: Clarify list of platforms for year2038 support.

* doc/year2038.texi (Avoiding the year 2038 problem): List one more platform.

2 years agodoc: Clarify list of platforms for year2038 support.
Bruno Haible [Mon, 10 Apr 2023 12:55:42 +0000 (14:55 +0200)]
doc: Clarify list of platforms for year2038 support.

* doc/year2038.texi (Avoiding the year 2038 problem): List the platforms
on which year2038-required is known to fail vs. known to succeed.

2 years agodoc: Avoid ambiguous wording.
Bruno Haible [Mon, 10 Apr 2023 12:49:45 +0000 (14:49 +0200)]
doc: Avoid ambiguous wording.

* doc/posix-headers/time.texi: Say "or" not "and".

2 years agodoc: Fix a typo.
Bruno Haible [Mon, 10 Apr 2023 01:54:47 +0000 (03:54 +0200)]
doc: Fix a typo.

* doc/posix-headers/time.texi: Fix typo in module name.

2 years agodoc: improve cross-refs for year 2038 issue
Paul Eggert [Mon, 10 Apr 2023 01:16:57 +0000 (18:16 -0700)]
doc: improve cross-refs for year 2038 issue

2 years agolargefile: sync from Autoconf master
Paul Eggert [Mon, 10 Apr 2023 01:16:57 +0000 (18:16 -0700)]
largefile: sync from Autoconf master

* modules/largefile-required, modules/year2038-required: New modules.
* MODULES.html.sh, doc/largefile.texi, doc/posix-headers/time.texi:
* doc/year2038.texi: Document this.
* m4/largefile.m4: Sync from Autoconf master.
Conditionalize the workaround on AC_SYS_LARGEFILE_REQUIRED rather
than on AC_SYS_YEAR2038 so that we replace older but still
unreleased Autoconf.
(AC_SYS_LARGEFILE_REQUIRED, AC_SYS_YEAR2038_REQUIRED): New macros.

2 years agoyear2038: configure earlier
Paul Eggert [Mon, 10 Apr 2023 01:16:13 +0000 (18:16 -0700)]
year2038: configure earlier

* modules/year2038: Put AC_SYS_YEAR2038 in configure.ac-early
since it can affect CPPFLAGS with _TIME_BITS=64.

2 years agomaint: no Autoconf 2.72
Paul Eggert [Mon, 10 Apr 2023 01:15:16 +0000 (18:15 -0700)]
maint: no Autoconf 2.72

Rewrite commentary to not mention Autoconf 2.72, as the plan is to
jump from 2.71 to 2.73 with no 2.72.  Leave code uses of
‘m4_version_prereq([2.72], ...)’ alone, though as they’re still
correct for Autoconf released versions and will help test Autoconf
release candidates.

2 years agoc32toupper: Add tests.
Bruno Haible [Sun, 9 Apr 2023 23:51:54 +0000 (01:51 +0200)]
c32toupper: Add tests.

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

2 years agoc32toupper: New module.
Bruno Haible [Sun, 9 Apr 2023 23:50:39 +0000 (01:50 +0200)]
c32toupper: New module.

* lib/uchar.in.h (c32toupper): New declaration.
* lib/c32toupper.c: New file.
* modules/c32toupper: New file.
* m4/uchar_h.m4 (gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize
GNULIB_C32TOUPPER.
* modules/uchar (Makefile.am): Substitute GNULIB_C32TOUPPER.

2 years agoc32tolower: Add tests.
Bruno Haible [Sun, 9 Apr 2023 23:46:37 +0000 (01:46 +0200)]
c32tolower: Add tests.

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

2 years agoc32tolower: New module.
Bruno Haible [Tue, 4 Apr 2023 21:21:04 +0000 (23:21 +0200)]
c32tolower: New module.

* lib/uchar.in.h (c32tolower): New declaration.
* lib/c32tolower.c: New file.
* lib/c32to-impl.h: New file, based on lib/c32is-impl.h.
* modules/c32tolower: New file.
* m4/uchar_h.m4 (gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize
GNULIB_C32TOLOWER.
* modules/uchar (Makefile.am): Substitute GNULIB_C32TOLOWER.

2 years agoc32is*: Ensure GNULIB_defined_mbstate_t is defined on AIX.
Bruno Haible [Sun, 9 Apr 2023 16:14:46 +0000 (18:14 +0200)]
c32is*: Ensure GNULIB_defined_mbstate_t is defined on AIX.

* m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Define through AC_DEFUN_ONCE.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Require it.
* modules/c32isalnum (Files): Add m4/mbrtowc.m4, m4/locale-ja.m4.
(configure.ac): Require gl_MBSTATE_T_BROKEN.
* modules/c32isalpha: Likewise.
* modules/c32isblank: Likewise.
* modules/c32iscntrl: Likewise.
* modules/c32isdigit: Likewise.
* modules/c32isgraph: Likewise.
* modules/c32islower: Likewise.
* modules/c32isprint: Likewise.
* modules/c32ispunct: Likewise.
* modules/c32isspace: Likewise.
* modules/c32isupper: Likewise.
* modules/c32isxdigit: Likewise.

2 years agombrtoc32: Add comments.
Bruno Haible [Sun, 9 Apr 2023 16:02:51 +0000 (18:02 +0200)]
mbrtoc32: Add comments.

* lib/mbrtoc32.c: Add comment regarding AIX.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Add comment regarding
GNULIB_defined_mbstate_t.

2 years agodoc: Mention a NetBSD bug.
Bruno Haible [Sun, 9 Apr 2023 21:45:43 +0000 (23:45 +0200)]
doc: Mention a NetBSD bug.

* doc/posix-functions/towlower.texi: Mention NetBSD bug 57339.
* doc/posix-functions/towupper.texi: Likewise.

2 years agovasnwprintf-posix: More details about the glibc bug.
Bruno Haible [Sun, 9 Apr 2023 18:34:48 +0000 (20:34 +0200)]
vasnwprintf-posix: More details about the glibc bug.

* doc/posix-functions/swprintf.texi: Add comment.
* m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LA): Update cross-compilation
guess.

2 years agodoc: Mention another Haiku bug.
Bruno Haible [Sat, 8 Apr 2023 16:15:07 +0000 (18:15 +0200)]
doc: Mention another Haiku bug.

* doc/posix-functions/open.texi: Mention a Haiku bug with symlinks.

2 years agoAvoid Autoconf "was expanded before it was required" warning.
Bruno Haible [Sat, 8 Apr 2023 13:26:13 +0000 (15:26 +0200)]
Avoid Autoconf "was expanded before it was required" warning.

* m4/exponentf.m4 (gl_FLOAT_EXPONENT_LOCATION): Define through
AC_DEFUN_ONCE.
* m4/exponentd.m4 (gl_DOUBLE_EXPONENT_LOCATION): Likewise.
* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Likewise.

2 years agostriconveh tests: Avoid test failure on glibc 2.15.
Bruno Haible [Sat, 8 Apr 2023 12:45:16 +0000 (14:45 +0200)]
striconveh tests: Avoid test failure on glibc 2.15.

* tests/test-striconveh.c (main): Skip some of the GB18030 tests on
glibc < 2.16.

2 years agovasnwprintf-posix: Really work around %La bug in glibc 2.15 and Haiku.
Bruno Haible [Sat, 8 Apr 2023 11:21:49 +0000 (13:21 +0200)]
vasnwprintf-posix: Really work around %La bug in glibc 2.15 and Haiku.

* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Fix a copy&paste bug.

2 years agologin_tty: Fix compilation error in C++ mode on Solaris 11.4.
Bruno Haible [Sat, 8 Apr 2023 10:08:03 +0000 (12:08 +0200)]
login_tty: Fix compilation error in C++ mode on Solaris 11.4.

* m4/login_tty.m4 (gl_FUNC_LOGIN_TTY): Test whether <termios.h> exists.
Consider it when testing whether login_tty is declared.
* lib/utmp.in.h: If none of <util.h> and <libutil.h> exists, include
<termios.h> instead.
* doc/glibc-functions/login_tty.texi: Document the Solaris 11.4 problem.

2 years agotime: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Sat, 8 Apr 2023 07:47:10 +0000 (09:47 +0200)]
time: Fix compilation error in C++ mode on Solaris 11.

* lib/time.in.h (time): Disable _GL_CXXALIASWARN invocation on non-glibc
systems.

2 years agounistdio/*: Fix test failures (regression 2023-01-28).
Bruno Haible [Sat, 8 Apr 2023 01:15:37 +0000 (03:15 +0200)]
unistdio/*: Fix test failures (regression 2023-01-28).

* modules/unistdio/*printf (configure.ac): Bump required libunistring
version number.

2 years agotrim tests: Fix link error.
Bruno Haible [Sat, 8 Apr 2023 00:19:30 +0000 (02:19 +0200)]
trim tests: Fix link error.

* modules/trim-tests (Makefile.am): Link test-trim also against libintl.

2 years agostdio: Fix the value of _PRINTF_NAN_LEN_MAX on OpenBSD.
Bruno Haible [Fri, 7 Apr 2023 22:19:35 +0000 (00:19 +0200)]
stdio: Fix the value of _PRINTF_NAN_LEN_MAX on OpenBSD.

* lib/stdio.in.h (_PRINTF_NAN_LEN_MAX): Define to 4 on OpenBSD.

2 years agovasnwprintf-posix: Work around %La bug in glibc 2.15 and Haiku.
Bruno Haible [Fri, 7 Apr 2023 21:54:24 +0000 (23:54 +0200)]
vasnwprintf-posix: Work around %La bug in glibc 2.15 and Haiku.

* m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LA): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke
gl_SWPRINTF_DIRECTIVE_LA and define NEED_WPRINTF_DIRECTIVE_LA
accordingly.
* lib/vasnprintf.c: When compiling vasnwprintf, if
NEED_WPRINTF_DIRECTIVE_LA, handle the %La and %LA directives ourselves.
* doc/posix-functions/swprintf.texi: Mention the %La bug.

2 years agostdio: Fix compilation error in C++ mode on macOS.
Bruno Haible [Fri, 7 Apr 2023 21:42:41 +0000 (23:42 +0200)]
stdio: Fix compilation error in C++ mode on macOS.

* lib/stdio.in.h (getw, putw): Repeat the declaration even if the
function is already supposed to be declared.

2 years agovasnwprintf-posix tests: Avoid test failure on mingw.
Bruno Haible [Fri, 7 Apr 2023 21:23:47 +0000 (23:23 +0200)]
vasnwprintf-posix tests: Avoid test failure on mingw.

* tests/test-vasnwprintf-posix.c (test_function): For mingw, change two
expected test results.

2 years agouchar: Force inline functions to C linkage in C++ mode.
Bruno Haible [Thu, 6 Apr 2023 14:14:13 +0000 (16:14 +0200)]
uchar: Force inline functions to C linkage in C++ mode.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Put definitions of
_GL_BEGIN_C_LINKAGE, _GL_END_C_LINKAGE into config.h.
* lib/uchar.in.h: Enclose all inline functions in _GL_BEGIN_C_LINKAGE /
_GL_END_C_LINKAGE.