From ba7b634186a7d19ba41c6365be4ad6f323d5f350 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 14 Dec 2020 23:24:05 +0100 Subject: [PATCH] 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. --- src/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.h b/src/common.h index 359bbbb..63ae96f 100644 --- 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