Bug 1324780 - Cherry-pick commit 1c98ff87c76536553e53c131e75aba33033ee3a0 from upstream harfbuzz, to fix build failure with older glib. r=jrmuizel a=jcristau
authorJonathan Kew <jkew@mozilla.com>
Thu, 05 Jan 2017 06:37:45 +0000
changeset 460083 c61930c496738e059dca43c650567680f8e748d5
parent 460082 23eae10f94cb96e2d9abe166e073fb0584c8bc3c
child 460084 053902fa07fb5129316c1c4e77e13d5baa929244
push id41361
push userbmo:ttromey@mozilla.com
push dateThu, 12 Jan 2017 22:32:11 +0000
reviewersjrmuizel, jcristau
bugs1324780
milestone52.0a2
Bug 1324780 - Cherry-pick commit 1c98ff87c76536553e53c131e75aba33033ee3a0 from upstream harfbuzz, to fix build failure with older glib. r=jrmuizel a=jcristau
gfx/harfbuzz/configure.ac
gfx/harfbuzz/src/hb-glib.cc
gfx/harfbuzz/src/hb-glib.h
--- a/gfx/harfbuzz/configure.ac
+++ b/gfx/harfbuzz/configure.ac
@@ -142,17 +142,17 @@ AM_CONDITIONAL(HAVE_FALLBACK, $have_fall
 
 dnl ===========================================================================
 
 AC_ARG_WITH(glib,
 	[AS_HELP_STRING([--with-glib=@<:@yes/no/auto@:>@],
 			[Use glib @<:@default=auto@:>@])],,
 	[with_glib=auto])
 have_glib=false
-GLIB_DEPS="glib-2.0 >= 2.38"
+GLIB_DEPS="glib-2.0 >= 2.19.1"
 AC_SUBST(GLIB_DEPS)
 if test "x$with_glib" = "xyes" -o "x$with_glib" = "xauto"; then
 	PKG_CHECK_MODULES(GLIB, $GLIB_DEPS, have_glib=true, :)
 fi
 if test "x$with_glib" = "xyes" -a "x$have_glib" != "xtrue"; then
 	AC_MSG_ERROR([glib support requested but glib-2.0 not found])
 fi
 if $have_glib; then
--- a/gfx/harfbuzz/src/hb-glib.cc
+++ b/gfx/harfbuzz/src/hb-glib.cc
@@ -377,24 +377,26 @@ hb_glib_get_unicode_funcs (void)
       HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
 #undef HB_UNICODE_FUNC_IMPLEMENT
     }
   };
 
   return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
 }
 
+#if GLIB_CHECK_VERSION(2,31,10)
 /**
  * hb_glib_blob_create:
  *
  * Since: 0.9.38
  **/
 hb_blob_t *
 hb_glib_blob_create (GBytes *gbytes)
 {
   gsize size = 0;
   gconstpointer data = g_bytes_get_data (gbytes, &size);
   return hb_blob_create ((const char *) data,
 			 size,
 			 HB_MEMORY_MODE_READONLY,
 			 g_bytes_ref (gbytes),
 			 (hb_destroy_func_t) g_bytes_unref);
 }
+#endif
--- a/gfx/harfbuzz/src/hb-glib.h
+++ b/gfx/harfbuzz/src/hb-glib.h
@@ -41,15 +41,16 @@ hb_glib_script_to_script (GUnicodeScript
 
 HB_EXTERN GUnicodeScript
 hb_glib_script_from_script (hb_script_t script);
 
 
 HB_EXTERN hb_unicode_funcs_t *
 hb_glib_get_unicode_funcs (void);
 
+#if GLIB_CHECK_VERSION(2,31,10)
 HB_EXTERN hb_blob_t *
 hb_glib_blob_create (GBytes *gbytes);
-
+#endif
 
 HB_END_DECLS
 
 #endif /* HB_GLIB_H */