shared/glib: unconditionally redefine g_object_ref()/g_object_ref_sink() as typesafe macro

This commit is contained in:
Thomas Haller 2019-06-25 08:25:26 +02:00
parent 02ac5693d3
commit 03b8eb124e

View file

@ -522,10 +522,18 @@ _nm_g_variant_new_printf (const char *format_string, ...)
/*****************************************************************************/
#if !GLIB_CHECK_VERSION (2, 56, 0)
/* Recent glib also casts the results to typeof(Obj), but only if
*
* ( defined(g_has_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 )
*
* Since we build NetworkManager with older GLIB_VERSION_MAX_ALLOWED, it's
* not taking effect.
*
* Override this. */
#undef g_object_ref
#undef g_object_ref_sink
#define g_object_ref(Obj) ((typeof(Obj)) g_object_ref (Obj))
#define g_object_ref_sink(Obj) ((typeof(Obj)) g_object_ref_sink (Obj))
#endif
/*****************************************************************************/