summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-03-15 14:41:56 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-02-16 21:28:09 +0000
commit97a0d61f0d1d5a9280ba72e2e50d87e4b853777f (patch)
tree1b1652ca66cbb2e4e1d7a7623790070746cf6965
parent33b7bb6ee5a3839d6c071dbc1a2092a39fc26263 (diff)
compiler.h: Define a __fallthrough statement
Change-Id: I0487698290992162fac6bb74b5082901415e917e Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51497 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
-rw-r--r--src/commonlib/bsd/include/commonlib/bsd/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commonlib/bsd/include/commonlib/bsd/compiler.h b/src/commonlib/bsd/include/commonlib/bsd/compiler.h
index 4dd09bc90c..ebf017900d 100644
--- a/src/commonlib/bsd/include/commonlib/bsd/compiler.h
+++ b/src/commonlib/bsd/include/commonlib/bsd/compiler.h
@@ -35,6 +35,10 @@
#define __always_inline inline __attribute__((always_inline))
#endif
+#ifndef __fallthrough
+#define __fallthrough __attribute__((__fallthrough__))
+#endif
+
/* This evaluates to the type of the first expression, unless that is constant
in which case it evaluates to the type of the second. This is useful when
assigning macro parameters to temporary variables, because that would