NetworkManager/shared
Thomas Haller 143130066b
c-rbtree: fix struct alignment of CRBTree on m68k architectures
On m68k, 32bit integer are aligned to only 2 bytes. This breaks
assumptions and a static assertion of c-rbtree.

Explicitly require that the first field is aligned to at least 4 bytes.
This fixes the build and ensures that all valid pointers to a CRBTree have
the lowest two bits unset (so they can be used for storing 2 additional flags).

Use a union instead of aligning __parent_and_flags itself. That is
because alignas() cannot lower the natural alignment, so if we would
want to align __parent_and_flags, we could only do

  alignas(sizeof(unsigned long) > 4 ? sizeof(unsigned long) : 4)

That would not be correct if "long" is 8 bytes long but had a natural
alignment of only 4. The union allows us to specify an alignment
of at least 4, but otherwise follow natural alignment.

10d973a9e6
2020-10-21 10:38:25 +02:00
..
c-list shared/c-list: reimport 2020-06-03 22:00:56 +02:00
c-rbtree c-rbtree: fix struct alignment of CRBTree on m68k architectures 2020-10-21 10:38:25 +02:00
c-siphash all: fix minor typos 2020-07-07 11:33:46 +02:00
c-stdaux all: fix minor typos 2020-07-07 11:33:46 +02:00
n-acd all: fix minor typos 2020-07-07 11:33:46 +02:00
n-dhcp4 n-dhcp4: add n_dhcp4_client_lease_get_server_identifier() 2020-08-26 17:08:15 +02:00
nm-glib-aux shared: fix NM_CAST_STRV_CC() for "char **const" pointers 2020-10-19 21:25:11 +02:00
nm-std-aux shared: add typedefs for integers for different endianness 2020-09-30 09:49:20 +02:00
nm-udev-aux license: relicense "shared/nm-udev-aux/nm-udev-utils.[hc]" under LGPL-2.1+ 2020-10-20 16:02:00 +02:00
nm-utils all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
systemd systemd: basic/missing_syscall: fix syscall numbers for mips* 2020-10-08 10:36:10 +02:00
meson.build shared: merge nm-glib-aux/nm-json.[hc] into nm-json-aux.[hc] 2020-07-09 11:47:06 +02:00
nm-default.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-meta-setting.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-meta-setting.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-test-libnm-utils.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-test-utils-impl.c license: relicense "shared/nm-test-utils-impl.c" under LGPL-2.1+ 2020-10-20 15:58:36 +02:00
nm-version-macros.h.in shared: use C comments for SPDX header in "nm-version-macros.h.in" 2020-10-20 14:56:46 +02:00