]> Savannah Git Hosting - gnulib.git/log
gnulib.git
5 years agoc32isalnum: Add tests.
Bruno Haible [Sat, 25 Jan 2020 22:44:09 +0000 (23:44 +0100)]
c32isalnum: Add tests.

* tests/test-c32isalnum.c: New file.
* tests/test-c32isalnum.sh: New file.
* modules/c32isalnum-tests: New file.

5 years agoc32isalnum: New module.
Bruno Haible [Sat, 25 Jan 2020 22:36:41 +0000 (23:36 +0100)]
c32isalnum: New module.

* lib/c32isalnum.c: New file.
* lib/c32is-impl.h: New file.
* modules/c32isalnum: New file.
* doc/posix-functions/iswalnum.texi: Mention the new module.

5 years agouchar: Preparations for modules c32isalnum, ..., c32isxdigit.
Bruno Haible [Sat, 25 Jan 2020 21:51:04 +0000 (22:51 +0100)]
uchar: Preparations for modules c32isalnum, ..., c32isxdigit.

* lib/uchar.in.h (c32isalnum, c32isalpha, c32isblank, c32iscntrl,
c32isdigit, c32isgraph, c32islower, c32isprint, c32ispunct, c32isspace,
c32isupper, c32isxdigit): New declarations.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32ISALNUM,
GNULIB_C32ISALPHA, GNULIB_C32ISBLANK, GNULIB_C32ISCNTRL,
GNULIB_C32ISDIGIT, GNULIB_C32ISGRAPH, GNULIB_C32ISLOWER,
GNULIB_C32ISPRINT, GNULIB_C32ISPUNCT, GNULIB_C32ISSPACE,
GNULIB_C32ISUPPER, GNULIB_C32ISXDIGIT.
* modules/uchar (Makefile.am): Substitute GNULIB_C32ISALNUM,
GNULIB_C32ISALPHA, GNULIB_C32ISBLANK, GNULIB_C32ISCNTRL,
GNULIB_C32ISDIGIT, GNULIB_C32ISGRAPH, GNULIB_C32ISLOWER,
GNULIB_C32ISPRINT, GNULIB_C32ISPUNCT, GNULIB_C32ISSPACE,
GNULIB_C32ISUPPER, GNULIB_C32ISXDIGIT.
* tests/test-uchar-c++.cc: Test the signature of c32isalnum, c32isalpha,
c32isblank, c32iscntrl, c32isdigit, c32isgraph, c32islower, c32isprint,
c32ispunct, c32isspace, c32isupper, c32isxdigit.

5 years agombchar, wctype: Use the corrected iswxdigit function.
Bruno Haible [Sat, 25 Jan 2020 20:19:27 +0000 (21:19 +0100)]
mbchar, wctype: Use the corrected iswxdigit function.

* modules/mbchar (Depends-on): Add iswxdigit.
* modules/wctype (Depends-on): Likewise.

5 years agoiswxdigit: Add tests.
Bruno Haible [Sat, 25 Jan 2020 20:18:42 +0000 (21:18 +0100)]
iswxdigit: Add tests.

* tests/test-iswxdigit.c: New file.
* tests/test-iswxdigit.sh: New file.
* modules/iswxdigit-tests: New file.

5 years agoiswxdigit: New module.
Bruno Haible [Sat, 25 Jan 2020 20:17:51 +0000 (21:17 +0100)]
iswxdigit: New module.

* m4/iswxdigit.m4: New file.
* lib/wctype.in.h (iswxdigit): Potentially override.
(iswxdigit, rpl_iswxdigit): Test REPLACE_ISWXDIGIT, not
REPLACE_ISWCNTRL. Rely on ISO C compliant definition.
* lib/iswxdigit.c: New file.
* m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWXDIGIT,
REPLACE_ISWXDIGIT.
* modules/wctype-h (Makefile.am): Substitute GNULIB_ISWXDIGIT,
REPLACE_ISWXDIGIT.
* modules/iswxdigit: New file.
* doc/posix-functions/iswxdigit.texi: Mention the portability problem.

5 years agolseek: Fix the override to not undo the effects of AC_SYS_LARGEFILE.
Bruno Haible [Sat, 25 Jan 2020 20:00:31 +0000 (21:00 +0100)]
lseek: Fix the override to not undo the effects of AC_SYS_LARGEFILE.

Reported by John Donoghue <john.david.donoghue@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00146.html>.

* lib/lseek.c (rpl_lseek): When AC_SYS_LARGEFILE has enabled a 64-bit
off_t on mingw, invoke _lseeki64 instead of lseek.

5 years agoiswdigit tests: Avoid test failure on Cygwin.
Bruno Haible [Sat, 25 Jan 2020 19:45:03 +0000 (20:45 +0100)]
iswdigit tests: Avoid test failure on Cygwin.

* tests/test-iswdigit.c (for_character): If mbrtowc cannot convert the
byte sequence, return 0.

5 years agoiswdigit: Fix test failure on native Windows.
Bruno Haible [Sat, 25 Jan 2020 19:41:52 +0000 (20:41 +0100)]
iswdigit: Fix test failure on native Windows.

* lib/wctype.in.h (rpl_iswdigit): Rely on ISO C compliant definition.

5 years agoiswdigit: Fix module description.
Bruno Haible [Sat, 25 Jan 2020 16:07:51 +0000 (17:07 +0100)]
iswdigit: Fix module description.

* modules/iswdigit (Files): Add necessary files.

5 years agombchar, wctype: Use the corrected iswdigit function.
Bruno Haible [Sat, 25 Jan 2020 15:11:39 +0000 (16:11 +0100)]
mbchar, wctype: Use the corrected iswdigit function.

* modules/mbchar (Depends-on): Add iswdigit.
* modules/wctype (Depends-on): Likewise.

5 years agoiswdigit: Add tests.
Bruno Haible [Sat, 25 Jan 2020 15:05:55 +0000 (16:05 +0100)]
iswdigit: Add tests.

* tests/test-iswdigit.c: New file.
* tests/test-iswdigit.sh: New file.
* modules/iswdigit-tests: New file.

5 years agoiswdigit: New module.
Bruno Haible [Sat, 25 Jan 2020 15:03:15 +0000 (16:03 +0100)]
iswdigit: New module.

* m4/iswdigit.m4: New file.
* lib/wctype.in.h (iswdigit): Potentially override.
(iswdigit, rpl_iswdigit): Test REPLACE_ISWDIGIT, not REPLACE_ISWCNTRL.
* lib/iswdigit.c: New file.
* m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWDIGIT,
REPLACE_ISWDIGIT.
* modules/wctype-h (Makefile.am): Substitute GNULIB_ISWDIGIT,
REPLACE_ISWDIGIT.
* modules/iswdigit: New file.
* doc/posix-functions/iswdigit.texi: Mention the portability problem.

5 years agohard-locale tests: Make it easy to reuse the musl test.
Bruno Haible [Sat, 25 Jan 2020 09:13:56 +0000 (10:13 +0100)]
hard-locale tests: Make it easy to reuse the musl test.

* m4/musl.m4: New file, extracted from modules/hard-locale-tests.
* modules/hard-locale-tests (Files): Add it.
(configure.ac): Invoke gl_MUSL_LIBC.

5 years agoregex: port to Gawk on nonstandard platforms
Paul Eggert [Fri, 24 Jan 2020 08:32:32 +0000 (00:32 -0800)]
regex: port to Gawk on nonstandard platforms

* lib/regex_internal.h (ULONG_WIDTH): Define if not already defined.
This is useful for Gawk, which does not use the Gnulib stdlib-h
module.  Problem reported by Arnold Robbins in:
https://lists.gnu.org/r/bug-gnulib/2020-01/msg00138.html

5 years agoregex: fix bug with >=16 subexpressions
Paul Eggert [Wed, 22 Jan 2020 01:59:10 +0000 (17:59 -0800)]
regex: fix bug with >=16 subexpressions

* lib/regex_internal.h (struct re_backref_cache_entry):
Use bitset_word_t as the type of eps_reachable_subexps_map,
instead of unsigned short int.  This fixes a bug I introduced
to glibc in 2005-09-28T17:33:18Z!drepper@redhat.com (glibc commit
2c05d33f90861d074dc12808dafbde30f487b1a0, BZ #1302).
Remove unused member 'unused'.

5 years agoregex: simplify definition of BITSET_WORD_BITS
Paul Eggert [Wed, 22 Jan 2020 01:29:35 +0000 (17:29 -0800)]
regex: simplify definition of BITSET_WORD_BITS

* config/srclist.txt: Remove regex.c, regex_internal.h temporarily.
* lib/regex.c (__STDC_WANT_IEC_60559_BFP_EXT__): Define.
* lib/regex_internal.h (BITSET_WORD_BITS):
* modules/regex (Depends-on): Add limits-h.
Simplify now that we can use ULONG_WIDTH.

5 years agombrtoc32: Add note about FreeBSD 12.
Bruno Haible [Tue, 21 Jan 2020 00:55:50 +0000 (01:55 +0100)]
mbrtoc32: Add note about FreeBSD 12.

* m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Guess no also on FreeBSD.
* doc/posix-functions/mbrtoc32.texi: Mention that FreeBSD 12 is also
affected.

5 years agounistr/u8-uctomb: Fix warning.
Bruno Haible [Mon, 20 Jan 2020 17:40:59 +0000 (18:40 +0100)]
unistr/u8-uctomb: Fix warning.

Reported by Andreas Schwab <schwab@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00127.html>.

* lib/unistr/u8-uctomb.c (FALLTHROUGH): New macro.
(u8_uctomb): Add FALLTHROUGH markers.

5 years agolock: Fix test-once1 failure on FreeBSD 11 (regression from 2020-01-19).
Bruno Haible [Mon, 20 Jan 2020 17:29:24 +0000 (18:29 +0100)]
lock: Fix test-once1 failure on FreeBSD 11 (regression from 2020-01-19).

* lib/glthread/lock.c (glthread_once_multithreaded): New function.
* lib/glthread/lock.h (glthread_once_multithreaded): New declaration.
(glthread_once): Use it.

5 years agothreadlib: Disable use of weak symbols on FreeBSD 11.
Bruno Haible [Mon, 20 Jan 2020 02:58:32 +0000 (03:58 +0100)]
threadlib: Disable use of weak symbols on FreeBSD 11.

Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00061.html>.

* m4/threadlib.m4 (gl_WEAK_SYMBOLS): Require AC_CANONICAL_HOST. Test
against a bug in FreeBSD 11.

5 years agoiconv_open: Improve z/OS support.
Bruno Haible [Sun, 19 Jan 2020 21:13:25 +0000 (22:13 +0100)]
iconv_open: Improve z/OS support.

* lib/iconv_open-zos.gperf: Choose better aliases. Add mapping for
ISO-8859-3, KOI8-R, KOI8-U, CP775, CP857, CP865, CP1129, CP1131, CP1257.
Remove mapping for EUC-TW.

5 years agoRename ~~gnulib.m4 to zzgnulib.m4.
Bruno Haible [Sat, 18 Jan 2020 22:05:36 +0000 (23:05 +0100)]
Rename ~~gnulib.m4 to zzgnulib.m4.

Suggested by Paul Eggert.

* m4/zzgnulib.m4: Renamed from m4/~~gnulib.m4.
* gnulib-tool (func_get_filelist): Update.
* pygnulib/GLModuleSystem.py (getFiles): Likewise.

5 years agodoc: Update license notices.
Bruno Haible [Sat, 18 Jan 2020 18:32:40 +0000 (19:32 +0100)]
doc: Update license notices.

* doc/*.texi: Reference the GFDL 1.3 through a URL, rather than by
reference to a section or to a "file as part of this distribution".

5 years agoAvoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)".
Bruno Haible [Sat, 18 Jan 2020 18:02:19 +0000 (19:02 +0100)]
Avoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)".

Reported by Mats Erik Andersson <mats.andersson@gisladisker.se> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00109.html>.

* m4/00gnulib.m4 (gl_COMPILER_CLANG): Use _AC_COMPILE_IFELSE, not
AC_EGREP_CPP.

5 years agoEnsure Automake does not drop ~~gnulib.m4.
Bruno Haible [Sat, 18 Jan 2020 13:33:33 +0000 (14:33 +0100)]
Ensure Automake does not drop ~~gnulib.m4.

* m4/~~gnulib.m4 (gl_ZZGNULIB): New macro.
* m4/gnulib-common.m4 (gl_COMMON): Require it.

5 years agoFix major regression from 2020-01-10.
Bruno Haible [Sat, 18 Jan 2020 13:03:36 +0000 (14:03 +0100)]
Fix major regression from 2020-01-10.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00079.html>.

* m4/00gnulib.m4 (gl_COMPILER_CLANG, gl_COMPILER_PREPARE_CHECK_DECL):
Don't AC_REQUIRE anything.
(gl_COMPILER_PREPARE_CHECK_DECL): Define through AC_DEFUN, not
AC_DEFUN_ONCE. Use _AC_COMPILE_IFELSE, not AC_COMPILE_IFELSE.
(_AC_CHECK_DECL_BODY): If ac_compile_for_check_decl has not been set,
use ac_compile instead.
(AC_CHECK_DECL): Remove override.
* m4/~~gnulib.m4: New file.
* gnulib-tool (func_get_filelist): Add also ~~gnulib.m4.
* pygnulib/GLModuleSystem.py (getFiles): Likewise.

5 years agoglob: Fix use-after-free bug.
Bruno Haible [Fri, 17 Jan 2020 20:56:01 +0000 (21:56 +0100)]
glob: Fix use-after-free bug.

Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00102.html>.

* lib/glob.c (__glob): Delay freeing dirname until after the use of
end_name.

5 years agovcs-to-changelog: Fix parsing of fndecl without args.
Siddhesh Poyarekar [Thu, 16 Jan 2020 16:11:34 +0000 (21:41 +0530)]
vcs-to-changelog: Fix parsing of fndecl without args.

* build-aux/vcstocl/frontend_c.py (FNDECL_RE): Fix regular
expression for empty arguments.

5 years agovcs-to-changelog: Add documentation.
Siddhesh Poyarekar [Thu, 16 Jan 2020 08:03:00 +0000 (13:33 +0530)]
vcs-to-changelog: Add documentation.

* doc/vcs-to-changelog.texi: New file.
* doc/gnulib.texi (Build Infrastructure Modules): Add
vcs-to-changelog section.

5 years agovcs-to-changelog: Allow loading of custom quirks file
Siddhesh Poyarekar [Thu, 16 Jan 2020 07:19:55 +0000 (12:49 +0530)]
vcs-to-changelog: Allow loading of custom quirks file

gnulib does not have a quirks file and if the scripts are not copied
over to the project tree, it may never find the quirks file in the
right place.  Add a flag to vcs_to_changelog.py to allow one to
specify the location of the quirks file instead.

* build-aux/vcs_to_changelog.py: New commandline option -q.

5 years agovcs-to-changelog: Fix formatting of ChangeLog output.
Siddhesh Poyarekar [Thu, 16 Jan 2020 07:19:54 +0000 (12:49 +0530)]
vcs-to-changelog: Fix formatting of ChangeLog output.

Add another newline when the number of files differing is too large.
This is typical for across-the-board changes such as copyright year
updates.

* build-aux/vcstocl/vcs_git.py (list_changes): Add newline in
print output.

5 years agovcs-to-changelog: Drop python3 shebang from frontend_c.py
Siddhesh Poyarekar [Thu, 16 Jan 2020 07:19:53 +0000 (12:49 +0530)]
vcs-to-changelog: Drop python3 shebang from frontend_c.py

frontend_c.py is not executed directly and hence does not need it.

* build-aux/vcstocl/frontend_c.py: Remove shebang.

5 years agocrypto/gc-pbkdf2: New module.
Simon Josefsson [Wed, 15 Jan 2020 22:10:58 +0000 (23:10 +0100)]
crypto/gc-pbkdf2: New module.

* MODULES.html.sh (func_all_modules): Add gc-pbkdf2.
* NEWS: Deprecated gc-pbkdf2-sha1 in favor of gc-pbkdf2.
* lib/gc-pbkdf2.c: New file.
* lib/gc-pbkdf2-sha1.c: Use new interface.
* lib/gc.h (GC_MAX_DIGEST_SIZE, gc_pbkdf2_hmac): Add.
* modules/crypto/gc-pbkdf2: New file.
* modules/crypto/gc-pbkdf2-tests: New file.
* tests/test-gc-pbkdf2.c: New file.

5 years agoc32stombs: Add tests.
Bruno Haible [Sun, 12 Jan 2020 23:17:47 +0000 (00:17 +0100)]
c32stombs: Add tests.

* tests/test-c32stombs.c: New file, based on tests/test-c32srtombs.c.
* tests/test-c32stombs-1.sh: New file, based on
tests/test-c32srtombs-1.sh.
* tests/test-c32stombs-2.sh: New file, based on
tests/test-c32srtombs-2.sh.
* tests/test-c32stombs-3.sh: New file, based on
tests/test-c32srtombs-3.sh.
* tests/test-c32stombs-4.sh: New file, based on
tests/test-c32srtombs-4.sh.
* modules/c32stombs-tests: New file, based on modules/c32srtombs-tests.

5 years agoc32stombs: New module.
Bruno Haible [Sun, 12 Jan 2020 23:16:48 +0000 (00:16 +0100)]
c32stombs: New module.

* lib/uchar.in.h (c32stombs): New declaration.
* lib/c32stombs.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32STOMBS.
* modules/uchar (Makefile.am): Substitute GNULIB_C32STOMBS.
* modules/c32stombs: New file.
* tests/test-uchar-c++.cc: Test the signature of c32stombs.
* doc/posix-functions/wcstombs.texi: Mention the new module.

5 years agoperl: require the "warnings" module
Jim Meyering [Sun, 12 Jan 2020 02:59:42 +0000 (18:59 -0800)]
perl: require the "warnings" module

* m4/perl.m4: Also "use warnings", so we reject the perl found
on at least one IRIX 6.5 system. Reported by Bruno Haible in
https://lists.gnu.org/r/sed-devel/2020-01/msg00004.html

5 years agoFix major regression from 2020-01-04.
Bruno Haible [Fri, 10 Jan 2020 22:44:18 +0000 (23:44 +0100)]
Fix major regression from 2020-01-04.

Reported by Mats Erik Andersson <mats.andersson@gisladisker.se> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00072.html>.

* m4/00gnulib.m4 (gl_COMPILER_PREPARE_CHECK_DECL): Define through
AC_DEFUN_ONCE.
(AC_CHECK_DECL): Invoke, not require, it.

5 years agoc32snrtombs: Add tests.
Bruno Haible [Fri, 10 Jan 2020 22:29:57 +0000 (23:29 +0100)]
c32snrtombs: Add tests.

* tests/test-c32snrtombs.c: New file, based on tests/test-wcsnrtombs.c.
* tests/test-c32snrtombs-1.sh: New file, based on
tests/test-wcsnrtombs1.sh.
* tests/test-c32snrtombs-2.sh: New file, based on
tests/test-wcsnrtombs2.sh.
* tests/test-c32snrtombs-3.sh: New file, based on
tests/test-wcsnrtombs3.sh.
* tests/test-c32snrtombs-4.sh: New file, based on
tests/test-wcsnrtombs4.sh.
* modules/c32snrtombs-tests: New file, based on
modules/wcsnrtombs-tests.

5 years agoc32snrtombs: New module.
Bruno Haible [Fri, 10 Jan 2020 22:28:47 +0000 (23:28 +0100)]
c32snrtombs: New module.

* lib/uchar.in.h (c32snrtombs): New declaration.
* lib/wcsnrtombs-impl.h: Parameterize: Use macros FUNC, SCHAR_T,
INTERNAL_STATE, WCRTOMB.
* lib/wcsnrtombs.c (FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB): New macros.
* lib/c32snrtombs.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32SNRTOMBS.
* modules/uchar (Makefile.am): Substitute GNULIB_C32SNRTOMBS.
* modules/c32snrtombs: New file.
* tests/test-uchar-c++.cc: Test the signature of c32snrtombs.
* doc/posix-functions/wcsnrtombs.texi: Mention the new module.

5 years agoc32srtombs: Add tests.
Bruno Haible [Thu, 9 Jan 2020 15:21:53 +0000 (16:21 +0100)]
c32srtombs: Add tests.

* tests/test-c32srtombs.c: New file, based on tests/test-wcsrtombs.c.
* tests/test-c32srtombs-1.sh: New file, based on
tests/test-wcsrtombs1.sh.
* tests/test-c32srtombs-2.sh: New file, based on
tests/test-wcsrtombs2.sh.
* tests/test-c32srtombs-3.sh: New file, based on
tests/test-wcsrtombs3.sh.
* tests/test-c32srtombs-4.sh: New file, based on
tests/test-wcsrtombs4.sh.
* modules/c32srtombs-tests: New file, based on modules/wcsrtombs-tests.

5 years agoc32srtombs: New module.
Bruno Haible [Thu, 9 Jan 2020 15:20:10 +0000 (16:20 +0100)]
c32srtombs: New module.

* lib/uchar.in.h (c32srtombs): New declaration.
* lib/wcsrtombs-impl.h: Parameterize: Use macros FUNC, SCHAR_T,
INTERNAL_STATE, WCRTOMB.
* lib/wcsrtombs.c (FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB): New macros.
* lib/c32srtombs.c: New file.
* lib/c32srtombs-state.c: New file, based on lib/wcsrtombs-state.c.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32SRTOMBS.
* modules/uchar (Makefile.am): Substitute GNULIB_C32SRTOMBS.
* modules/c32srtombs: New file.
* tests/test-uchar-c++.cc: Test the signature of c32srtombs.
* doc/posix-functions/wcsrtombs.texi: Mention the new module.

5 years agoc32tob: Make consistent with mbrtoc32.
Bruno Haible [Thu, 9 Jan 2020 01:04:07 +0000 (02:04 +0100)]
c32tob: Make consistent with mbrtoc32.

* lib/c32tob.c: Include <stdio.h>, <string.h>, <wchar.h>.
(c32tob): If the char32_t encoding and the wchar_t encoding may differ,
use c32rtomb, not wctob.
* modules/c32tob (Files): Add m4/mbrtoc32.m4.
(Depends-on): Add c32rtomb.
(configure.ac): Require gl_MBRTOC32_SANITYCHECK.

5 years agoc32rtomb: Add tests.
Bruno Haible [Thu, 9 Jan 2020 01:00:19 +0000 (02:00 +0100)]
c32rtomb: Add tests.

* tests/test-c32rtomb.c: New file, based on tests/test-wcrtomb.c.
* tests/test-c32rtomb.sh: New file, based on tests/test-wcrtomb.sh.
* tests/test-c32rtomb-w32.c: New file, based on
tests/test-wcrtomb-w32.c.
* tests/test-c32rtomb-w32-1.sh: New file, based on
tests/test-wcrtomb-w32-1.sh.
* tests/test-c32rtomb-w32-2.sh: New file, based on
tests/test-wcrtomb-w32-2.sh.
* tests/test-c32rtomb-w32-3.sh: New file, based on
tests/test-wcrtomb-w32-3.sh.
* tests/test-c32rtomb-w32-4.sh: New file, based on
tests/test-wcrtomb-w32-4.sh.
* tests/test-c32rtomb-w32-5.sh: New file, based on
tests/test-wcrtomb-w32-5.sh.
* tests/test-c32rtomb-w32-6.sh: New file, based on
tests/test-wcrtomb-w32-6.sh.
* tests/test-c32rtomb-w32-7.sh: New file, based on
tests/test-wcrtomb-w32-7.sh.
* modules/c32rtomb-tests: New file.

5 years agoc32rtomb: New module.
Bruno Haible [Thu, 9 Jan 2020 00:56:35 +0000 (01:56 +0100)]
c32rtomb: New module.

* lib/uchar.in.h (c32rtomb): New declaration.
* lib/c32rtomb.c: New file, based on lib/unistr/u8-uctomb-aux.c.
* m4/c32rtomb.m4: New file.
* m4/uchar.m4 (gl_UCHAR_H): Test whether c32rtomb is declared.
(gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32RTOMB, HAVE_C32RTOMB,
REPLACE_C32RTOMB.
* modules/uchar (Makefile.am): Substitute GNULIB_C32RTOMB,
HAVE_C32RTOMB, REPLACE_C32RTOMB.
* modules/c32rtomb: New file.
* tests/test-uchar-c++.cc: Test the signature of c32rtomb.
* doc/posix-functions/c32rtomb.texi: Document the new module.
* doc/posix-functions/wcrtomb.texi: Mention the new module.

5 years agombrtoc32: Use the system's mbrtoc32 if it exists and basically works.
Bruno Haible [Thu, 9 Jan 2020 00:47:17 +0000 (01:47 +0100)]
mbrtoc32: Use the system's mbrtoc32 if it exists and basically works.

* m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): New macro.
(gl_FUNC_MBRTOC32): Require it. Set REPLACE_MBRTOC32 if mbrtoc32 exists
but is not working.
* lib/mbrtoc32.c: Include hard-locale.h, <locale.h>.
(mbrtoc32): If the char32_t encoding and the wchar_t encoding may
differ, use the system's mbrtoc32, adding workarounds.
* modules/mbrtoc32 (Depends-on): Add hard-locale.
* doc/posix-functions/mbrtoc32.texi: Mention the Solaris and native
Windows problem.
* lib/btoc32.c: Include <stdio.h>, <string.h>.
(btoc32): If the char32_t encoding and the wchar_t encoding may differ,
use mbrtoc32, not btowc.
* modules/btoc32 (Depends-on): Add mbrtoc32.
* lib/mbsrtoc32s.c (mbsrtoc32s): If the char32_t encoding and the
wchar_t encoding may differ, use mbrtoc32, not mbsrtowcs.
* modules/mbsrtoc32s (Depends-on): Update conditions.
(configure.ac): Compile mbsrtoc32s-state.c unconditionally.
* lib/mbsnrtoc32s.c (mbsnrtoc32s): If the char32_t encoding and the
wchar_t encoding may differ, use mbrtoc32, not mbsnrtowcs.
* modules/mbsnrtoc32s (Depends-on): Update conditions.
(configure.ac): Compile mbsrtoc32s-state.c unconditionally.

5 years agowcrtomb: Make multithread-safe, except possibly on IRIX.
Bruno Haible [Wed, 8 Jan 2020 02:32:20 +0000 (03:32 +0100)]
wcrtomb: Make multithread-safe, except possibly on IRIX.

* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Don't set REPLACE_WCRTOMB to 1 when
REPLACE_MBSTATE_T is set. Define WCRTOMB_C_LOCALE_BUG and
WCRTOMB_RETVAL_BUG.
* lib/wcrtomb.c (wcrtomb): Use original wcrtomb whenever available. Use
wctomb only on IRIX.

5 years agotests: skip thread-using tests when threading is disabled
Jim Meyering [Sun, 5 Jan 2020 18:25:27 +0000 (10:25 -0800)]
tests: skip thread-using tests when threading is disabled

sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three
thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each
of those, so they are skipped in this case.
* tests/test-nl_langinfo-mt.c (main): Exit 77 when threading is disabled.
* tests/test-setlocale_null-mt-all.c (main): Likewise.
* tests/test-setlocale_null-mt-one.c (main): Likewise.

5 years agotests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.
Bruno Haible [Sun, 5 Jan 2020 19:42:12 +0000 (20:42 +0100)]
tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.

* lib/stdlib.in.h: Tweak last commit.

5 years agotests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.
Bruno Haible [Sun, 5 Jan 2020 08:13:25 +0000 (09:13 +0100)]
tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.

Reported by Jim Meyering in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00040.html>.

* lib/stdlib.in.h (GNULIB_defined_canonicalize_file_name): New macro.
(GNULIB_defined_ptsname_r): New macro.
* tests/test-canonicalize.c (_GL_ARG_NONNULL): Define to empty.
(main): Disable the NULL argument test if canonicalize_file_name does
not come from gnulib.
* tests/test-canonicalize-lgpl.c (_GL_ARG_NONNULL): Define to empty.
(main): Disable the NULL argument test if canonicalize_file_name does
not come from gnulib.
* tests/test-ptsname_r.c (_GL_ARG_NONNULL): Define to empty.
(test_errors): Disable the NULL argument test if ptsname_r does not come
from gnulib.

5 years agoupdate-copyright: reenable its always-skipped test
Jim Meyering [Sun, 5 Jan 2020 06:52:20 +0000 (22:52 -0800)]
update-copyright: reenable its always-skipped test

* tests/test-update-copyright.sh: Restore the "-pi" options removed
on 2019-06-15.  Without those, an internal preliminary test would
fail, causing this test always to be skipped.
Verify that the test is now run and passes via this:
  ./gnulib-tool --test --dir /tmp/x --with-tests update-copyright

5 years agombstoc32s: Add tests.
Bruno Haible [Sun, 5 Jan 2020 11:23:37 +0000 (12:23 +0100)]
mbstoc32s: Add tests.

* tests/test-mbstoc32s.c: New file, based on tests/test-mbsrtoc32s.c.
* tests/test-mbstoc32s-1.sh: New file, based on
tests/test-mbsrtoc32s-1.sh.
* tests/test-mbstoc32s-2.sh: New file, based on
tests/test-mbsrtoc32s-2.sh.
* tests/test-mbstoc32s-3.sh: New file, based on
tests/test-mbsrtoc32s-3.sh.
* tests/test-mbstoc32s-4.sh: New file, based on
tests/test-mbsrtoc32s-4.sh.
* modules/mbstoc32s-tests: New file, based on modules/mbsrtoc32s-tests.

5 years agombstoc32s: New module.
Bruno Haible [Sun, 5 Jan 2020 11:23:00 +0000 (12:23 +0100)]
mbstoc32s: New module.

* lib/uchar.in.h (mbstoc32s): New declaration.
* lib/mbstoc32s.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSTOC32S.
* modules/uchar (Makefile.am): Substitute GNULIB_MBSTOC32S.
* modules/mbstoc32s: New file.
* tests/test-uchar-c++.cc: Test the signature of mbstoc32s.
* doc/posix-functions/mbstowcs.texi: Mention the new module.

5 years agoTweak recently added tests.
Bruno Haible [Sun, 5 Jan 2020 10:43:52 +0000 (11:43 +0100)]
Tweak recently added tests.

* tests/test-mbrtoc32.c: Make signature consistent with uchar.in.h.
* tests/test-mbsrtoc32s.c: Likewise.
* tests/test-mbsnrtoc32s.c: Likewise.

5 years agombsnrtoc32s: Add tests.
Bruno Haible [Sun, 5 Jan 2020 01:33:40 +0000 (02:33 +0100)]
mbsnrtoc32s: Add tests.

* tests/test-mbsnrtoc32s.c: New file, based on tests/test-mbsnrtowcs.c.
* tests/test-mbsnrtoc32s-1.sh: New file, based on
tests/test-mbsnrtowcs1.sh.
* tests/test-mbsnrtoc32s-2.sh: New file, based on
tests/test-mbsnrtowcs2.sh.
* tests/test-mbsnrtoc32s-3.sh: New file, based on
tests/test-mbsnrtowcs3.sh.
* tests/test-mbsnrtoc32s-4.sh: New file, based on
tests/test-mbsnrtowcs4.sh.
* modules/mbsnrtoc32s-tests: New file, based on
modules/mbsnrtowcs-tests.

5 years agombsnrtoc32s: New module.
Bruno Haible [Sun, 5 Jan 2020 01:32:18 +0000 (02:32 +0100)]
mbsnrtoc32s: New module.

* lib/uchar.in.h (mbsnrtoc32s): New declaration.
* lib/mbsnrtowcs-impl.h: Parameterize: Use macros FUNC, DCHAR_T,
INTERNAL_STATE, MBRTOWC.
* lib/mbsnrtowcs.c (FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC): New macros.
* lib/mbsnrtoc32s.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSNRTOC32S.
* modules/uchar (Makefile.am): Substitute GNULIB_MBSNRTOC32S.
* modules/mbsnrtoc32s: New file.
* tests/test-uchar-c++.cc: Test the signature of mbsnrtoc32s.
* doc/posix-functions/mbsnrtowcs.texi: Mention the new module.

5 years agombsrtoc32s tests: Enhance test.
Bruno Haible [Sat, 4 Jan 2020 18:37:41 +0000 (19:37 +0100)]
mbsrtoc32s tests: Enhance test.

* tests/test-mbsrtoc32s.c (main): Include a non-BMP character in the
test strings for UTF-8 and GB18030.

5 years agoautoupdate
Karl Berry [Sat, 4 Jan 2020 17:18:38 +0000 (09:18 -0800)]
autoupdate

5 years agoautoupdate
Karl Berry [Sat, 4 Jan 2020 17:04:47 +0000 (09:04 -0800)]
autoupdate

5 years agombsrtoc32s: Fix bug.
Bruno Haible [Sat, 4 Jan 2020 15:30:35 +0000 (16:30 +0100)]
mbsrtoc32s: Fix bug.

* modules/mbsrtoc32s (configure.ac): Require gl_UCHAR_H, to make sure
that SMALL_WCHAR_T is defined.

5 years agombsrtoc32s: Add tests.
Bruno Haible [Sat, 4 Jan 2020 15:03:10 +0000 (16:03 +0100)]
mbsrtoc32s: Add tests.

* tests/test-mbsrtoc32s.c: New file, based on tests/test-mbsrtowcs.c.
* tests/test-mbsrtoc32s-1.sh: New file, based on
tests/test-mbsrtowcs1.sh.
* tests/test-mbsrtoc32s-2.sh: New file, based on
tests/test-mbsrtowcs2.sh.
* tests/test-mbsrtoc32s-3.sh: New file, based on
tests/test-mbsrtowcs3.sh.
* tests/test-mbsrtoc32s-4.sh: New file, based on
tests/test-mbsrtowcs4.sh.
* modules/mbsrtoc32s-tests: New file, based on modules/mbsrtowcs-tests.

5 years agombsrtoc32s: New module.
Bruno Haible [Sat, 4 Jan 2020 15:02:31 +0000 (16:02 +0100)]
mbsrtoc32s: New module.

* lib/uchar.in.h (mbsrtoc32s): New declaration.
* lib/mbsrtowcs-impl.h: Parameterize: Use macros FUNC, DCHAR_T,
INTERNAL_STATE, MBRTOWC.
* lib/mbsrtowcs.c (FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC): New macros.
* lib/mbsrtoc32s.c: New file.
* lib/mbsrtoc32s-state.c: New file, based on lib/mbsrtowcs-state.c.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSRTOC32S.
* modules/uchar (Makefile.am): Substitute GNULIB_MBSRTOC32S.
* modules/mbsrtoc32s: New file.
* tests/test-uchar-c++.cc: Test the signature of mbsrtoc32s.
* doc/posix-functions/mbsrtowcs.texi: Mention the new module.

5 years agombrtowc, mbrtoc32: Tighten dependendies.
Bruno Haible [Sat, 4 Jan 2020 14:54:02 +0000 (15:54 +0100)]
mbrtowc, mbrtoc32: Tighten dependendies.

* modules/mbrtowc (Depends-on): Disable hard-locale, mbsinit if
REPLACE_MBSTATE_T is 1.
(configure.ac): Don't compile lc-charset-dispatch.c and mbtowc-lock.c if
REPLACE_MBSTATE_T is 0.
* modules/mbrtoc32 (Depends-on): Remove hard-locale, mbsinit. Disable
mbrtowc dependency if REPLACE_MBSTATE_T is 1.
(configure.ac): Don't compile lc-charset-dispatch.c and mbtowc-lock.c if
REPLACE_MBSTATE_T is 0.

5 years agouchar: Decide about _GL_LARGE_CHAR32_T at configure time.
Bruno Haible [Sat, 4 Jan 2020 14:53:35 +0000 (15:53 +0100)]
uchar: Decide about _GL_LARGE_CHAR32_T at configure time.

* m4/uchar.m4 (gl_UCHAR_H): Set SMALL_WCHAR_T.
* modules/uchar (Files): Add stdint.m4.
(Makefile.am): Substitute SMALL_WCHAR_T.
* lib/uchar.in.h (_GL_LARGE_CHAR32_T): Rely on SMALL_WCHAR_T.

5 years agoFix AC_CHECK_DECL so that it deactivates clang's built-in declarations.
Bruno Haible [Sat, 4 Jan 2020 12:15:45 +0000 (13:15 +0100)]
Fix AC_CHECK_DECL so that it deactivates clang's built-in declarations.

Reported by Martin Storsjö <martin@martin.st> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00016.html>.

* m4/00gnulib.m4 (gl_COMPILER_CLANG, gl_COMPILER_PREPARE_CHECK_DECL):
New macros.
(_AC_CHECK_DECL_BODY, AC_CHECK_DECL): Augment.

5 years agobtoc32: Add tests.
Bruno Haible [Sat, 4 Jan 2020 09:07:12 +0000 (10:07 +0100)]
btoc32: Add tests.

* tests/test-btoc32.c: New file, based on tests/test-btowc.c.
* tests/test-btoc32-1.sh: New file, based on tests/test-btowc1.sh.
* tests/test-btoc32-2.sh: New file, based on tests/test-btowc2.sh.
* modules/btoc32-tests: New file, based on modules/btowc-tests.

5 years agobtoc32: New module.
Bruno Haible [Sat, 4 Jan 2020 09:03:36 +0000 (10:03 +0100)]
btoc32: New module.

* lib/uchar.in.h (btoc32): New declaration.
* lib/btoc32.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_BTOC32.
* modules/uchar (Makefile.am): Substitute GNULIB_BTOC32.
* modules/btoc32: New file.
* tests/test-uchar-c++.cc: Test the signature of btoc32.
* doc/posix-functions/btowc.texi: Mention the new module.

5 years agouchar tests: Avoid compilation error with HP cc.
Bruno Haible [Sat, 4 Jan 2020 01:46:44 +0000 (02:46 +0100)]
uchar tests: Avoid compilation error with HP cc.

* tests/test-uchar.c: Disable a test when HP cc is in use.

5 years agoc32tob: prefer https: URLs
Bruno Haible [Sat, 4 Jan 2020 01:46:12 +0000 (02:46 +0100)]
c32tob: prefer https: URLs

5 years agombrtoc32: Add tests.
Bruno Haible [Sat, 4 Jan 2020 01:35:26 +0000 (02:35 +0100)]
mbrtoc32: Add tests.

* tests/test-mbrtoc32.c: New file, based on tests/test-mbrtowc.c.
* tests/test-mbrtoc32-1.sh: New file, based on tests/test-mbrtowc1.sh.
* tests/test-mbrtoc32-2.sh: New file, based on tests/test-mbrtowc2.sh.
* tests/test-mbrtoc32-3.sh: New file, based on tests/test-mbrtowc3.sh.
* tests/test-mbrtoc32-4.sh: New file, based on tests/test-mbrtowc4.sh.
* tests/test-mbrtoc32-5.sh: New file, based on tests/test-mbrtowc5.sh.
* tests/test-mbrtoc32-w32.c: New file, based on tests/test-mbrtowc-w32.c.
* tests/test-mbrtoc32-w32-1.sh: New file, based on
tests/test-mbrtowc-w32-1.sh.
* tests/test-mbrtoc32-w32-2.sh: New file, based on
tests/test-mbrtowc-w32-2.sh.
* tests/test-mbrtoc32-w32-3.sh: New file, based on
tests/test-mbrtowc-w32-3.sh.
* tests/test-mbrtoc32-w32-4.sh: New file, based on
tests/test-mbrtowc-w32-4.sh.
* tests/test-mbrtoc32-w32-5.sh: New file, based on
tests/test-mbrtowc-w32-5.sh.
* tests/test-mbrtoc32-w32-6.sh: New file, based on
tests/test-mbrtowc-w32-6.sh.
* tests/test-mbrtoc32-w32-7.sh: New file, based on
tests/test-mbrtowc-w32-7.sh.
* modules/mbrtoc32-tests: New file, based on modules/mbrtowc-tests.

5 years agombrtoc32: New module.
Bruno Haible [Sat, 4 Jan 2020 01:32:52 +0000 (02:32 +0100)]
mbrtoc32: New module.

* lib/uchar.in.h (mbrtoc32): New declaration.
* lib/mbrtoc32.c: New file, based on lib/mbrtowc.c.
* m4/mbrtoc32.m4: New file, based on m4/mbrtowc.m4.
* m4/uchar.m4 (gl_UCHAR_H): Test whether mbrtoc32 is declared.
(gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBRTOC32, HAVE_MBRTOC32,
REPLACE_MBRTOC32.
* modules/uchar (Makefile.am): Substitute GNULIB_MBRTOC32,
HAVE_MBRTOC32, REPLACE_MBRTOC32.
* modules/mbrtoc32: New file, based on modules/mbrtowc.
* tests/test-uchar-c++.cc (mbrtoc32): Verify the signature.
* modules/uchar-c++-tests (Makefile.am): Link test-uchar-c++ with
$(LIB_MBRTOWC).
* doc/posix-functions/mbrtoc32.texi: Document the new module.
* doc/posix-functions/mbrtowc.texi: Mention the new module.

5 years agombrtowc: Refactor to share code with mbrtoc32.
Bruno Haible [Sat, 4 Jan 2020 01:31:39 +0000 (02:31 +0100)]
mbrtowc: Refactor to share code with mbrtoc32.

* lib/mbrtowc-impl.h: New file, extracted from lib/mbrtowc.c.
* lib/mbrtowc-impl-utf8.h: Likewise.
* lib/mbrtowc.c (mbrtowc): Define macro FITS_IN_CHAR_TYPE. Include
mbrtowc-impl.h.
* modules/mbrtowc (Files): Add the new files.

5 years agodoc: fix time.texi wording
Jim Meyering [Sat, 4 Jan 2020 01:09:13 +0000 (17:09 -0800)]
doc: fix time.texi wording

* doc/posix-headers/time.texi (time.h): Typo.

5 years agombrtowc: Refactor locale charset dispatching.
Bruno Haible [Fri, 3 Jan 2020 21:34:07 +0000 (22:34 +0100)]
mbrtowc: Refactor locale charset dispatching.

* lib/lc-charset-dispatch.h: New file, extracted from lib/mbrtowc.c.
* lib/lc-charset-dispatch.c: New file, extracted from lib/mbrtowc.c.
* lib/mbrtowc.c: Include lc-charset-dispatch.h. Don't include
localcharset.h, streq.h.
(enc_t): Remove type.
(locale_enc): Remove function.
(cached_locale_enc): Remove variable.
(locale_enc_cached): Remove function.
(mbrtowc): Invoke locale_encoding_classification.
* m4/mbrtowc.m4 (gl_PREREQ_MBRTOWC): Update comment.
* modules/mbrtowc (Files): Add lc-charset-dispatch.h,
lc-charset-dispatch.c.
(configure.ac): Arrange to compile lc-charset-dispatch.c.

5 years agodoc: mention 32-bit time_t issue
Paul Eggert [Fri, 3 Jan 2020 19:45:19 +0000 (11:45 -0800)]
doc: mention 32-bit time_t issue

* doc/posix-headers/sys_stat.texi (sys/stat.h):
* doc/posix-headers/time.texi (time.h): Mention 2038.

5 years agombrtowc: Ensure the mbtowc_lock is unique.
Bruno Haible [Fri, 3 Jan 2020 10:41:49 +0000 (11:41 +0100)]
mbrtowc: Ensure the mbtowc_lock is unique.

* lib/mbtowc-lock.c: New file, based on lib/setlocale-lock.c.
* lib/mbtowc-lock.h: New file, extracted from lib/mbrtowc.c and
lib/setlocale_null.c.
* lib/mbrtowc.c: Include headers needed for mbtowc-lock.h. Don't include
glthread/lock.h. Include mbtowc-lock.h.
(mbtowc_lock): Remove declaration.
(mbrtowc): Use mbtowc_with_lock.
* m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Require gl_PTHREADLIB. Check for
threads.h. Set LIB_MBRTOWC.
(gl_PREREQ_MBTOWC_LOCK): New macro.
* modules/mbrtowc (Files): Add lib/mbtowc-lock.h, lib/mbtowc-lock.c,
lib/windows-initguard.h, m4/threadlib.m4, m4/visibility.m4.
(Depends-on): Remove lock.
(configure.ac): Arrange to compile mbtowc-lock.c.
(Link): Mention $(LIB_MBRTOWC) instead of $(LIBTHREAD).
* modules/acl (Link): Likewise.
* modules/argmatch (Link): Likewise.
* modules/backup-rename (Link): Likewise.
* modules/backupfile (Link): Likewise.
* modules/closein (Link): Likewise.
* modules/closeout (Link): Likewise.
* modules/copy-file (Link): Likewise.
* modules/csharpcomp (Link): Likewise.
* modules/csharpexec (Link): Likewise.
* modules/dfa (Link): Likewise.
* modules/exclude (Link): Likewise.
* modules/fnmatch (Link): Likewise.
* modules/fnmatch-gnu (Link): Likewise.
* modules/fnmatch-posix (Link): Likewise.
* modules/glob (Link): Likewise.
* modules/human (Link): Likewise.
* modules/javacomp (Link): Likewise.
* modules/javaexec (Link): Likewise.
* modules/javaversion (Link): Likewise.
* modules/mbfile (Link): Likewise.
* modules/mbiter (Link): Likewise.
* modules/mbmemcasecmp (Link): Likewise.
* modules/mbmemcasecoll (Link): Likewise.
* modules/mbrlen (Link): Likewise.
* modules/mbscasecmp (Link): Likewise.
* modules/mbscasestr (Link): Likewise.
* modules/mbschr (Link): Likewise.
* modules/mbscspn (Link): Likewise.
* modules/mbsinit (Link): Likewise.
* modules/mbslen (Link): Likewise.
* modules/mbsncasecmp (Link): Likewise.
* modules/mbsnlen (Link): Likewise.
* modules/mbsnrtowcs (Link): Likewise.
* modules/mbspbrk (Link): Likewise.
* modules/mbspcasecmp (Link): Likewise.
* modules/mbsrchr (Link): Likewise.
* modules/mbsrtowcs (Link): Likewise.
* modules/mbssep (Link): Likewise.
* modules/mbsspn (Link): Likewise.
* modules/mbsstr (Link): Likewise.
* modules/mbstok_r (Link): Likewise.
* modules/mbswidth (Link): Likewise.
* modules/mbuiter (Link): Likewise.
* modules/mkdir-p (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/quote (Link): Likewise.
* modules/quotearg (Link): Likewise.
* modules/quotearg-simple (Link): Likewise.
* modules/regex-quote (Link): Likewise.
* modules/rpmatch (Link): Likewise.
* modules/sh-quote (Link): Likewise.
* modules/system-quote (Link): Likewise.
* modules/trim (Link): Likewise.
* modules/unistdio/ulc-asnprintf (Link): Likewise.
* modules/unistdio/ulc-fprintf (Link): Likewise.
* modules/unistdio/ulc-vasnprintf (Link): Likewise.
* modules/unistdio/ulc-vasprintf (Link): Likewise.
* modules/unistdio/ulc-vfprintf (Link): Likewise.
* modules/unistdio/ulc-vsnprintf (Link): Likewise.
* modules/unistdio/ulc-vsprintf (Link): Likewise.
* modules/xfreopen (Link): Likewise.
* modules/xmemcoll (Link): Likewise.
* modules/yesno (Link): Likewise.
* modules/regex (Link): Add $(LIB_MBRTOWC).
* modules/acl-tests (Makefile.am): Link the programs with $(LIB_MBRTOWC)
instead of $(LIBTHREAD).
* modules/argmatch-tests (Makefile.am): Likewise.
* modules/closein-tests (Makefile.am): Likewise.
* modules/copy-file-tests (Makefile.am): Likewise.
* modules/dfa-tests (Makefile.am): Likewise.
* modules/fnmatch-tests (Makefile.am): Likewise.
* modules/glob-tests (Makefile.am): Likewise.
* modules/mbmemcasecmp-tests (Makefile.am): Likewise.
* modules/mbmemcasecoll-tests (Makefile.am): Likewise.
* modules/mbrtowc-tests (Makefile.am): Likewise.
* modules/mbscasecmp-tests (Makefile.am): Likewise.
* modules/mbscasestr-tests (Makefile.am): Likewise.
* modules/mbschr-tests (Makefile.am): Likewise.
* modules/mbscspn-tests (Makefile.am): Likewise.
* modules/mbsinit-tests (Makefile.am): Likewise.
* modules/mbsncasecmp-tests (Makefile.am): Likewise.
* modules/mbsnrtowcs-tests (Makefile.am): Likewise.
* modules/mbspbrk-tests (Makefile.am): Likewise.
* modules/mbspcasecmp-tests (Makefile.am): Likewise.
* modules/mbsrchr-tests (Makefile.am): Likewise.
* modules/mbsrtowcs-tests (Makefile.am): Likewise.
* modules/mbsspn-tests (Makefile.am): Likewise.
* modules/mbsstr-tests (Makefile.am): Likewise.
* modules/quotearg-simple-tests (Makefile.am): Likewise.
* modules/quotearg-tests (Makefile.am): Likewise.
* modules/readtokens-tests (Makefile.am): Likewise.
* modules/sh-quote-tests (Makefile.am): Likewise.
* modules/system-quote-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-asnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsprintf-tests (Makefile.am): Likewise.
* modules/yesno-tests (Makefile.am): Likewise.
* modules/exclude-tests (Makefile.am): Link the programs with
$(LIB_MBRTOWC).
* modules/regex-tests (Makefile.am): Likewise.
* modules/regex-quote-tests (Makefile.am): Likewise.

5 years agogetopt-posix: Fix compilation failure in testdirs.
Bruno Haible [Fri, 3 Jan 2020 13:27:29 +0000 (14:27 +0100)]
getopt-posix: Fix compilation failure in testdirs.

* lib/unistd.in.h: Include <getopt-cdefs.h> and <getopt-pfx-core.h> only
when the gnulib module 'getopt-posix' is enabled.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETOPT_POSIX.
* modules/getopt-posix (configure.ac): Set GNULIB_GETOPT_POSIX as a
module indicator.
* modules/unistd (Makefile.am): Substitute GNULIB_GETOPT_POSIX.

5 years agodoc: Mention the 64-bit inode number problem.
Bruno Haible [Fri, 3 Jan 2020 13:19:15 +0000 (14:19 +0100)]
doc: Mention the 64-bit inode number problem.

* m4/largefile.m4 (AC_SYS_LARGEFILE): Mention that this macro fixes the
64-bit inode number problem.
* doc/posix-functions/stat.texi: Mention that this module fixes the
64-bit inode number problem.
* doc/posix-functions/lstat.texi: Likewise.
* doc/posix-functions/fstat.texi: Likewise.
* doc/posix-functions/readdir.texi: Add more details.
* doc/posix-functions/readdir_r.texi: Likewise.

5 years agowcrtomb: Add more tests.
Bruno Haible [Fri, 3 Jan 2020 00:26:10 +0000 (01:26 +0100)]
wcrtomb: Add more tests.

* tests/test-wcrtomb-w32.c: Include localcharset.h.
(test_one_locale): For the GB18030 and UTF-8 tests, verify that
locale_charset() returns the expected value; otherwise, skip the test.
* tests/test-wcrtomb-w32-6.sh: Remove old comment.
* tests/test-wcrtomb-w32-7.sh: Likewise.
* modules/wcrtomb-tests (Files): Add these files.
(Depends-on): Add localcharset.
(TESTS): Add test-wcrtomb-w32-6.sh, test-wcrtomb-w32-7.sh.

5 years agombrtowc: Add more tests.
Bruno Haible [Fri, 3 Jan 2020 00:23:24 +0000 (01:23 +0100)]
mbrtowc: Add more tests.

* tests/test-mbrtowc-w32.c: Include localcharset.h.
(test_one_locale): For the GB18030 and UTF-8 tests, verify that
locale_charset() returns the expected value; otherwise, skip the test.
* tests/test-mbrtowc-w32-6.sh: Remove old comment.
* tests/test-mbrtowc-w32-7.sh: Likewise.
* modules/mbrtowc-tests (Files): Add these files.
(Depends-on): Add localcharset.
(TESTS): Add test-mbrtowc-w32-6.sh, test-mbrtowc-w32-7.sh.

5 years agombrtowc: Fix test failures on MSVC (regression by previous commit).
Bruno Haible [Thu, 2 Jan 2020 22:12:57 +0000 (23:12 +0100)]
mbrtowc: Fix test failures on MSVC (regression by previous commit).

* m4/mbrtowc.m4 (gl_MBRTOWC_STORES_INCOMPLETE): New macro.
(gl_FUNC_MBRTOWC): Invoke it. Define MBRTOWC_STORES_INCOMPLETE_BUG.
* lib/mbrtowc.c (rpl_mbrtowc): Add workaround for
MBRTOWC_STORES_INCOMPLETE_BUG.
* doc/posix-functions/mbrtowc.texi: Mention the MSVC bug.

5 years agodoc: mention glibc bug 24269
Paul Eggert [Thu, 2 Jan 2020 22:08:58 +0000 (14:08 -0800)]
doc: mention glibc bug 24269

* doc/regex.texi (Back-reference Operator): Add glibc bug 24269.
Reformat slightly so that it looks nicer in the Grep manual.

5 years agombrtowc: Don't replace mbstate_t on MSVC.
Bruno Haible [Thu, 2 Jan 2020 19:20:05 +0000 (20:20 +0100)]
mbrtowc: Don't replace mbstate_t on MSVC.

* lib/wchar.in.h (GNULIB_defined_mbstate_t): Ignore a missing mbsinit function
on native Windows.

5 years agombrtowc: Don't replace mbstate_t on MSVC.
Bruno Haible [Thu, 2 Jan 2020 17:36:29 +0000 (18:36 +0100)]
mbrtowc: Don't replace mbstate_t on MSVC.

* m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Require AC_CANONICAL_HOST. Ignore
a missing mbsinit function on native Windows.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Strengthen the test, to detect an
MSVC bug.
* doc/posix-functions/wcrtomb.texi: Mention the MSVC bug.

5 years agosetlocale-null: Avoid crashing the MSVC linker.
Bruno Haible [Thu, 2 Jan 2020 15:12:04 +0000 (16:12 +0100)]
setlocale-null: Avoid crashing the MSVC linker.

* lib/setlocale-lock.c: Don't define IMP(gl_get_setlocale_null_lock) on
MSVC.

5 years agowchar: Make the HP-UX workaround work on HP-UX 11.31.
Bruno Haible [Thu, 2 Jan 2020 12:56:23 +0000 (13:56 +0100)]
wchar: Make the HP-UX workaround work on HP-UX 11.31.

* modules/wchar (Depends-on): Add inttypes-incomplete.
* lib/inttypes.in.h: Define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H.
* lib/wchar.in.h: Test _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H instead
of strtoimax.

5 years agombrtowc: Fix compilation error on IRIX (regression from 2019-12-26).
Bruno Haible [Thu, 2 Jan 2020 11:21:42 +0000 (12:21 +0100)]
mbrtowc: Fix compilation error on IRIX (regression from 2019-12-26).

* lib/mbrtowc.c: Include <stdint.h>.
* modules/mbrtowc (Depends-on): Add stdint.

5 years agomd5, sha1, sha256, sha512: support --with-openssl=auto-gpl-compat
Pádraig Brady [Wed, 1 Jan 2020 17:36:20 +0000 (17:36 +0000)]
md5, sha1, sha256, sha512: support --with-openssl=auto-gpl-compat

* m4/gl-openssl.m4: Add a new "auto-gpl-compat" mode,
which will auto enable use of openssl, only for >= version 3,
which is newly licensed under the Apache Software License.
This will be used from coreutils for example by adding
gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat]) to configure.ac.
Even though "auto-gpl-compat" is less aggressive than "auto",
we leave the default at "no" so projects can opt in to the
extra dependency.

5 years agombrtowc: Include function name in macro names.
Bruno Haible [Wed, 1 Jan 2020 21:04:47 +0000 (22:04 +0100)]
mbrtowc: Include function name in macro names.

* m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Define
MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not C_LOCALE_MAYBE_EILSEQ.
(gl_MBRTOWC_C_LOCALE): Change cache variable name to
gl_cv_func_mbrtowc_C_locale_sans_EILSEQ.
* lib/mbrtowc.c: Test MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not
C_LOCALE_MAYBE_EILSEQ.

5 years agoc32tob: New module.
Bruno Haible [Wed, 1 Jan 2020 16:01:54 +0000 (17:01 +0100)]
c32tob: New module.

* lib/uchar.in.h (_GL_LARGE_CHAR32_T): New macro.
(c32tob): New declaration.
* lib/c32tob.c: New file.
* m4/uchar.m4 (gl_UCHAR_MODULE_INDICATOR, gl_UCHAR_H_DEFAULTS): New
macros.
(gl_UCHAR_H): Require gl_UCHAR_H_DEFAULTS.
* modules/uchar (Depends-on): Add snippet/c++defs.
(Makefile.am): Include c++defs.h and substitute GNULIB_C32TOB in
uchar.h.
* modules/c32tob: New file.
* tests/test-uchar.c: Verify that _GL_LARGE_CHAR32_T is correctly
defined.
* tests/test-uchar-c++.cc: Include signature.h. Test the signature of
c32tob.
* modules/uchar-c++-tests (Files): Add tests/signature.h.
* doc/posix-functions/wctob.texi: Mention the new module.

5 years agolocale C++ tests: Fix link error on AIX (regression from 2019-12-18).
Bruno Haible [Wed, 1 Jan 2020 15:53:26 +0000 (16:53 +0100)]
locale C++ tests: Fix link error on AIX (regression from 2019-12-18).

* modules/locale-c++-tests (Makefile.am): Link test-locale-c++ with
$(LIB_SETLOCALE).

5 years agohard-locale tests: Fix a conflict with the C++ tests.
Bruno Haible [Wed, 1 Jan 2020 15:42:49 +0000 (16:42 +0100)]
hard-locale tests: Fix a conflict with the C++ tests.

* modules/hard-locale-tests (Makefile.am): Build a program named
'current-locale', not 'locale'.

5 years agodoc: Update documentation about wchar_t.
Bruno Haible [Wed, 1 Jan 2020 15:34:39 +0000 (16:34 +0100)]
doc: Update documentation about wchar_t.

* doc/*/*wc*.texi: Clarify that 64-bit AIX does not have a too small
wchar_t type.

5 years agombrtowc tests: Fix typos.
Bruno Haible [Wed, 1 Jan 2020 13:54:32 +0000 (14:54 +0100)]
mbrtowc tests: Fix typos.

* tests/test-mbrtowc.c (main): Fix typo.
* tests/test-mbrtowc-w32.c (test_one_locale): Likewise.

5 years agomaint: update copyright notices
Paul Eggert [Wed, 1 Jan 2020 01:33:19 +0000 (17:33 -0800)]
maint: update copyright notices

Before doing the following changes done by hand, I also ran ‘make
update-copyright’ and ‘config/srclist-update <config/srclist.txt’
to do most of the copyright years automatically.  A few upstream
sources are still in 2019 but these should eventually be changed
automatically too.
* build-aux/declared.sh (func_version):
* build-aux/libtool-next-version (func_version):
* build-aux/run-test (func_version):
Update these notices by hand.  Put just the last year
in output of programs, as per GNU coding standards.

5 years agoautoupdate
Paul Eggert [Wed, 1 Jan 2020 01:22:24 +0000 (17:22 -0800)]
autoupdate

5 years agomaint: Run 'make update-copyright'
Paul Eggert [Wed, 1 Jan 2020 00:00:18 +0000 (00:00 +0000)]
maint: Run 'make update-copyright'

5 years agouchar: Add C++ tests.
Bruno Haible [Tue, 31 Dec 2019 18:38:50 +0000 (19:38 +0100)]
uchar: Add C++ tests.

* tests/test-uchar-c++.cc: New file.
* tests/test-uchar-c++2.cc: New file.
* modules/uchar-c++-tests: New file.

5 years agouchar: Add tests.
Bruno Haible [Tue, 31 Dec 2019 18:37:01 +0000 (19:37 +0100)]
uchar: Add tests.

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

5 years agouchar: New module.
Bruno Haible [Tue, 31 Dec 2019 18:35:48 +0000 (19:35 +0100)]
uchar: New module.

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