Hash :
7903cdbf
Author :
Date :
2018-06-24T16:19:31
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.
Description:
Determine the number of screen columns needed for a character.
Files:
lib/wcwidth.c
m4/wcwidth.m4
m4/wchar_t.m4
m4/wint_t.m4
Depends-on:
wchar
extensions
wctype-h [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
localcharset [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
streq [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
uniwidth/width [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
configure.ac:
gl_FUNC_WCWIDTH
if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
AC_LIBOBJ([wcwidth])
gl_PREREQ_WCWIDTH
fi
gl_WCHAR_MODULE_INDICATOR([wcwidth])
Makefile.am:
Include:
<wchar.h>
License:
LGPLv2+
Maintainer:
all