From: Roy Marples Date: Wed, 6 Feb 2019 20:05:52 +0000 (+0000) Subject: Fix __fallthrough directive on non GNUC X-Git-Tag: v7.1.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4de59d0d9c12a1ca0ed2379ba7277330d737f1fe;p=thirdparty%2Fdhcpcd.git Fix __fallthrough directive on non GNUC --- diff --git a/src/common.h b/src/common.h index 7a968d17..f12f02a7 100644 --- a/src/common.h +++ b/src/common.h @@ -115,9 +115,6 @@ #endif #if __GNUC__ > 2 || defined(__INTEL_COMPILER) -# ifndef __fallthrough -# define __fallthrough __attribute__((fallthrough)) -# endif # ifndef __packed # define __packed __attribute__((__packed__)) # endif @@ -125,9 +122,6 @@ # define __unused __attribute__((__unused__)) # endif #else -# ifndef __fallthrough -# define __fallthrough -# endif # ifndef __packed # define __packed # endif @@ -136,6 +130,14 @@ # endif #endif +#ifndef __fallthrough +# if __GNUC__ >= 7 +# define __fallthrough [[fallthrough]] +# else +# define __fallthrough +# endif +#endif + /* * Compile Time Assertion. */