summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-07-10 10:41:31 +0200
committerThomas Haller <thaller@redhat.com>2015-07-12 13:56:52 +0200
commit3a338521703dc8be1e0589684c734f870e2c0633 (patch)
treea65f813994c6bc0e6ab9532699f7dac9d9059aa9
parent80a88fb64940bee76dd9659c6b326ca8d677e3de (diff)
downloadNetworkManager-3a338521703dc8be1e0589684c734f870e2c0633.tar.gz
core: add glib compatibility wrapper nm_g_type_init() for g_type_init()
-rw-r--r--include/nm-glib-compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h
index dc39d2b934..5e36516f6e 100644
--- a/include/nm-glib-compat.h
+++ b/include/nm-glib-compat.h
@@ -106,6 +106,17 @@ __g_type_ensure (GType type)
#endif
+
+#if GLIB_CHECK_VERSION (2, 35, 0)
+/* For glib >= 2.36, g_type_init() is deprecated.
+ * But since 2.35.1 (7c42ab23b55c43ab96d0ac2124b550bf1f49c1ec) this function
+ * does nothing. Replace the call with empty statement. */
+#define nm_g_type_init() G_STMT_START { (void) 0; } G_STMT_END
+#else
+#define nm_g_type_init() G_STMT_START { g_type_init (); } G_STMT_END
+#endif
+
+
/* g_test_initialized() is only available since glib 2.36. */
#if !GLIB_CHECK_VERSION (2, 36, 0)
#define g_test_initialized() (g_test_config_vars->test_initialized)