diff options
Diffstat (limited to 'shared/nm-macros-internal.h')
| -rw-r--r-- | shared/nm-macros-internal.h | 21 |
1 files changed, 9 insertions, 12 deletions
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) { |