summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-06-16 06:18:00 +0000
committerRich Felker <dalias@aerifal.cx>2015-06-16 06:18:00 +0000
commitf22a9edaf8a6f2ca1d314d18b3785558279a5c03 (patch)
tree908b30e255314b2515364c80cfcca2912cb5d332 /src/internal
parent16f18d036d9a7bf590ee6eb86785c0a9658220b6 (diff)
downloadmusl-f22a9edaf8a6f2ca1d314d18b3785558279a5c03.tar.gz
byte-based C locale, phase 3: make MB_CUR_MAX variable to activate code
this patch activates the new byte-based C locale (high bytes treated as abstract code unit "characters" rather than decoded as multibyte characters) by making the value of MB_CUR_MAX depend on the active locale. for the C locale, the LC_CTYPE category pointer is null, yielding a value of 1. all other locales yield a value of 4.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/locale_impl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/internal/locale_impl.h b/src/internal/locale_impl.h
index 85db7933..f5e4d9b4 100644
--- a/src/internal/locale_impl.h
+++ b/src/internal/locale_impl.h
@@ -34,4 +34,7 @@ const char *__lctrans_cur(const char *);
#define CURRENT_UTF8 (!!__pthread_self()->locale->cat[LC_CTYPE])
+#undef MB_CUR_MAX
+#define MB_CUR_MAX (CURRENT_UTF8 ? 4 : 1)
+
#endif