diff options
Diffstat (limited to 'shared/nm-glib-aux')
-rw-r--r-- | shared/nm-glib-aux/nm-macros-internal.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h index a5ac7ce782..77288dde58 100644 --- a/shared/nm-glib-aux/nm-macros-internal.h +++ b/shared/nm-glib-aux/nm-macros-internal.h @@ -1011,10 +1011,9 @@ typedef enum { \ } _PropertyEnums; \ static GParamSpec *obj_properties[_PROPERTY_ENUMS_LAST] = { NULL, } -#define NM_GOBJECT_PROPERTIES_DEFINE(obj_type, ...) \ -NM_GOBJECT_PROPERTIES_DEFINE_BASE (__VA_ARGS__); \ +#define NM_GOBJECT_PROPERTIES_DEFINE_NOTIFY(obj_type, obj_properties, property_enums_type, prop_0) \ static inline void \ -_nm_gobject_notify_together_impl (obj_type *obj, guint n, const _PropertyEnums *props) \ +_nm_gobject_notify_together_impl (obj_type *obj, guint n, const property_enums_type *props) \ { \ const gboolean freeze_thaw = (n > 1); \ \ @@ -1024,9 +1023,9 @@ _nm_gobject_notify_together_impl (obj_type *obj, guint n, const _PropertyEnums * if (freeze_thaw) \ g_object_freeze_notify ((GObject *) obj); \ while (n-- > 0) { \ - const _PropertyEnums prop = *props++; \ + const property_enums_type prop = *props++; \ \ - if (prop != PROP_0) { \ + if (prop != prop_0) { \ nm_assert ((gsize) prop < G_N_ELEMENTS (obj_properties)); \ nm_assert (obj_properties[prop]); \ g_object_notify_by_pspec ((GObject *) obj, obj_properties[prop]); \ @@ -1037,11 +1036,15 @@ _nm_gobject_notify_together_impl (obj_type *obj, guint n, const _PropertyEnums * } \ \ static inline void \ -_notify (obj_type *obj, _PropertyEnums prop) \ +_notify (obj_type *obj, property_enums_type prop) \ { \ _nm_gobject_notify_together_impl (obj, 1, &prop); \ } \ +#define NM_GOBJECT_PROPERTIES_DEFINE(obj_type, ...) \ +NM_GOBJECT_PROPERTIES_DEFINE_BASE (__VA_ARGS__); \ +NM_GOBJECT_PROPERTIES_DEFINE_NOTIFY (obj_type, obj_properties, _PropertyEnums, PROP_0) + /* invokes _notify() for all arguments (of type _PropertyEnums). Note, that if * there are more than one prop arguments, this will involve a freeze/thaw * of GObject property notifications. */ |