summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-29 15:46:52 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-29 15:46:52 -0400
commit90e7453e1b627a437b33d04e0cc10c247495928a (patch)
tree6a0769450c42e3c858360ecef419df49827aded4
parentb86ded710d391b78842c607962d9a2281596b862 (diff)
downloadpango-fix-msvc-build.tar.gz
Fix the build with msvcfix-msvc-build
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.
-rw-r--r--pango/pango-emoji.c21
1 files 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))