summaryrefslogtreecommitdiff
path: root/usr/src/common/unicode
diff options
context:
space:
mode:
authoryy154373 <none@none>2008-02-13 22:04:09 -0800
committeryy154373 <none@none>2008-02-13 22:04:09 -0800
commit15d9d0b528387242011cdcc6190c9e598cfe3a07 (patch)
treea87154221448ec017940f57221572c652b39b3a2 /usr/src/common/unicode
parent4bff34e37def8a90f9194d81bc345c52ba20086a (diff)
downloadillumos-joyent-15d9d0b528387242011cdcc6190c9e598cfe3a07.tar.gz
6614991 CJK kiconv modules (kiconv phase 2)
Diffstat (limited to 'usr/src/common/unicode')
-rw-r--r--usr/src/common/unicode/uconv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/src/common/unicode/uconv.c b/usr/src/common/unicode/uconv.c
index f4e634a952..fd65fc99b5 100644
--- a/usr/src/common/unicode/uconv.c
+++ b/usr/src/common/unicode/uconv.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -140,7 +140,11 @@ static const uchar_t remaining_bytes_tbl[0x100] = {
* the first byte of a UTF-8 character. Index is remaining bytes at above of
* the character.
*/
-static const uchar_t masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
+#ifdef _KERNEL
+const uchar_t u8_masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
+#else
+static const uchar_t u8_masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
+#endif /* _KERNEL */
/*
* The following two vectors are to provide valid minimum and
@@ -716,7 +720,7 @@ uconv_u8tou16(const uchar_t *u8s, size_t *utf8len,
return (EILSEQ);
first_b = hi;
- hi = hi & masks_tbl[remaining_bytes];
+ hi = hi & u8_masks_tbl[remaining_bytes];
for (; remaining_bytes > 0; remaining_bytes--) {
/*
@@ -816,7 +820,7 @@ uconv_u8tou32(const uchar_t *u8s, size_t *utf8len,
return (EILSEQ);
first_b = hi;
- hi = hi & masks_tbl[remaining_bytes];
+ hi = hi & u8_masks_tbl[remaining_bytes];
for (; remaining_bytes > 0; remaining_bytes--) {
if (u8l >= *utf8len)