Paul Eggert [Thu, 30 Jan 2020 00:47:51 +0000 (16:47 -0800)]
dfa: do not depend on isblank
This removes a difference between Gawk dfa.c and Gnulib dfa.c.
* lib/dfa.c (isblank): Define if neither system nor Gnulib does.
* modules/dfa (Depends-on): Remove isblank.
* modules/isblank: Add a module indicator, for lib/dfa.c.
Paul Eggert [Wed, 29 Jan 2020 18:58:26 +0000 (10:58 -0800)]
dfa: do not assume 64-bit int
Problem reported for VAX/VMS C (!) by Arnold Robbins in:
https://lists.gnu.org/r/bug-gnulib/2020-01/msg00173.html
* lib/dfa.c (CHARCLASS_PAIR): Bring back this macro.
(CHARCLASS_WORD_BITS, charclass_word) [!UINT_LEAST64_MAX]:
Fall back to 32-bit words.
(CHARCLASS_INIT): Go back to having 8 32-bit args instead
of 4 64-bit args. All uses changed.
Paul Eggert [Mon, 27 Jan 2020 21:00:57 +0000 (13:00 -0800)]
regex: port to non-GCC pre-IEC-60559
Problem reported by Arnold Robbins in:
https://lists.gnu.org/r/bug-gnulib/2020-01/msg00154.html
* lib/regex_internal.h (ULONG_WIDTH): Make this usable in #if.
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.
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
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'.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.