From 2fb7479e82a07dfb8dcd094507eb4f1be1cd62cd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 13 Dec 2017 09:34:39 +0100 Subject: [PATCH] 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. --- shared/nm-utils/nm-macros-internal.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h index 9d9016e428..4ee59f195e 100644 --- a/shared/nm-utils/nm-macros-internal.h +++ b/shared/nm-utils/nm-macros-internal.h @@ -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