diff options
author | Bruno Haible <bruno@clisp.org> | 2020-01-09 01:47:17 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-01-09 01:47:17 +0100 |
commit | 9be236d67f3d78235c5cbe4381c5dd7b3cddb179 (patch) | |
tree | 09bcc0427c1bd58585080336ebed1fe1bfde6898 /modules | |
parent | 877b0c46019d34e722c94248edbfaf5bfbaa17ec (diff) | |
download | gnulib-9be236d67f3d78235c5cbe4381c5dd7b3cddb179.tar.gz |
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.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/btoc32 | 1 | ||||
-rw-r--r-- | modules/mbrtoc32 | 1 | ||||
-rw-r--r-- | modules/mbsnrtoc32s | 10 | ||||
-rw-r--r-- | modules/mbsrtoc32s | 8 |
4 files changed, 9 insertions, 11 deletions
diff --git a/modules/btoc32 b/modules/btoc32 index 5e5d4a94e2..caf36d346b 100644 --- a/modules/btoc32 +++ b/modules/btoc32 @@ -6,6 +6,7 @@ lib/btoc32.c Depends-on: uchar +mbrtoc32 btowc configure.ac: diff --git a/modules/mbrtoc32 b/modules/mbrtoc32 index 2575394ce2..cf418464eb 100644 --- a/modules/mbrtoc32 +++ b/modules/mbrtoc32 @@ -18,6 +18,7 @@ m4/visibility.m4 Depends-on: uchar +hard-locale [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0] mbrtowc [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0] localcharset [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1] streq [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1] diff --git a/modules/mbsnrtoc32s b/modules/mbsnrtoc32s index 44784d8076..ac464a8950 100644 --- a/modules/mbsnrtoc32s +++ b/modules/mbsnrtoc32s @@ -10,16 +10,14 @@ Depends-on: uchar wchar verify -mbrtoc32 [test $SMALL_WCHAR_T = 1] -minmax [test $SMALL_WCHAR_T = 1] -strnlen1 [test $SMALL_WCHAR_T = 1] +mbrtoc32 +minmax +strnlen1 mbsnrtowcs [test $SMALL_WCHAR_T = 0] configure.ac: AC_REQUIRE([gl_UCHAR_H]) -if test $SMALL_WCHAR_T = 1; then - AC_LIBOBJ([mbsrtoc32s-state]) -fi +AC_LIBOBJ([mbsrtoc32s-state]) gl_UCHAR_MODULE_INDICATOR([mbsnrtoc32s]) Makefile.am: diff --git a/modules/mbsrtoc32s b/modules/mbsrtoc32s index e7e5ee245b..64892cf2a7 100644 --- a/modules/mbsrtoc32s +++ b/modules/mbsrtoc32s @@ -10,15 +10,13 @@ Depends-on: uchar wchar verify -mbrtoc32 [test $SMALL_WCHAR_T = 1] -strnlen1 [test $SMALL_WCHAR_T = 1] +mbrtoc32 +strnlen1 mbsrtowcs [test $SMALL_WCHAR_T = 0] configure.ac: AC_REQUIRE([gl_UCHAR_H]) -if test $SMALL_WCHAR_T = 1; then - AC_LIBOBJ([mbsrtoc32s-state]) -fi +AC_LIBOBJ([mbsrtoc32s-state]) gl_UCHAR_MODULE_INDICATOR([mbsrtoc32s]) Makefile.am: |