Hash :
11fe27f7
Author :
Date :
2023-03-30T13:25:20
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.
Files:
tests/test-btowc1.sh
tests/test-btowc2.sh
tests/test-btowc3.sh
tests/test-btowc.c
tests/signature.h
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
gt_LOCALE_FR_UTF8
Makefile.am:
TESTS += test-btowc1.sh test-btowc2.sh test-btowc3.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-btowc
test_btowc_LDADD = $(LDADD) $(SETLOCALE_LIB)