macros: add _nm_fallthrough macro

Systemd introduced a _fallthrough_ macro in
https://github.com/systemd/systemd/pull/7389.

There might still be some issue with it, but as
I am going to re-import the latest systemd code,
we get them too.

We need it, because "shared/nm-utils/siphash24.c"
will use it too, and that source file does not include
the other systemd macros. So, we will need to re-define
it.
This commit is contained in:
Thomas Haller 2017-12-13 09:34:39 +01:00
parent 5c6a382d4d
commit 2fb7479e82

View file

@ -35,6 +35,12 @@
#define _nm_alignof(type) __alignof (type)
#define _nm_alignas(type) _nm_align (_nm_alignof (type))
#if __GNUC__ >= 7
#define _nm_fallthrough __attribute__ ((fallthrough))
#else
#define _nm_fallthrough
#endif
/*****************************************************************************/
#ifdef thread_local