From 03b8eb124e00f163d0c4baa8285f088727ef08e2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 25 Jun 2019 08:25:26 +0200 Subject: shared/glib: unconditionally redefine g_object_ref()/g_object_ref_sink() as typesafe macro --- shared/nm-glib-aux/nm-glib.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'shared') diff --git a/shared/nm-glib-aux/nm-glib.h b/shared/nm-glib-aux/nm-glib.h index 77a0913899..bdb7ea5b3e 100644 --- a/shared/nm-glib-aux/nm-glib.h +++ b/shared/nm-glib-aux/nm-glib.h @@ -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 /*****************************************************************************/ -- cgit v1.2.1