diff options
author | Thomas Haller <thaller@redhat.com> | 2018-03-19 11:21:59 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-03-27 10:36:12 +0200 |
commit | b2edcdc939bbc0197dbbed8da044d1ecd76aae0b (patch) | |
tree | e598c050e22bcc81f951a0b45e3a334b820885f4 | |
parent | ff8e56336574a168d427a993d666d9e038aacbaf (diff) | |
download | NetworkManager-b2edcdc939bbc0197dbbed8da044d1ecd76aae0b.tar.gz |
shared/nm-glib: add compat implementation for g_autofree
Eventually, we should replace our uses of libgsystem's gsystem-local-alloc.h
by glib's g_auto*. As a first tiny step, add a compat implementation for g_autofree,
so that we could at least go ahead and use it instead of gs_free.
https://bugzilla.gnome.org/show_bug.cgi?id=794294
-rw-r--r-- | shared/nm-utils/nm-glib.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-glib.h b/shared/nm-utils/nm-glib.h index b20e978f45..f1498dc4ee 100644 --- a/shared/nm-utils/nm-glib.h +++ b/shared/nm-utils/nm-glib.h @@ -114,4 +114,12 @@ _nm_g_strv_contains (const gchar * const *strv, #define g_object_ref_sink(Obj) ((typeof(Obj)) g_object_ref_sink (Obj)) #endif +#ifndef g_autofree +/* we still don't rely on recent glib to provide g_autofree. Hence, we continue + * to use our gs_* free macros that we took from libgsystem. + * + * To ease migration towards g_auto*, add a compat define for g_autofree. */ +#define g_autofree gs_free +#endif + #endif /* __NM_GLIB_H__ */ |