From eb54058a26da62c50dc10d61d3d298db56552753 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 28 Jan 2013 13:46:45 +0000 Subject: [PATCH] Guard deprecated g_type_init calls g_type_init was deprecated in GLib 2.35.1. In order to compile cleanly with -Werror, guard these with a suitable #if. --- doc/dbus-tutorial.xml | 2 ++ test/corrupt.c | 2 ++ test/internals/refs.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/doc/dbus-tutorial.xml b/doc/dbus-tutorial.xml index 5c385f0..2629d88 100644 --- a/doc/dbus-tutorial.xml +++ b/doc/dbus-tutorial.xml @@ -1005,7 +1005,9 @@ main (int argc, char **argv) char **name_list; char **name_list_ptr; +#if !GLIB_CHECK_VERSION(2,35,1) g_type_init (); +#endif error = NULL; connection = dbus_g_bus_get (DBUS_BUS_SESSION, diff --git a/test/corrupt.c b/test/corrupt.c index 0249590..bee39bb 100644 --- a/test/corrupt.c +++ b/test/corrupt.c @@ -359,7 +359,9 @@ main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); +#if !GLIB_CHECK_VERSION(2,35,1) g_type_init (); +#endif g_test_add ("/corrupt/tcp", Fixture, "tcp:host=127.0.0.1", setup, test_corrupt, teardown); diff --git a/test/internals/refs.c b/test/internals/refs.c index db43a4d..b2e7d18 100644 --- a/test/internals/refs.c +++ b/test/internals/refs.c @@ -586,11 +586,13 @@ int main (int argc, char **argv) { +#if !GLIB_CHECK_VERSION(2,35,1) /* In GLib >= 2.24, < 2.31 this acts like g_thread_init() but avoids * the deprecation of that function. In GLib >= 2.32 this is not * necessary at all. */ g_type_init (); +#endif g_test_init (&argc, &argv, NULL); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); -- 1.8.0