diff options
author | Thomas Haller <thaller@redhat.com> | 2020-02-23 12:10:49 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-02-24 13:13:34 +0100 |
commit | 9f2014ac64b784374d8de64efe66339fa887887f (patch) | |
tree | 6558adb8792a967a1bd452e41175b8a80303c926 /shared | |
parent | f12b830a94fc9716cda7f6e4bbeddaa7eaea10ea (diff) | |
download | NetworkManager-9f2014ac64b784374d8de64efe66339fa887887f.tar.gz |
shared: fix suffix for NM_GOBJECT_PROPERTIES_DEFINE_BASE*() for multiple definitions
To really use multiple NM_GOBJECT_PROPERTIES_DEFINE_BASE*() defines in
the same source file, several fixes to the suffix handling are
necessary. This fixes commit f13c7e3bbd87 ('shared: extend
NM_GOBJECT_PROPERTIES_DEFINE*() macros to append suffix to defined
names') to really work.
Fixes: f13c7e3bbd87 ('shared: extend NM_GOBJECT_PROPERTIES_DEFINE*() macros to append suffix to defined names')
Diffstat (limited to 'shared')
-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 56353a46fb..84317567ef 100644 --- a/shared/nm-glib-aux/nm-macros-internal.h +++ b/shared/nm-glib-aux/nm-macros-internal.h @@ -1053,7 +1053,7 @@ static GParamSpec *obj_properties##suffix[_PROPERTY_ENUMS_LAST##suffix] = { NULL #define NM_GOBJECT_PROPERTIES_DEFINE_NOTIFY(suffix, obj_type) \ static inline void \ -_nm_gobject_notify_together_impl (obj_type *obj, guint n, const _PropertyEnums##suffix *props) \ +_nm_gobject_notify_together_impl##suffix (obj_type *obj, guint n, const _PropertyEnums##suffix *props) \ { \ const gboolean freeze_thaw = (n > 1); \ \ @@ -1076,23 +1076,26 @@ _nm_gobject_notify_together_impl (obj_type *obj, guint n, const _PropertyEnums## } \ \ _nm_unused static inline void \ -_notify (obj_type *obj, _PropertyEnums##suffix prop) \ +_notify##suffix (obj_type *obj, _PropertyEnums##suffix prop) \ { \ - _nm_gobject_notify_together_impl (obj, 1, &prop); \ + _nm_gobject_notify_together_impl##suffix (obj, 1, &prop); \ } \ #define NM_GOBJECT_PROPERTIES_DEFINE_BASE(...) \ NM_GOBJECT_PROPERTIES_DEFINE_BASE_FULL (, __VA_ARGS__); \ +#define NM_GOBJECT_PROPERTIES_DEFINE_FULL(suffix, obj_type, ...) \ + NM_GOBJECT_PROPERTIES_DEFINE_BASE_FULL (suffix, __VA_ARGS__); \ + NM_GOBJECT_PROPERTIES_DEFINE_NOTIFY (suffix, obj_type) + #define NM_GOBJECT_PROPERTIES_DEFINE(obj_type, ...) \ - NM_GOBJECT_PROPERTIES_DEFINE_BASE_FULL (, __VA_ARGS__); \ - NM_GOBJECT_PROPERTIES_DEFINE_NOTIFY (, obj_type) + NM_GOBJECT_PROPERTIES_DEFINE_FULL (, obj_type, __VA_ARGS__) /* 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. */ #define nm_gobject_notify_together_full(suffix, obj, ...) \ - _nm_gobject_notify_together_impl (obj, NM_NARG (__VA_ARGS__), (const _PropertyEnums##suffix[]) { __VA_ARGS__ }) + _nm_gobject_notify_together_impl##suffix (obj, NM_NARG (__VA_ARGS__), (const _PropertyEnums##suffix[]) { __VA_ARGS__ }) #define nm_gobject_notify_together(obj, ...) \ nm_gobject_notify_together_full (, obj, __VA_ARGS__) |