summaryrefslogtreecommitdiff
path: root/modules/btowc
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-03-30 13:25:20 +0200
committerBruno Haible <bruno@clisp.org>2023-03-30 19:39:46 +0200
commit11fe27f76c63c14b6f88c815b656f3f72d37ea41 (patch)
tree8a4661c83efd2d544ff729373b33955d54054d47 /modules/btowc
parent60745587a2e0073df7fe4cb1ec462f423c8f2bb2 (diff)
downloadgnulib-11fe27f76c63c14b6f88c815b656f3f72d37ea41.tar.gz
btowc: Fix behaviour in the C locale.
* lib/btowc.c: Include <string.h> (btowc): Use mbrtowc instead of mbtowc when possible. * m4/btowc.m4 (gl_FUNC_BTOWC): Test for the mingw bug in the C locale. Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, override also btowc. (gl_PREREQ_BTOWC): Test whether mbrtowc exists. * modules/btowc (Files): Add m4/mbrtowc.m4. (Depends-on): Add mbrtowc. * tests/test-btowc.c (main): Add a test of the C locale, based on tests/test-mbrtowc.c. * tests/test-btowc3.sh: New file, based on tests/test-mbrtowc5.sh. * modules/btowc-tests (Files): Add it. (Makefile.am): Test it. * doc/posix-functions/btowc.texi: Mention the two C locale behaviour bugs and that they are worked around.
Diffstat (limited to 'modules/btowc')
-rw-r--r--modules/btowc2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/btowc b/modules/btowc
index 80d786cfa6..4788b3ec13 100644
--- a/modules/btowc
+++ b/modules/btowc
@@ -4,11 +4,13 @@ btowc() function: convert unibyte character to wide character.
Files:
lib/btowc.c
m4/btowc.m4
+m4/mbrtowc.m4
m4/locale-fr.m4
Depends-on:
wchar
mbtowc [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1]
+mbrtowc [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1]
configure.ac:
gl_FUNC_BTOWC