Mercurial > hg > octave-nkf > gnulib-hg
changeset 17456:1d151e47d4d4
localecharset: make locale_charset thread-safe on Mac OS X
* lib/localcharset.c (locale_charset) [DARWIN7]: Use MB_CUR_MAX_L
instead of MB_CUR_MAX.
author | Daiki Ueno <ueno@gnu.org> |
---|---|
date | Sat, 20 Jul 2013 07:03:38 -0700 |
parents | c8b7822c1226 |
children | 09c1c72dfe80 |
files | ChangeLog lib/localcharset.c |
diffstat | 2 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2013-07-08 Daiki Ueno <ueno@gnu.org> +2013-07-20 Daiki Ueno <ueno@gnu.org> + + localecharset: make locale_charset thread-safe on Mac OS X + * lib/localcharset.c (locale_charset) [DARWIN7]: Use MB_CUR_MAX_L + instead of MB_CUR_MAX. + +2013-07-20 Daiki Ueno <ueno@gnu.org> gettext: update to version 0.18.3 * m4/intl.m4, m4/po.m4: Update from gettext-0.18.3. In particular,
--- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -65,6 +65,11 @@ # include <os2.h> #endif +/* For MB_CUR_MAX_L */ +#if defined DARWIN7 +# include <xlocale.h> +#endif + #if ENABLE_RELOCATABLE # include "relocatable.h" #else @@ -545,7 +550,7 @@ #ifdef DARWIN7 /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8" (the default codeset) does not work when MB_CUR_MAX is 1. */ - if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1) + if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1) codeset = "ASCII"; #endif