소스 검색

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.
Oswald Buddenhagen 4 년 전
부모
커밋
ba7b634186
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/common.h

+ 1 - 1
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