shared: add nm_unauto() helper macro

This commit is contained in:
Thomas Haller 2016-03-11 13:38:30 +01:00
parent a50d28d4dd
commit 0330a55851

View file

@ -315,6 +315,18 @@ _notify (obj_type *obj, _PropertyEnums prop) \
/*****************************************************************************/
#define nm_unauto(pp) \
({ \
G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
gpointer *_pp = (gpointer *) (pp); \
gpointer _p = *_pp; \
\
*_pp = NULL; \
_p; \
})
/*****************************************************************************/
static inline gpointer
nm_g_object_ref (gpointer obj)
{