8193515: AIX: new Harfbuzz 1.7.1 version fails to compile with xlC
authormbaesken
Fri, 15 Dec 2017 14:08:15 +0100
changeset 48374 865d39b662a5
parent 48373 f9152f462cbc
child 48375 5471388067cf
child 48376 41ae5c69b09c
8193515: AIX: new Harfbuzz 1.7.1 version fails to compile with xlC Reviewed-by: prr, simonis
src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-fallback.hh
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-fallback.hh	Tue Dec 19 10:03:36 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-fallback.hh	Fri Dec 15 14:08:15 2017 +0100
@@ -77,7 +77,13 @@
 
   /* Bubble-sort or something equally good!
    * May not be good-enough for presidential candidate interviews, but good-enough for us... */
+
+#if defined(_AIX)
+  /* Workaround AIX xlC 12 compilation problems caused by the overloaded versions of 'cmp' in IntType */
+  hb_stable_sort (&glyphs[0], num_glyphs, (int(*)(const OT::GlyphID*, const OT::GlyphID *)) OT::GlyphID::cmp, &substitutes[0]);
+#else
   hb_stable_sort (&glyphs[0], num_glyphs, OT::GlyphID::cmp, &substitutes[0]);
+#endif
 
   OT::Supplier<OT::GlyphID> glyphs_supplier      (glyphs, num_glyphs);
   OT::Supplier<OT::GlyphID> substitutes_supplier (substitutes, num_glyphs);
@@ -126,7 +132,13 @@
     first_glyphs_indirection[num_first_glyphs] = first_glyph_idx;
     num_first_glyphs++;
   }
+
+#if defined(_AIX)
+  /* Workaround AIX xlC 12 compilation problems caused by the overloaded versions of 'cmp' in IntType */
+  hb_stable_sort (&first_glyphs[0], num_first_glyphs, (int(*)(const OT::GlyphID *, const OT::GlyphID *)) OT::GlyphID::cmp, &first_glyphs_indirection[0]);
+#else
   hb_stable_sort (&first_glyphs[0], num_first_glyphs, OT::GlyphID::cmp, &first_glyphs_indirection[0]);
+#endif
 
   /* Now that the first-glyphs are sorted, walk again, populate ligatures. */
   for (unsigned int i = 0; i < num_first_glyphs; i++)