[tor-commits] [tor-browser/tor-browser-78.11.0esr-10.0-1] Bug 21907: Fix runtime error on CentOS 6

sysrqb at torproject.org sysrqb at torproject.org
Fri May 28 16:30:09 UTC 2021


commit 375016fb074be6949f23ee6ad3e62a7accda0117
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Apr 10 16:07:23 2017 +0200

    Bug 21907: Fix runtime error on CentOS 6
    
    In Mozilla bug 1324780, support for building with glib 2.28 (the version
    available in CentOS 6) was added. However we are building on Debian
    Wheezy which has glib 2.32. We fix that by backing out all glib > 2.28
    code paths.
---
 gfx/harfbuzz/src/hb-glib.cc | 53 ---------------------------------------------
 gfx/harfbuzz/src/hb-glib.h  |  5 -----
 2 files changed, 58 deletions(-)

diff --git a/gfx/harfbuzz/src/hb-glib.cc b/gfx/harfbuzz/src/hb-glib.cc
index 058f65ae69c3..2fd39610203d 100644
--- a/gfx/harfbuzz/src/hb-glib.cc
+++ b/gfx/harfbuzz/src/hb-glib.cc
@@ -49,7 +49,6 @@
  **/
 
 
-#if !GLIB_CHECK_VERSION(2,29,14)
 static const hb_script_t
 glib_script_to_script[] =
 {
@@ -171,7 +170,6 @@ glib_script_to_script[] =
   HB_SCRIPT_SORA_SOMPENG,
   HB_SCRIPT_TAKRI
 };
-#endif
 
 /**
  * hb_glib_script_to_script:
@@ -187,9 +185,6 @@ 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];
 
@@ -197,7 +192,6 @@ hb_glib_script_to_script (GUnicodeScript script)
     return HB_SCRIPT_INVALID;
 
   return HB_SCRIPT_UNKNOWN;
-#endif
 }
 
 /**
@@ -214,9 +208,6 @@ 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)
@@ -226,7 +217,6 @@ hb_glib_script_from_script (hb_script_t script)
     return G_UNICODE_SCRIPT_INVALID_CODE;
 
   return G_UNICODE_SCRIPT_UNKNOWN;
-#endif
 }
 
 
@@ -273,10 +263,6 @@ 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. */
 
@@ -310,10 +296,6 @@ 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. */
 
@@ -415,39 +397,4 @@ 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 5f04183ba19f..4adbd7c332cb 100644
--- a/gfx/harfbuzz/src/hb-glib.h
+++ b/gfx/harfbuzz/src/hb-glib.h
@@ -46,11 +46,6 @@ 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 */





More information about the tor-commits mailing list