diff options
| author | Thomas Haller <thaller@redhat.com> | 2017-11-09 11:42:24 +0100 |
|---|---|---|
| committer | Thomas Haller <thaller@redhat.com> | 2017-11-09 14:15:34 +0100 |
| commit | b339a2742a437c7cdf27c9d117250c7b35a59a2e (patch) | |
| tree | 6e54ec17993f01b36c21ef6d2cbc46e939a75a1c /src/platform | |
| parent | b1810d7a68d188aa8f36a0e23a7be705a742b1aa (diff) | |
| download | NetworkManager-b339a2742a437c7cdf27c9d117250c7b35a59a2e.tar.gz | |
shared: make NM_CONSTCAST() macro variadic
We need to pass more alias-types. Instead of having numbered
versions, use variadic number of macro arguments.
Also, fix build failure with old compiler:
In file included from src/nm-ip6-config.c:24:
./src/nm-ip6-config.h:44:29: error: controlling expression type 'typeof (ipconf_iter->current->obj)' (aka 'const void *const') not compatible with any generic association type
*out_address = has_next ? NMP_OBJECT_CAST_IP6_ADDRESS (ipconf_iter->current->obj) : NULL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: b1810d7a68d188aa8f36a0e23a7be705a742b1aa
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/nm-linux-platform.c | 2 | ||||
| -rw-r--r-- | src/platform/nmp-object.h | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 9ce520bdcc..9efdd41327 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -2867,7 +2867,7 @@ struct _NMLinuxPlatformClass { G_DEFINE_TYPE (NMLinuxPlatform, nm_linux_platform, NM_TYPE_PLATFORM) -#define NM_LINUX_PLATFORM_GET_PRIVATE(self) _NM_GET_PRIVATE2(self, NMLinuxPlatform, NM_IS_LINUX_PLATFORM, NMPlatform) +#define NM_LINUX_PLATFORM_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMLinuxPlatform, NM_IS_LINUX_PLATFORM, NMPlatform) NMPlatform * nm_linux_platform_new (gboolean log_with_ptr, gboolean netns_support) diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h index 41fd08cb7c..6db7573a99 100644 --- a/src/platform/nmp-object.h +++ b/src/platform/nmp-object.h @@ -341,7 +341,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NMP_OBJECT_GET_TYPE ((const NMPObject *) _obj) == NMP_OBJECT_TYPE_LINK); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->link : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->link : NULL; \ }) #define NMP_OBJECT_CAST_IP_ADDRESS(obj) \ @@ -349,7 +349,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NM_IN_SET (NMP_OBJECT_GET_TYPE (_obj), NMP_OBJECT_TYPE_IP4_ADDRESS, NMP_OBJECT_TYPE_IP6_ADDRESS)); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip_address : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ip_address : NULL; \ }) #define NMP_OBJECT_CAST_IPX_ADDRESS(obj) \ @@ -357,7 +357,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NM_IN_SET (NMP_OBJECT_GET_TYPE (_obj), NMP_OBJECT_TYPE_IP4_ADDRESS, NMP_OBJECT_TYPE_IP6_ADDRESS)); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ipx_address : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ipx_address : NULL; \ }) #define NMP_OBJECT_CAST_IP4_ADDRESS(obj) \ @@ -365,7 +365,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NMP_OBJECT_GET_TYPE ((const NMPObject *) _obj) == NMP_OBJECT_TYPE_IP4_ADDRESS); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip4_address : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ip4_address : NULL; \ }) #define NMP_OBJECT_CAST_IP6_ADDRESS(obj) \ @@ -373,7 +373,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NMP_OBJECT_GET_TYPE ((const NMPObject *) _obj) == NMP_OBJECT_TYPE_IP6_ADDRESS); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip6_address : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ip6_address : NULL; \ }) #define NMP_OBJECT_CAST_IPX_ROUTE(obj) \ @@ -381,7 +381,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NM_IN_SET (NMP_OBJECT_GET_TYPE (_obj), NMP_OBJECT_TYPE_IP4_ROUTE, NMP_OBJECT_TYPE_IP6_ROUTE)); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ipx_route : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ipx_route : NULL; \ }) #define NMP_OBJECT_CAST_IP_ROUTE(obj) \ @@ -389,7 +389,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NM_IN_SET (NMP_OBJECT_GET_TYPE (_obj), NMP_OBJECT_TYPE_IP4_ROUTE, NMP_OBJECT_TYPE_IP6_ROUTE)); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip_route : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ip_route : NULL; \ }) #define NMP_OBJECT_CAST_IP4_ROUTE(obj) \ @@ -397,7 +397,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NMP_OBJECT_GET_TYPE ((const NMPObject *) _obj) == NMP_OBJECT_TYPE_IP4_ROUTE); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip4_route : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ip4_route : NULL; \ }) #define NMP_OBJECT_CAST_IP6_ROUTE(obj) \ @@ -405,7 +405,7 @@ NMP_OBJECT_GET_TYPE (const NMPObject *obj) typeof (obj) _obj = (obj); \ \ nm_assert (!_obj || NMP_OBJECT_GET_TYPE ((const NMPObject *) _obj) == NMP_OBJECT_TYPE_IP6_ROUTE); \ - _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip6_route : NULL; \ + _obj ? &NM_CONSTCAST (NMPObject, _obj)->ip6_route : NULL; \ }) const NMPClass *nmp_class_from_type (NMPObjectType obj_type); |
