aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm/stubs/wtf/unicode/Unicode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/masm/stubs/wtf/unicode/Unicode.h')
-rw-r--r--src/3rdparty/masm/stubs/wtf/unicode/Unicode.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/3rdparty/masm/stubs/wtf/unicode/Unicode.h b/src/3rdparty/masm/stubs/wtf/unicode/Unicode.h
index d61cec5c4e..0f7f005c89 100644
--- a/src/3rdparty/masm/stubs/wtf/unicode/Unicode.h
+++ b/src/3rdparty/masm/stubs/wtf/unicode/Unicode.h
@@ -43,6 +43,7 @@
typedef unsigned char LChar;
typedef unsigned short UChar;
+typedef int32_t UChar32;
namespace Unicode {
inline UChar toLower(UChar ch) {
@@ -52,6 +53,35 @@ namespace Unicode {
inline UChar toUpper(UChar ch) {
return QChar::toUpper(ch);
}
+ inline UChar32 u_tolower(UChar32 ch) {
+ return QChar::toLower(ch);
+ }
+ inline UChar32 u_toupper(UChar32 ch) {
+ return QChar::toUpper(ch);
+ }
}
+using Unicode::u_toupper;
+using Unicode::u_tolower;
+
+#define U16_IS_LEAD(ch) QChar::isHighSurrogate((ch))
+#define U16_IS_TRAIL(ch) QChar::isLowSurrogate((ch))
+#define U16_GET_SUPPLEMENTARY(lead, trail) static_cast<UChar32>(QChar::surrogateToUcs4((lead), (trail)))
+#define U_IS_BMP(ch) ((ch) < 0x10000)
+#define U16_LENGTH(c) ((uint32_t)(c)<=0xffff ? 1 : 2)
+#define UCHAR_MAX_VALUE 0x10ffff
+
+#define U_MASK(category) (1u << (category))
+#define U_GET_GC_MASK(c) U_MASK(QChar::category((c)))
+#define U_GC_L_MASK (U_GC_LU_MASK|U_GC_LL_MASK|U_GC_LT_MASK|U_GC_LM_MASK|U_GC_LO_MASK)
+#define U_GC_LU_MASK U_MASK(QChar::Letter_Uppercase)
+#define U_GC_LL_MASK U_MASK(QChar::Letter_Lowercase)
+#define U_GC_LT_MASK U_MASK(QChar::Letter_Titlecase)
+#define U_GC_LM_MASK U_MASK(QChar::Letter_Modifier)
+#define U_GC_LO_MASK U_MASK(QChar::Letter_Other)
+#define U_GC_MN_MASK U_MASK(QChar::Mark_NonSpacing)
+#define U_GC_MC_MASK U_MASK(QChar::Mark_SpacingCombining)
+#define U_GC_ND_MASK U_MASK(QChar::Number_DecimalDigit)
+#define U_GC_PC_MASK U_MASK(QChar::Punctuation_Connector)
+
#endif // UNICODE_H