Commit a00c57b6 authored by boklm's avatar boklm Committed by Matthew Finkel
Browse files

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.
parent 1313916c
......@@ -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
......@@ -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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment