diff options
author | Thomas Haller <thaller@redhat.com> | 2017-12-06 10:04:50 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-12-06 10:34:28 +0100 |
commit | 7ca601d529329f756340961fcd153399b2f5063c (patch) | |
tree | f6435d2f3f6c193fb6fa8a7694302858ce675931 /shared | |
parent | 7661ad64ba2f3629650a3d0f3888a5ee9f434030 (diff) | |
download | NetworkManager-7ca601d529329f756340961fcd153399b2f5063c.tar.gz |
shared: propagate type for g_object_ref()
See related bug https://bugzilla.gnome.org/show_bug.cgi?id=790697
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-utils/nm-glib.h | 5 | ||||
-rw-r--r-- | shared/nm-utils/nm-macros-internal.h | 1 |
2 files changed, 6 insertions, 0 deletions
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 8005375c9d..9d9016e428 100644 --- a/shared/nm-utils/nm-macros-internal.h +++ b/shared/nm-utils/nm-macros-internal.h @@ -721,6 +721,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) |