summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2020-11-21 10:26:01 +0000
committerCommit Bot <commit-bot@chromium.org>2020-11-23 16:13:21 +0000
commit58534c3376f1caa8198d920f05cdac40cf2180d7 (patch)
tree4e4744a1559d372eecc0db22b5192f784a0040cf
parent9d4053df76c127f625a8571d3ef16e6a063c8de5 (diff)
downloadvboot-58534c3376f1caa8198d920f05cdac40cf2180d7.tar.gz
Hide __has_attribute from non-clang compilers
gcc 4.9 doesn't know __has_attribute so don't expose it for non-clang compilers Change-Id: I991af712adbd56d64938a35b75b7de468154e3a6 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2553421 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--firmware/2lib/include/2common.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index 0d66458f..e6100938 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -84,9 +84,12 @@ struct vb2_public_key;
#endif
#endif
-#if (defined(__GNUC__) && __GNUC__ >= 7) || \
- (defined(__clang__) && __has_attribute(fallthrough))
+#if (defined(__GNUC__) && __GNUC__ >= 7)
#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
+#elif defined(__clang__)
+#if __has_attribute(fallthrough)
+#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
+#endif
#else
#define VBOOT_FALLTHROUGH ((void)0)
#endif