Commit 922c0d4e authored by Matthias Clasen's avatar Matthias Clasen

Don't call g_type_init if GLib is new enough

g_type_init has been deprecated in GLib 2.35.x. Use a
version check here to avoid depending on unstable GLib.
parent 4dd5a5e1
......@@ -47,7 +47,9 @@ main (int argc,
int width, height;
gpointer surface;
#if !GLIB_CHECK_VERSION (2, 35, 3)
g_type_init();
#endif
g_set_prgname ("pango-view");
setlocale (LC_ALL, "");
parse_options (argc, argv);
......
......@@ -602,8 +602,10 @@ init_modules (void)
if (g_once_init_enter (&init))
{
#if !GLIB_CHECK_VERSION (2, 35, 3)
/* Make sure that the type system is initialized */
g_type_init ();
#endif
for (i = 0; _pango_included_lang_modules[i].list; i++)
pango_module_register (&_pango_included_lang_modules[i]);
......
......@@ -132,8 +132,10 @@ pango_ft2_font_map_new (void)
PangoFT2FontMap *ft2fontmap;
FT_Error error;
#if !GLIB_CHECK_VERSION (2, 35, 3)
/* Make sure that the type system is initialized */
g_type_init ();
#endif
ft2fontmap = g_object_new (PANGO_TYPE_FT2_FONT_MAP, NULL);
......
......@@ -737,8 +737,10 @@ _pango_win32_font_map_class_init (PangoWin32FontMapClass *class)
PangoFontMap *
pango_win32_font_map_for_display (void)
{
#if !GLIB_CHECK_VERSION (2, 35, 3)
/* Make sure that the type system is initialized */
g_type_init ();
#endif
if (g_once_init_enter ((gsize*)&default_fontmap))
g_once_init_leave((gsize*)&default_fontmap, (gsize)g_object_new (PANGO_TYPE_WIN32_FONT_MAP, NULL));
......
......@@ -222,8 +222,10 @@ pango_xft_get_font_map (Display *display,
if (fontmap)
return fontmap;
#if !GLIB_CHECK_VERSION (2, 35, 3)
/* Make sure that the type system is initialized */
g_type_init ();
#endif
xftfontmap = (PangoXftFontMap *)g_object_new (PANGO_TYPE_XFT_FONT_MAP, NULL);
......
......@@ -238,7 +238,9 @@ main (int argc, char **argv)
g_option_context_free(context);
#if !GLIB_CHECK_VERSION (2, 35, 3)
g_type_init ();
#endif
contents = g_string_new ("");
g_string_append (contents,
......
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