mbrtowc, wcwidth: Fix MT-safety bug (regression from 2018-06-23).
commit7903cdbf6022f3f28a94d484926672e865311905
authorBruno Haible <bruno@clisp.org>
Sun, 24 Jun 2018 14:19:31 +0000 (24 16:19 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 24 Jun 2018 14:19:31 +0000 (24 16:19 +0200)
treeeeb583547973a92c3daa3562466d7ce0c23024ae
parent58ee14c1ec71f63018db2e8f2d0e3d9cde4f3019
mbrtowc, wcwidth: Fix MT-safety bug (regression from 2018-06-23).

* lib/mbrtowc.c (enc_t): New enum type.
(locale_enc, locale_enc_cached): New functions.
(mbrtowc): Eliminate static variables. Use locale_enc_cached instead.
* lib/wcwidth.c (is_locale_utf8, is_locale_utf8_cached): New functions.
(wcwidth): Eliminate static variables. Use is_locale_utf8_cached
instead.
* m4/mbrtowc.m4 (gl_PREREQ_MBRTOWC): Require AC_C_INLINE.
* m4/wcwidth.m4 (gl_PREREQ_WCWIDTH): New macro.
* modules/wcwidth (configure.ac): Invoke it.
ChangeLog
lib/mbrtowc.c
lib/wcwidth.c
m4/mbrtowc.m4
m4/wcwidth.m4
modules/wcwidth