From 3a338521703dc8be1e0589684c734f870e2c0633 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 10 Jul 2014 10:41:31 +0200 Subject: core: add glib compatibility wrapper nm_g_type_init() for g_type_init() --- include/nm-glib-compat.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) -- cgit v1.2.1