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
This commit is contained in:
Thomas Haller
2018-03-19 11:21:59 +01:00
parent ff8e563365
commit b2edcdc939

View File

@@ -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__ */