commit ba7b634186a7d19ba41c6365be4ad6f323d5f350
parent 5b4766fbe4e6edacf237ae745c47937d9d786ade
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Mon, 14 Dec 2020 23:24:05 +0100
make FALLTHROUGH work with qtcreator's code model
the code model inspector claims that __GNUC__ is 10, but the #if works
only with >= 4, which is plain wrong. so just handle clang explicitly.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common.h b/src/common.h
@@ -76,7 +76,7 @@ typedef unsigned long ulong;
# define DIAG_DISABLE(text)
#endif
-#if __GNUC__ >= 7
+#if __GNUC__ >= 7 || defined(__clang__)
# define FALLTHROUGH __attribute__((fallthrough));
#else
# define FALLTHROUGH