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>
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index 0d66458..e610093 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -84,9 +84,12 @@
 #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