[pango] Don't call g_type_init if GLib is new enough
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Don't call g_type_init if GLib is new enough
- Date: Tue, 8 Jan 2013 02:11:42 +0000 (UTC)
commit 922c0d4ea0516419422b1d77b5b25176cc72f691
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jan 7 20:19:49 2013 -0500
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.
pango-view/viewer-main.c | 2 ++
pango/modules.c | 2 ++
pango/pangoft2-fontmap.c | 2 ++
pango/pangowin32-fontmap.c | 2 ++
pango/pangoxft-fontmap.c | 2 ++
pango/querymodules.c | 2 ++
6 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/pango-view/viewer-main.c b/pango-view/viewer-main.c
index 8ff76bb..525599a 100644
--- a/pango-view/viewer-main.c
+++ b/pango-view/viewer-main.c
@@ -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);
diff --git a/pango/modules.c b/pango/modules.c
index 24cdbf7..ca8d488 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -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]);
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index 996bbb1..dbf4980 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -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);
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index ec5b482..5dc2a82 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -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));
diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c
index aa891c5..803dc18 100644
--- a/pango/pangoxft-fontmap.c
+++ b/pango/pangoxft-fontmap.c
@@ -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);
diff --git a/pango/querymodules.c b/pango/querymodules.c
index 549003f..0c86811 100644
--- a/pango/querymodules.c
+++ b/pango/querymodules.c
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]