summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemy Noel <mocramis@gmail.com>2017-10-15 18:03:46 +0200
committerRichard Braun <rbraun@sceen.net>2017-10-15 20:20:11 +0200
commit16f7ce961099a55c64db92baabb9424e08d437d9 (patch)
tree4be5e659f8ee4b3bd2426b8feb2f4d1965032cd2
parent849ffff7bcc9be8fce9446b80b7bdae9ddedcb38 (diff)
kern/macros: new __fallthrough macro
-rw-r--r--kern/macros.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/macros.h b/kern/macros.h
index d09eca40..23ad4d22 100644
--- a/kern/macros.h
+++ b/kern/macros.h
@@ -106,4 +106,13 @@ moo_print(const char *s)
#define __used __attribute__((used))
#endif
+#ifndef __fallthrough
+#if __GNUC__ >= 7
+#define __fallthrough __attribute__((fallthrough))
+#else
+/* TODO: clang 6 might add support for -Wimplicit-fallthrough */
+#define __fallthrough
+#endif
+#endif
+
#endif /* _KERN_MACROS_H */