break.c: Fix compilation against newer GLib versions
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 16 Sep 2011 07:54:42 +0000 (15:54 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 16 Sep 2011 16:40:28 +0000 (00:40 +0800)
G_UNICODE_COMBINING_MARK was renamed as G_UNICODE_SPACING_MARK soon after
the GLib 2.29.14 release, so fix that in break.c and pango-ot-info.c.

To support GLib on and before 2.29.14, a convenience definition for
G_UNICODE_SPACING_MARK is defined.

pango/break.c
pango/pango-ot-info.c

index b17dc60..8acf3fa 100644 (file)
 #define PARAGRAPH_SEPARATOR 0x2029
 #define PARAGRAPH_SEPARATOR_STRING "\xE2\x80\xA9"
 
+#if (!GLIB_CHECK_VERSION (2,29,15))
+#define G_UNICODE_SPACING_MARK G_UNICODE_COMBINING_MARK
+#endif
+
 /* See http://www.unicode.org/unicode/reports/tr14/ if you hope
  * to understand the line breaking code.
  */
@@ -687,7 +691,7 @@ pango_default_break (const gchar   *text,
              GB_type = GB_Extend; /* Other_Grapheme_Extend */
            break;
 
-         case G_UNICODE_COMBINING_MARK:
+         case G_UNICODE_SPACING_MARK:
            GB_type = GB_SpacingMark; /* SpacingMark */
            if (wc >= 0x0900)
              {
@@ -796,7 +800,7 @@ pango_default_break (const gchar   *text,
                  break;
 
                case G_UNICODE_FORMAT:
-               case G_UNICODE_COMBINING_MARK:
+               case G_UNICODE_SPACING_MARK:
                case G_UNICODE_ENCLOSING_MARK:
                case G_UNICODE_NON_SPACING_MARK:
                  WB_type = WB_ExtendFormat; /* Extend, Format */
@@ -1121,7 +1125,7 @@ pango_default_break (const gchar   *text,
          /* Check for a word end */
          switch ((int) type)
            {
-           case G_UNICODE_COMBINING_MARK:
+           case G_UNICODE_SPACING_MARK:
            case G_UNICODE_ENCLOSING_MARK:
            case G_UNICODE_NON_SPACING_MARK:
            case G_UNICODE_FORMAT:
@@ -1636,7 +1640,7 @@ pango_default_break (const gchar   *text,
 
       /* wc might not be a valid Unicode base character, but really all we
        * need to know is the last non-combining character */
-      if (type != G_UNICODE_COMBINING_MARK &&
+      if (type != G_UNICODE_SPACING_MARK &&
          type != G_UNICODE_ENCLOSING_MARK &&
          type != G_UNICODE_NON_SPACING_MARK)
        base_character = wc;
index 7bc249b..e5d9c64 100644 (file)
 #include "pango-impl-utils.h"
 #include FT_TRUETYPE_TABLES_H
 
+#if (!GLIB_CHECK_VERSION(2,29,15))
+#define G_UNICODE_SPACING_MARK G_UNICODE_COMBINING_MARK
+#endif
+
 static void pango_ot_info_finalize   (GObject *object);
 
 static void synthesize_class_def (PangoOTInfo *info);
@@ -183,7 +187,7 @@ get_glyph_class (gunichar        charcode,
 
   switch ((int) g_unichar_type (charcode))
     {
-    case G_UNICODE_COMBINING_MARK:
+    case G_UNICODE_SPACING_MARK:
     case G_UNICODE_ENCLOSING_MARK:
     case G_UNICODE_NON_SPACING_MARK:
       *class = HB_OT_LAYOUT_GLYPH_CLASS_MARK;          /* Mark glyph (non-spacing combining glyph) */