From 90e7453e1b627a437b33d04e0cc10c247495928a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 29 Mar 2021 15:46:52 -0400 Subject: Fix the build with msvc Turns out the case ranges really just gcc extensions, and do not work with msvc. So, do things the hard way. Still keeping the early check for ASCII. --- pango/pango-emoji.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c index 8d5a46d6..0abb8783 100644 --- a/pango/pango-emoji.c +++ b/pango/pango-emoji.c @@ -158,14 +158,16 @@ static inline unsigned char _pango_EmojiSegmentationCategory (gunichar codepoint) { /* Specific ones first. */ + if (('a' <= codepoint && codepoint <= 'z') || + ('A' <= codepoint && codepoint <= 'Z') || + codepoint == ' ') + return kMaxEmojiScannerCategory; + + if ('0' <= codepoint && codepoint <= '9') + return KEYCAP_BASE; + switch (codepoint) { - case 'a' ... 'z': - case 'A' ... 'Z': - case ' ': - return kMaxEmojiScannerCategory; - case '0' ... '9': - return KEYCAP_BASE; case kCombiningEnclosingKeycapCharacter: return COMBINING_ENCLOSING_KEYCAP; case kCombiningEnclosingCircleBackslashCharacter: @@ -178,14 +180,15 @@ _pango_EmojiSegmentationCategory (gunichar codepoint) return VS16; case 0x1F3F4: return TAG_BASE; - case 0xE0030 ... 0xE0039: - case 0xE0061 ... 0xE007A: - return TAG_SEQUENCE; case 0xE007F: return TAG_TERM; default: ; } + if ((0xE0030 <= codepoint && codepoint <= 0xE0039) || + (0xE0061 <= codepoint && codepoint <= 0xE007A)) + return TAG_SEQUENCE; + if (_pango_Is_Emoji_Modifier_Base (codepoint)) return EMOJI_MODIFIER_BASE; if (_pango_Is_Emoji_Modifier (codepoint)) -- cgit v1.2.1