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:
Thomas Haller 2022-05-19 13:11:18 +02:00
parent b5829c9ac1
commit 705e776776
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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