diff --git a/intl/lwbrk/src/th_char.h b/intl/lwbrk/src/th_char.h index cb710fc21573..05a969b83ced 100644 --- a/intl/lwbrk/src/th_char.h +++ b/intl/lwbrk/src/th_char.h @@ -16,7 +16,15 @@ purpose. It is provided "as is" without express or implied warranty. typedef unsigned char tis_char; #ifdef TH_UNICODE +/* + * The char16_t type is only usable in C++ code, so we need this ugly hack to + * select a binary compatible C type for the expat C code to use. + */ +#ifdef __cplusplus typedef char16_t th_char; +#else +typedef uint16_t th_char; +#endif #define TH_THAIBEGIN_ 0x0e00 #define th_isthai(c) (0x0e00 <= (c) && (c) <= 0x0e5f) #else