]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix __fallthrough directive on non GNUC
authorRoy Marples <roy@marples.name>
Wed, 6 Feb 2019 20:05:52 +0000 (20:05 +0000)
committerRoy Marples <roy@marples.name>
Wed, 6 Feb 2019 20:05:52 +0000 (20:05 +0000)
src/common.h

index 7a968d179c04088fd3cc485492f95f990be2e456..f12f02a72a3c5a77acfde62bc0eb86de3726b56d 100644 (file)
 #endif
 
 #if __GNUC__ > 2 || defined(__INTEL_COMPILER)
-# ifndef __fallthrough
-#  define __fallthrough __attribute__((fallthrough))
-# endif
 # ifndef __packed
 #  define __packed __attribute__((__packed__))
 # endif
 #  define __unused __attribute__((__unused__))
 # endif
 #else
-# ifndef __fallthrough
-#  define __fallthrough
-# endif
 # ifndef __packed
 #  define __packed
 # endif
 # endif
 #endif
 
+#ifndef __fallthrough
+# if __GNUC__ >= 7
+#  define __fallthrough [[fallthrough]]
+# else
+#  define __fallthrough
+# endif
+#endif
+
 /*
  * Compile Time Assertion.
  */