summaryrefslogtreecommitdiff
path: root/modules/mbsrtoc32s
Commit message (Collapse)AuthorAgeFilesLines
* mbrtoc32: Use the system's mbrtoc32 if it exists and basically works.Bruno Haible2020-01-091-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* mbsrtoc32s: Fix bug.Bruno Haible2020-01-041-0/+1
| | | | | * modules/mbsrtoc32s (configure.ac): Require gl_UCHAR_H, to make sure that SMALL_WCHAR_T is defined.
* mbsrtoc32s: New module.Bruno Haible2020-01-041-0/+36
* 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.