summaryrefslogtreecommitdiffstats
path: root/Source/cm_utf8.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-25 15:26:36 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-25 19:03:03 (GMT)
commit690acadc17263621f5361d48057c6f938e698a58 (patch)
treef82f1104363a018cba98a166acd98988a6c13150 /Source/cm_utf8.c
parentae5f98a5e36da8cf3c75625ffb9a1d34aa2407cb (diff)
downloadCMake-690acadc17263621f5361d48057c6f938e698a58.zip
CMake-690acadc17263621f5361d48057c6f938e698a58.tar.gz
CMake-690acadc17263621f5361d48057c6f938e698a58.tar.bz2
codecvt: Re-implement do_out and do_unshift
The previous implementation assumed that only one byte would be given in the `from` buffer by the caller at a time. This may be true for MSVC but is not for the GNU library on Windows. Re-implement these methods to handle more than one byte per call. Also simplify the state management by keeping all state between calls directly in the `mbstate_t` argument instead of using it to index our own heap-allocated state. Fixes: #16893
Diffstat (limited to 'Source/cm_utf8.c')
-rw-r--r--Source/cm_utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c
index 6c49b52..52af4a6 100644
--- a/Source/cm_utf8.c
+++ b/Source/cm_utf8.c
@@ -15,7 +15,7 @@
*/
/* Number of leading ones before a zero in the byte. */
-static unsigned char const cm_utf8_ones[256] = {
+unsigned char const cm_utf8_ones[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,