diff options
author | Matthias Clasen <mclasen@redhat.com> | 2012-12-28 00:23:03 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2012-12-28 00:23:03 -0500 |
commit | d3f583a6cd9d83bc5862f1b248527bbeaceb93af (patch) | |
tree | 0f69d0bc74a3039d82e587f270fe1085eb92d68b | |
parent | 28d8d0a72ad4f1ebaddfede9497210d08540408b (diff) | |
download | gdk-pixbuf-d3f583a6cd9d83bc5862f1b248527bbeaceb93af.tar.gz |
Avoid deprecation warnings for g_type_init
Add a version check to avoid depending on unstable GLib.
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-csource.c | 4 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-pixdata.c | 4 | ||||
-rw-r--r-- | gdk-pixbuf/make-inline-pixbuf.c | 7 | ||||
-rw-r--r-- | gdk-pixbuf/test-gdk-pixbuf.c | 4 |
4 files changed, 13 insertions, 6 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-csource.c b/gdk-pixbuf/gdk-pixbuf-csource.c index 78af373d5..642d5ee36 100644 --- a/gdk-pixbuf/gdk-pixbuf-csource.c +++ b/gdk-pixbuf/gdk-pixbuf-csource.c @@ -76,8 +76,10 @@ main (int argc, GError *error = NULL; gchar *infilename; - /* initialize glib/GdkPixbuf */ +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* initialize gtype */ g_type_init (); +#endif /* parse args and do fast exits */ parse_args (&argc, &argv); diff --git a/gdk-pixbuf/gdk-pixbuf-pixdata.c b/gdk-pixbuf/gdk-pixbuf-pixdata.c index df76272f7..4c5053c04 100644 --- a/gdk-pixbuf/gdk-pixbuf-pixdata.c +++ b/gdk-pixbuf/gdk-pixbuf-pixdata.c @@ -55,8 +55,10 @@ main (int argc, guint8 *data; guint data_len; - /* initialize glib/GdkPixbuf */ +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* initialize GType */ g_type_init (); +#endif /* parse args and do fast exits */ parse_args (&argc, &argv); diff --git a/gdk-pixbuf/make-inline-pixbuf.c b/gdk-pixbuf/make-inline-pixbuf.c index e2e1f6100..d48c155c7 100644 --- a/gdk-pixbuf/make-inline-pixbuf.c +++ b/gdk-pixbuf/make-inline-pixbuf.c @@ -152,10 +152,11 @@ main (int argc, char **argv) FILE *outfile; gchar *outfilename; int i; - + +#if !GLIB_CHECK_VERSION (2, 35, 3) g_type_init (); - - +#endif + if (argc < 4) usage (); diff --git a/gdk-pixbuf/test-gdk-pixbuf.c b/gdk-pixbuf/test-gdk-pixbuf.c index b2d565a90..27adffec4 100644 --- a/gdk-pixbuf/test-gdk-pixbuf.c +++ b/gdk-pixbuf/test-gdk-pixbuf.c @@ -230,8 +230,10 @@ main (int argc, char **argv) result = EXIT_SUCCESS; +#if !GLIB_CHECK_VERSION (2, 35, 3) g_type_init (); - +#endif + /* Run some tests. */ if (!simple_composite_test ()) { result = EXIT_FAILURE; |