diff options
| author | Michael Biebl <biebl@debian.org> | 2016-08-03 23:00:16 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-08-03 23:00:16 +0200 |
| commit | 511e94811644318cc196e197616fdc558030e8e3 (patch) | |
| tree | 1ea5c895be190982cc686d43ebed62ae33d60426 /shared/nm-macros-internal.h | |
| parent | fb15332b981b5637ae4aeadc546e2f46bf333cd1 (diff) | |
| parent | d6201f5d8daada3d64a0a3e0038e14eebec683ce (diff) | |
Merge tag 'upstream/1.2.4'
Upstream version 1.2.4
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) { |