summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2014-05-27 16:47:15 +0200
committerJiří Klimeš <jklimes@redhat.com>2014-05-27 16:58:21 +0200
commit98ae6e06d25ad9359670e5a9260e1bba9e913fcb (patch)
tree18dde4f3f7861b280f926c937abb2ec162e784b0
parentaba55670cc8af780df0af89002272b612f49a54e (diff)
downloadNetworkManager-98ae6e06d25ad9359670e5a9260e1bba9e913fcb.tar.gz
all: g_type_init() has been deprecated in GLib 2.35.0
g_type_init() deprecation: https://bugzilla.gnome.org/show_bug.cgi?id=686161
-rw-r--r--callouts/nm-avahi-autoipd-action.c2
-rw-r--r--callouts/nm-dispatcher-action.c3
-rw-r--r--callouts/tests/test-dispatcher-envp.c3
-rw-r--r--cli/src/nmcli.c2
-rw-r--r--examples/C/glib/add-connection-dbus-glib.c2
-rw-r--r--examples/C/glib/add-connection-libnm-glib.c2
-rw-r--r--examples/C/glib/get-active-connections-dbus-glib.c2
-rw-r--r--examples/C/glib/get-ap-info-libnm-glib.c2
-rw-r--r--examples/C/glib/list-connections-dbus-glib.c2
-rw-r--r--examples/C/glib/list-connections-libnm-glib.c2
-rw-r--r--examples/C/glib/monitor-nm-running-GDBus.c2
-rw-r--r--examples/C/glib/monitor-nm-running-dbus-glib.c2
-rw-r--r--examples/C/glib/monitor-nm-state-GDBus.c2
-rw-r--r--libnm-glib/libnm-glib-test.c2
-rw-r--r--libnm-glib/libnm_glib.c3
-rw-r--r--libnm-glib/tests/test-nm-client.c2
-rw-r--r--libnm-glib/tests/test-remote-settings-client.c2
-rw-r--r--libnm-util/nm-param-spec-specialized.c3
-rw-r--r--libnm-util/nm-setting.c2
-rw-r--r--libnm-util/tests/test-general.c2
-rw-r--r--libnm-util/tests/test-secrets.c2
-rw-r--r--libnm-util/tests/test-setting-8021x.c2
-rw-r--r--libnm-util/tests/test-setting-dcb.c3
-rw-r--r--libnm-util/tests/test-settings-defaults.c2
-rw-r--r--src/config/tests/test-config.c3
-rw-r--r--src/devices/wifi/tests/test-wifi-ap-utils.c3
-rw-r--r--src/dhcp-manager/tests/test-dhcp-dhclient.c2
-rw-r--r--src/dnsmasq-manager/tests/test-dnsmasq-utils.c2
-rw-r--r--src/main.c3
-rw-r--r--src/platform/tests/dump.c2
-rw-r--r--src/platform/tests/monitor.c3
-rw-r--r--src/platform/tests/platform.c2
-rw-r--r--src/platform/tests/test-common.c4
-rw-r--r--src/ppp-manager/nm-pppd-plugin.c2
-rw-r--r--src/rdisc/tests/rdisc.c3
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c2
-rw-r--r--src/settings/plugins/ifnet/tests/test_all.c3
-rw-r--r--src/settings/plugins/ifupdown/tests/test-ifupdown.c2
-rw-r--r--src/settings/plugins/keyfile/tests/test-keyfile.c3
-rw-r--r--src/settings/tests/test-wired-defname.c3
-rw-r--r--src/supplicant-manager/tests/test-supplicant-config.c2
-rw-r--r--src/tests/test-dcb.c2
-rw-r--r--src/tests/test-dhcp-options.c2
-rw-r--r--src/tests/test-general.c2
-rw-r--r--src/tests/test-ip4-config.c2
-rw-r--r--src/tests/test-resolvconf-capture.c2
-rw-r--r--test/nm-dhcp-opt-test.c2
-rw-r--r--test/nm-online.c2
-rw-r--r--tools/generate-settings-spec.c2
49 files changed, 112 insertions, 1 deletions
diff --git a/callouts/nm-avahi-autoipd-action.c b/callouts/nm-avahi-autoipd-action.c
index 440efadee4..f84eed7126 100644
--- a/callouts/nm-avahi-autoipd-action.c
+++ b/callouts/nm-avahi-autoipd-action.c
@@ -90,7 +90,9 @@ main (int argc, char *argv[])
dbus_bool_t result;
char *event, *iface, *address;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (argc != 4) {
fprintf (stderr, "Error: expected 3 arguments (event, interface, address).\n");
diff --git a/callouts/nm-dispatcher-action.c b/callouts/nm-dispatcher-action.c
index 23ae110772..337a5c616c 100644
--- a/callouts/nm-dispatcher-action.c
+++ b/callouts/nm-dispatcher-action.c
@@ -689,7 +689,10 @@ main (int argc, char **argv)
g_option_context_free (opt_ctx);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM));
g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT));
diff --git a/callouts/tests/test-dispatcher-envp.c b/callouts/tests/test-dispatcher-envp.c
index 3ac0c9b56e..8dd18430ed 100644
--- a/callouts/tests/test-dispatcher-envp.c
+++ b/callouts/tests/test-dispatcher-envp.c
@@ -642,7 +642,10 @@ main (int argc, char **argv)
g_assert (argc > 1);
g_test_init (&argc, &argv, NULL);
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_add_data_func ("/dispatcher/old_up", argv[1], (GTestDataFunc) test_old_up);
g_test_add_data_func ("/dispatcher/old_down", argv[1], (GTestDataFunc) test_old_down);
diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c
index 5579ff45f5..1e447485ba 100644
--- a/cli/src/nmcli.c
+++ b/cli/src/nmcli.c
@@ -426,7 +426,9 @@ main (int argc, char *argv[])
textdomain (GETTEXT_PACKAGE);
#endif
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
nmc_init (&nm_cli);
g_idle_add (start, &args_info);
diff --git a/examples/C/glib/add-connection-dbus-glib.c b/examples/C/glib/add-connection-dbus-glib.c
index c7c1a3f111..354dcb75a4 100644
--- a/examples/C/glib/add-connection-dbus-glib.c
+++ b/examples/C/glib/add-connection-dbus-glib.c
@@ -102,8 +102,10 @@ int main (int argc, char *argv[])
DBusGConnection *bus;
DBusGProxy *proxy;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
/* Get system bus */
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
diff --git a/examples/C/glib/add-connection-libnm-glib.c b/examples/C/glib/add-connection-libnm-glib.c
index 510e06ee7a..28eadf8d3a 100644
--- a/examples/C/glib/add-connection-libnm-glib.c
+++ b/examples/C/glib/add-connection-libnm-glib.c
@@ -110,8 +110,10 @@ int main (int argc, char *argv[])
NMRemoteSettings *settings;
GMainLoop *loop;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
loop = g_main_loop_new (NULL, FALSE);
diff --git a/examples/C/glib/get-active-connections-dbus-glib.c b/examples/C/glib/get-active-connections-dbus-glib.c
index d6bd15c708..86adbde3e8 100644
--- a/examples/C/glib/get-active-connections-dbus-glib.c
+++ b/examples/C/glib/get-active-connections-dbus-glib.c
@@ -223,8 +223,10 @@ int main (int argc, char *argv[])
DBusGConnection *bus;
DBusGProxy *props_proxy;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
/* Get system bus */
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
diff --git a/examples/C/glib/get-ap-info-libnm-glib.c b/examples/C/glib/get-ap-info-libnm-glib.c
index c144be23eb..f38ca9109f 100644
--- a/examples/C/glib/get-ap-info-libnm-glib.c
+++ b/examples/C/glib/get-ap-info-libnm-glib.c
@@ -200,8 +200,10 @@ int main (int argc, char *argv[])
const GPtrArray *devices;
int i;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
/* Get system bus */
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
diff --git a/examples/C/glib/list-connections-dbus-glib.c b/examples/C/glib/list-connections-dbus-glib.c
index 3fd3fe765d..e17b8dc7d5 100644
--- a/examples/C/glib/list-connections-dbus-glib.c
+++ b/examples/C/glib/list-connections-dbus-glib.c
@@ -67,8 +67,10 @@ int main (int argc, char *argv[])
DBusGConnection *bus;
DBusGProxy *proxy;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
/* Get system bus */
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
diff --git a/examples/C/glib/list-connections-libnm-glib.c b/examples/C/glib/list-connections-libnm-glib.c
index 921dd683c2..29f105c60f 100644
--- a/examples/C/glib/list-connections-libnm-glib.c
+++ b/examples/C/glib/list-connections-libnm-glib.c
@@ -153,8 +153,10 @@ int main (int argc, char *argv[])
{
DBusGConnection *bus;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
/* Get system bus */
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
diff --git a/examples/C/glib/monitor-nm-running-GDBus.c b/examples/C/glib/monitor-nm-running-GDBus.c
index 5cc7232449..9e38d4c70d 100644
--- a/examples/C/glib/monitor-nm-running-GDBus.c
+++ b/examples/C/glib/monitor-nm-running-GDBus.c
@@ -57,8 +57,10 @@ main (int argc, char *argv[])
GMainLoop *loop;
GBusNameWatcherFlags flags;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
g_print ("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n");
g_print ("===================================================\n");
diff --git a/examples/C/glib/monitor-nm-running-dbus-glib.c b/examples/C/glib/monitor-nm-running-dbus-glib.c
index 3290fb1acd..0b01a57f06 100644
--- a/examples/C/glib/monitor-nm-running-dbus-glib.c
+++ b/examples/C/glib/monitor-nm-running-dbus-glib.c
@@ -71,8 +71,10 @@ main (int argc, char *argv[])
GError *err = NULL;
gboolean nm_running;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
g_print ("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n");
g_print ("===================================================\n");
diff --git a/examples/C/glib/monitor-nm-state-GDBus.c b/examples/C/glib/monitor-nm-state-GDBus.c
index a3c5d8e131..f401972536 100644
--- a/examples/C/glib/monitor-nm-state-GDBus.c
+++ b/examples/C/glib/monitor-nm-state-GDBus.c
@@ -91,8 +91,10 @@ main (int argc, char *argv[])
GDBusProxyFlags flags;
GDBusProxy *proxy;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
+#endif
/* Monitor 'StateChanged' signal on 'org.freedesktop.NetworkManager' interface */
g_print ("Monitor NetworkManager's state\n");
diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c
index 48a8ff1692..36520f50c3 100644
--- a/libnm-glib/libnm-glib-test.c
+++ b/libnm-glib/libnm-glib-test.c
@@ -390,7 +390,9 @@ main (int argc, char *argv[])
{
NMClient *client;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
client = nm_client_new ();
if (!client) {
diff --git a/libnm-glib/libnm_glib.c b/libnm-glib/libnm_glib.c
index 2abd6ab881..a2a6d26ed0 100644
--- a/libnm-glib/libnm_glib.c
+++ b/libnm-glib/libnm_glib.c
@@ -493,7 +493,10 @@ libnm_glib_init (void)
{
libnm_glib_ctx *ctx = NULL;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
if (!g_thread_supported ())
g_thread_init (NULL);
dbus_g_thread_init ();
diff --git a/libnm-glib/tests/test-nm-client.c b/libnm-glib/tests/test-nm-client.c
index 5bbb1cd41c..b181c8fa3a 100644
--- a/libnm-glib/tests/test-nm-client.c
+++ b/libnm-glib/tests/test-nm-client.c
@@ -931,7 +931,9 @@ main (int argc, char **argv)
{
g_assert (argc == 3);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
diff --git a/libnm-glib/tests/test-remote-settings-client.c b/libnm-glib/tests/test-remote-settings-client.c
index 1299ce8f85..e3ef7f22ef 100644
--- a/libnm-glib/tests/test-remote-settings-client.c
+++ b/libnm-glib/tests/test-remote-settings-client.c
@@ -352,7 +352,9 @@ main (int argc, char **argv)
g_assert (argc == 3);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c
index beb19aece4..27e498b5be 100644
--- a/libnm-util/nm-param-spec-specialized.c
+++ b/libnm-util/nm-param-spec-specialized.c
@@ -954,7 +954,10 @@ main (int argc, char *argv[])
{
DBusGConnection *bus;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
compare_ints ();
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index 9407c63cce..0adb8055d2 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -103,7 +103,9 @@ static void __attribute__((constructor))
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
_nm_value_transforms_register ();
registered_settings = g_hash_table_new (g_str_hash, g_str_equal);
registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal);
diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c
index b6fc2c8203..c65bd6cad1 100644
--- a/libnm-util/tests/test-general.c
+++ b/libnm-util/tests/test-general.c
@@ -2489,7 +2489,9 @@ int main (int argc, char **argv)
GError *error = NULL;
char *base;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/libnm-util/tests/test-secrets.c b/libnm-util/tests/test-secrets.c
index 5a18bebe6d..19c41943dc 100644
--- a/libnm-util/tests/test-secrets.c
+++ b/libnm-util/tests/test-secrets.c
@@ -723,7 +723,9 @@ int main (int argc, char **argv)
GError *error = NULL;
char *base;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/libnm-util/tests/test-setting-8021x.c b/libnm-util/tests/test-setting-8021x.c
index bdfc8e0366..a536a2069b 100644
--- a/libnm-util/tests/test-setting-8021x.c
+++ b/libnm-util/tests/test-setting-8021x.c
@@ -411,7 +411,9 @@ int main (int argc, char **argv)
if (argc < 3)
FAIL ("init", "need at least two arguments: <path> <password>");
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/libnm-util/tests/test-setting-dcb.c b/libnm-util/tests/test-setting-dcb.c
index b0dad437d3..de07f2c2a6 100644
--- a/libnm-util/tests/test-setting-dcb.c
+++ b/libnm-util/tests/test-setting-dcb.c
@@ -304,7 +304,10 @@ int main (int argc, char **argv)
gboolean success;
g_test_init (&argc, &argv, NULL);
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
success = nm_utils_init (&error);
g_assert_no_error (error);
diff --git a/libnm-util/tests/test-settings-defaults.c b/libnm-util/tests/test-settings-defaults.c
index 98c7332c57..93468bcce3 100644
--- a/libnm-util/tests/test-settings-defaults.c
+++ b/libnm-util/tests/test-settings-defaults.c
@@ -104,7 +104,9 @@ int main (int argc, char **argv)
GError *error = NULL;
char *base;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/src/config/tests/test-config.c b/src/config/tests/test-config.c
index caf93ff6f2..fb6baaccaf 100644
--- a/src/config/tests/test-config.c
+++ b/src/config/tests/test-config.c
@@ -281,7 +281,10 @@ test_config_confdir_parse_error (void)
int
main (int argc, char **argv)
{
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/config/simple", test_config_simple);
diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c
index b828aa5f8f..36d58f2a8a 100644
--- a/src/devices/wifi/tests/test-wifi-ap-utils.c
+++ b/src/devices/wifi/tests/test-wifi-ap-utils.c
@@ -1335,7 +1335,10 @@ main (int argc, char **argv)
{
gsize i;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/wifi/lock_bssid",
diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c
index c1711f095d..1ab182a7c0 100644
--- a/src/dhcp-manager/tests/test-dhcp-dhclient.c
+++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c
@@ -577,7 +577,9 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_add_func ("/dhcp/dhclient/orig_missing", test_orig_missing);
g_test_add_func ("/dhcp/dhclient/override_client_id", test_override_client_id);
diff --git a/src/dnsmasq-manager/tests/test-dnsmasq-utils.c b/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
index 5854309884..07dbc0f724 100644
--- a/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
+++ b/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
@@ -104,7 +104,9 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_add_func ("/dnsmasq-manager/address-ranges", test_address_ranges);
diff --git a/src/main.c b/src/main.c
index f54b98921f..4bd2b4324c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -562,7 +562,10 @@ main (int argc, char *argv[])
nm_logging_syslog_openlog (debug);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
dbus_threads_init_default ();
/* Ensure that non-exported properties don't leak out, and that the
diff --git a/src/platform/tests/dump.c b/src/platform/tests/dump.c
index 6399585170..9276d18439 100644
--- a/src/platform/tests/dump.c
+++ b/src/platform/tests/dump.c
@@ -123,7 +123,9 @@ dump_all (void)
int
main (int argc, char **argv)
{
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_assert (argc <= 2);
if (argc > 1 && !g_strcmp0 (argv[1], "--fake"))
diff --git a/src/platform/tests/monitor.c b/src/platform/tests/monitor.c
index 21a4812566..d56cc2bf82 100644
--- a/src/platform/tests/monitor.c
+++ b/src/platform/tests/monitor.c
@@ -10,7 +10,10 @@ main (int argc, char **argv)
{
GMainLoop *loop;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
loop = g_main_loop_new (NULL, FALSE);
nm_logging_setup ("debug", NULL, NULL, NULL);
openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);
diff --git a/src/platform/tests/platform.c b/src/platform/tests/platform.c
index baa7cd5a69..cd42c566f0 100644
--- a/src/platform/tests/platform.c
+++ b/src/platform/tests/platform.c
@@ -850,7 +850,9 @@ main (int argc, char **argv)
gboolean status = TRUE;
int error;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (*argv && !g_strcmp0 (argv[1], "--fake")) {
nm_fake_platform_setup ();
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c
index fc5bfaf23a..911bec9d71 100644
--- a/src/platform/tests/test-common.c
+++ b/src/platform/tests/test-common.c
@@ -136,7 +136,11 @@ main (int argc, char **argv)
int result;
openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
g_test_init (&argc, &argv, NULL);
/* Enable debug messages if called with --debug */
for (; *argv; argv++) {
diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c
index 3f68894583..e6ee86f7a4 100644
--- a/src/ppp-manager/nm-pppd-plugin.c
+++ b/src/ppp-manager/nm-pppd-plugin.c
@@ -325,7 +325,9 @@ plugin_init (void)
DBusGConnection *bus;
GError *err = NULL;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_message ("nm-ppp-plugin: (%s): initializing", __func__);
diff --git a/src/rdisc/tests/rdisc.c b/src/rdisc/tests/rdisc.c
index 13a5f82eb9..1fdf5b67a5 100644
--- a/src/rdisc/tests/rdisc.c
+++ b/src/rdisc/tests/rdisc.c
@@ -39,7 +39,10 @@ main (int argc, char **argv)
const char *ifname;
char mac[6] = { 0x02, 0xaa, 0xbb, 0xcc, 0xdd, 0xee };
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
loop = g_main_loop_new (NULL, FALSE);
nm_logging_setup ("debug", "ip6", NULL, NULL);
openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);
diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index cd5abd0d4c..bd85c03f01 100644
--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -14378,7 +14378,9 @@ int main (int argc, char **argv)
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
#endif
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
success = nm_utils_init (&error);
g_assert_no_error (error);
diff --git a/src/settings/plugins/ifnet/tests/test_all.c b/src/settings/plugins/ifnet/tests/test_all.c
index 8847efc89b..e2b1576ad9 100644
--- a/src/settings/plugins/ifnet/tests/test_all.c
+++ b/src/settings/plugins/ifnet/tests/test_all.c
@@ -455,7 +455,10 @@ main (int argc, char **argv)
{
char *f;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
nm_linux_platform_setup ();
nm_logging_setup ("WARN", "DEFAULT", NULL, NULL);
diff --git a/src/settings/plugins/ifupdown/tests/test-ifupdown.c b/src/settings/plugins/ifupdown/tests/test-ifupdown.c
index 905962a1a4..652e4af219 100644
--- a/src/settings/plugins/ifupdown/tests/test-ifupdown.c
+++ b/src/settings/plugins/ifupdown/tests/test-ifupdown.c
@@ -932,7 +932,9 @@ main (int argc, char **argv)
{
GError *error = NULL;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/src/settings/plugins/keyfile/tests/test-keyfile.c b/src/settings/plugins/keyfile/tests/test-keyfile.c
index 8f9df94ba9..f7d4122905 100644
--- a/src/settings/plugins/keyfile/tests/test-keyfile.c
+++ b/src/settings/plugins/keyfile/tests/test-keyfile.c
@@ -3342,7 +3342,10 @@ int main (int argc, char **argv)
GError *error = NULL;
char *base;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
g_log_set_always_fatal (G_LOG_LEVEL_MASK);
if (!nm_utils_init (&error))
diff --git a/src/settings/tests/test-wired-defname.c b/src/settings/tests/test-wired-defname.c
index 97d61a1a68..2d88dd7759 100644
--- a/src/settings/tests/test-wired-defname.c
+++ b/src/settings/tests/test-wired-defname.c
@@ -123,7 +123,10 @@ test_defname_multiple_conflicts (void)
int
main (int argc, char **argv)
{
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
+
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/defname/no_connections", test_defname_no_connections);
diff --git a/src/supplicant-manager/tests/test-supplicant-config.c b/src/supplicant-manager/tests/test-supplicant-config.c
index 181a11f90b..d1d0562f2c 100644
--- a/src/supplicant-manager/tests/test-supplicant-config.c
+++ b/src/supplicant-manager/tests/test-supplicant-config.c
@@ -500,7 +500,9 @@ int main (int argc, char **argv)
GError *error = NULL;
char *base;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/src/tests/test-dcb.c b/src/tests/test-dcb.c
index aead8f186c..c28f05b920 100644
--- a/src/tests/test-dcb.c
+++ b/src/tests/test-dcb.c
@@ -338,7 +338,9 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_add_func ("/dcb/fcoe", test_dcb_fcoe);
g_test_add_func ("/dcb/iscsi", test_dcb_iscsi);
diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c
index 6b324514fc..c9748cf775 100644
--- a/src/tests/test-dhcp-options.c
+++ b/src/tests/test-dhcp-options.c
@@ -848,7 +848,9 @@ int main (int argc, char **argv)
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
#endif
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error))
FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
diff --git a/src/tests/test-general.c b/src/tests/test-general.c
index 207191fea1..d103c2b722 100644
--- a/src/tests/test-general.c
+++ b/src/tests/test-general.c
@@ -558,7 +558,9 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_add_func ("/general/nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64);
g_test_add_func ("/general/nm_utils_ip6_address_clear_host_address", test_nm_utils_ip6_address_clear_host_address);
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index f08ed24265..3eee5f1366 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -340,7 +340,9 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
g_test_add_func ("/ip4-config/subtract", test_subtract);
g_test_add_func ("/ip4-config/compare-with-source", test_compare_with_source);
diff --git a/src/tests/test-resolvconf-capture.c b/src/tests/test-resolvconf-capture.c
index a04cbae8f2..cde4bbe5be 100644
--- a/src/tests/test-resolvconf-capture.c
+++ b/src/tests/test-resolvconf-capture.c
@@ -208,7 +208,7 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
-#if !GLIB_CHECK_VERSION (2,36,0)
+#if !GLIB_CHECK_VERSION (2,35,0)
g_type_init ();
#endif
diff --git a/test/nm-dhcp-opt-test.c b/test/nm-dhcp-opt-test.c
index bc871756de..9fe2e699f5 100644
--- a/test/nm-dhcp-opt-test.c
+++ b/test/nm-dhcp-opt-test.c
@@ -260,7 +260,9 @@ int main (int argc, char **argv)
DBusConnection *connection;
DBusError error;
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
dbus_error_init (&error);
connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
diff --git a/test/nm-online.c b/test/nm-online.c
index 581a99e3d2..8119287464 100644
--- a/test/nm-online.c
+++ b/test/nm-online.c
@@ -159,7 +159,9 @@ main (int argc, char *argv[])
return 2;
}
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
client = nm_client_new ();
if (!client) {
diff --git a/tools/generate-settings-spec.c b/tools/generate-settings-spec.c
index 3ba370fa3a..f53fdba16e 100644
--- a/tools/generate-settings-spec.c
+++ b/tools/generate-settings-spec.c
@@ -408,7 +408,9 @@ main (int argc, char *argv[])
usage (argv[0]);
}
+#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
+#endif
if (!nm_utils_init (&error)) {
fprintf (stderr, "ERR: failed to initialize libnm-util: %s", error->message);