mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 08:00:37 +01:00
platform: move static asserts from header to source file
No point in having every user of the header file evaluate the static assertion.
This commit is contained in:
parent
91dde2c865
commit
638528d312
2 changed files with 4 additions and 4 deletions
|
|
@ -41,6 +41,10 @@
|
|||
#define ADDRESS_LIFETIME_PADDING 5
|
||||
|
||||
G_STATIC_ASSERT (sizeof ( ((NMPlatformLink *) NULL)->addr.data ) == NM_UTILS_HWADDR_LEN_MAX);
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address));
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address));
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Route, network));
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network));
|
||||
|
||||
#define _NMLOG_DOMAIN LOGD_PLATFORM
|
||||
#define _NMLOG_PREFIX_NAME "platform"
|
||||
|
|
|
|||
|
|
@ -222,7 +222,6 @@ struct _NMPlatformIP4Address {
|
|||
in_addr_t peer_address; /* PTP peer address */
|
||||
char label[IFNAMSIZ];
|
||||
};
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address));
|
||||
|
||||
/**
|
||||
* NMPlatformIP6Address:
|
||||
|
|
@ -234,7 +233,6 @@ struct _NMPlatformIP6Address {
|
|||
struct in6_addr peer_address;
|
||||
guint flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
|
||||
};
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address));
|
||||
|
||||
typedef union {
|
||||
NMPlatformIPAddress ax;
|
||||
|
|
@ -291,14 +289,12 @@ struct _NMPlatformIP4Route {
|
|||
* no pref-src is set. */
|
||||
guint32 pref_src;
|
||||
};
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Route, network));
|
||||
|
||||
struct _NMPlatformIP6Route {
|
||||
__NMPlatformIPRoute_COMMON;
|
||||
struct in6_addr network;
|
||||
struct in6_addr gateway;
|
||||
};
|
||||
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network));
|
||||
|
||||
typedef union {
|
||||
NMPlatformIPRoute rx;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue