diff --git a/shared/nm-utils/nm-glib.h b/shared/nm-utils/nm-glib.h index 4ef538e441..599890e071 100644 --- a/shared/nm-utils/nm-glib.h +++ b/shared/nm-utils/nm-glib.h @@ -481,4 +481,9 @@ _nm_g_variant_new_printf (const char *format_string, ...) }) #endif +#if !GLIB_CHECK_VERSION (2, 56, 0) +#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 + #endif /* __NM_GLIB_H__ */ diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h index fc474d4b1e..5bd9eac406 100644 --- a/shared/nm-utils/nm-macros-internal.h +++ b/shared/nm-utils/nm-macros-internal.h @@ -697,6 +697,7 @@ nm_g_object_ref (gpointer obj) g_object_ref (obj); return obj; } +#define nm_g_object_ref(obj) ((typeof (obj)) nm_g_object_ref (obj)) static inline void nm_g_object_unref (gpointer obj)