mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-10 00:50:33 +01:00
glib-aux: fix static assertion for alignment of NMIPAddr for m68k
On m68k, 32-bit integers are 2-byte aligned, causing the assertion to fail. Relax the check, it's good enough still.
This commit is contained in:
parent
b5829c9ac1
commit
705e776776
1 changed files with 6 additions and 6 deletions
|
|
@ -37,12 +37,12 @@ const void *const _NM_PTRARRAY_EMPTY[1] = {NULL};
|
|||
|
||||
const NMIPAddr nm_ip_addr_zero = {};
|
||||
|
||||
/* We use _nm_alignas(NMIPAddr). Ensure that this struct has the same
|
||||
* alignment as in_addr_t and struct in6_addr. */
|
||||
G_STATIC_ASSERT(_nm_alignof(NMIPAddr) == 4);
|
||||
G_STATIC_ASSERT(_nm_alignof(in_addr_t) == 4);
|
||||
G_STATIC_ASSERT(_nm_alignof(struct in_addr) == 4);
|
||||
G_STATIC_ASSERT(_nm_alignof(struct in6_addr) == 4);
|
||||
/* We use _nm_alignas(NMIPAddr) to ensure that fields for in_addr_t and
|
||||
* struct in6_addr have all the same alignment. Ensure that this is suitable. */
|
||||
G_STATIC_ASSERT(_nm_alignof(in_addr_t) <= _nm_alignof(NMIPAddr));
|
||||
G_STATIC_ASSERT(_nm_alignof(struct in_addr) <= _nm_alignof(NMIPAddr));
|
||||
G_STATIC_ASSERT(_nm_alignof(struct in6_addr) <= _nm_alignof(NMIPAddr));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMEtherAddr) <= _nm_alignof(NMIPAddr));
|
||||
|
||||
/* this initializes a struct in_addr/in6_addr and allows for untrusted
|
||||
* arguments (like unsuitable @addr_family or @src_len). It's almost safe
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue