commit d2c6976d0c0196da4463766e9d810b8d5bba5fe0 Author: Georg Koppen gk@torproject.org Date: Thu Sep 17 08:46:57 2020 +0000
Revert "Bug 21907: Fix runtime error on CentOS 6"
This reverts commit a00c57b6116329b5376bbf3f4212e5d2a3fece07.
The 10.0 series is the last one with CentOS 6 support. --- gfx/harfbuzz/src/hb-glib.cc | 53 +++++++++++++++++++++++++++++++++++++++++++++ gfx/harfbuzz/src/hb-glib.h | 5 +++++ 2 files changed, 58 insertions(+)
diff --git a/gfx/harfbuzz/src/hb-glib.cc b/gfx/harfbuzz/src/hb-glib.cc index 2fd39610203d..058f65ae69c3 100644 --- a/gfx/harfbuzz/src/hb-glib.cc +++ b/gfx/harfbuzz/src/hb-glib.cc @@ -49,6 +49,7 @@ **/
+#if !GLIB_CHECK_VERSION(2,29,14) static const hb_script_t glib_script_to_script[] = { @@ -170,6 +171,7 @@ glib_script_to_script[] = HB_SCRIPT_SORA_SOMPENG, HB_SCRIPT_TAKRI }; +#endif
/** * hb_glib_script_to_script: @@ -185,6 +187,9 @@ glib_script_to_script[] = hb_script_t hb_glib_script_to_script (GUnicodeScript script) { +#if GLIB_CHECK_VERSION(2,29,14) + return (hb_script_t) g_unicode_script_to_iso15924 (script); +#else if (likely ((unsigned int) script < ARRAY_LENGTH (glib_script_to_script))) return glib_script_to_script[script];
@@ -192,6 +197,7 @@ hb_glib_script_to_script (GUnicodeScript script) return HB_SCRIPT_INVALID;
return HB_SCRIPT_UNKNOWN; +#endif }
/** @@ -208,6 +214,9 @@ hb_glib_script_to_script (GUnicodeScript script) GUnicodeScript hb_glib_script_from_script (hb_script_t script) { +#if GLIB_CHECK_VERSION(2,29,14) + return g_unicode_script_from_iso15924 (script); +#else unsigned int count = ARRAY_LENGTH (glib_script_to_script); for (unsigned int i = 0; i < count; i++) if (glib_script_to_script[i] == script) @@ -217,6 +226,7 @@ hb_glib_script_from_script (hb_script_t script) return G_UNICODE_SCRIPT_INVALID_CODE;
return G_UNICODE_SCRIPT_UNKNOWN; +#endif }
@@ -263,6 +273,10 @@ hb_glib_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t *ab, void *user_data HB_UNUSED) { +#if GLIB_CHECK_VERSION(2,29,12) + return g_unichar_compose (a, b, ab); +#endif + /* We don't ifdef-out the fallback code such that compiler always * sees it and makes sure it's compilable. */
@@ -296,6 +310,10 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t *b, void *user_data HB_UNUSED) { +#if GLIB_CHECK_VERSION(2,29,12) + return g_unichar_decompose (ab, a, b); +#endif + /* We don't ifdef-out the fallback code such that compiler always * sees it and makes sure it's compilable. */
@@ -397,4 +415,39 @@ hb_glib_get_unicode_funcs () return static_glib_funcs.get_unconst (); }
+ + +#if GLIB_CHECK_VERSION(2,31,10) + +static void +_hb_g_bytes_unref (void *data) +{ + g_bytes_unref ((GBytes *) data); +} + +/** + * hb_glib_blob_create: + * @gbytes: the GBytes structure to work upon + * + * Creates an #hb_blob_t blob from the specified + * GBytes data structure. + * + * Return value: (transfer full): the new #hb_blob_t blob object + * + * 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_g_bytes_unref); +} +#endif + + #endif diff --git a/gfx/harfbuzz/src/hb-glib.h b/gfx/harfbuzz/src/hb-glib.h index 4adbd7c332cb..5f04183ba19f 100644 --- a/gfx/harfbuzz/src/hb-glib.h +++ b/gfx/harfbuzz/src/hb-glib.h @@ -46,6 +46,11 @@ 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 */
tbb-commits@lists.torproject.org