[pango/fix-msvc-build] Fix the build with msvc




commit 90e7453e1b627a437b33d04e0cc10c247495928a
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 29 15:46:52 2021 -0400

    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))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]