From d6201f5d8daada3d64a0a3e0038e14eebec683ce Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 3 Aug 2016 22:59:23 +0200 Subject: Imported Upstream version 1.2.4 --- shared/nm-macros-internal.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'shared/nm-macros-internal.h') diff --git a/shared/nm-macros-internal.h b/shared/nm-macros-internal.h index 384bca66..fe27b761 100644 --- a/shared/nm-macros-internal.h +++ b/shared/nm-macros-internal.h @@ -27,6 +27,7 @@ /********************************************************/ #define _nm_packed __attribute__ ((packed)) +#define _nm_unused __attribute__ ((unused)) #define nm_auto(fcn) __attribute__ ((cleanup(fcn))) @@ -45,6 +46,14 @@ _nm_auto_unset_gvalue_impl (GValue *v) } #define nm_auto_unset_gvalue nm_auto(_nm_auto_unset_gvalue_impl) +static inline void +_nm_auto_free_gstring_impl (GString **str) +{ + if (*str) + g_string_free (*str, TRUE); +} +#define nm_auto_free_gstring nm_auto(_nm_auto_free_gstring_impl) + /********************************************************/ /* http://stackoverflow.com/a/11172679 */ @@ -326,18 +335,6 @@ _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) { -- cgit 1.3.0-6-gf8a5