diff --git a/core/utils/common.h b/core/utils/common.h index 8e7ffdf05..75634d2b5 100644 --- a/core/utils/common.h +++ b/core/utils/common.h @@ -43,16 +43,6 @@ #error Must be built with C++17 #endif -#if !defined(__cplusplus) // C -#define FALLTHROUGH __attribute__((fallthrough)) -#elif __cplusplus <= 201402L && defined(__clang__) // C++14 or older, Clang -#define FALLTHROUGH [[clang::fallthrough]] -#elif __cplusplus <= 201402L && __GNUC__ < 7 // C++14 or older, pre-GCC 7 -#define FALLTHROUGH -#else -#define FALLTHROUGH [[fallthrough]] -#endif - /* Hint for performance optimization. Same as _nDCHECK() of TI compilers */ #define promise(cond) \ ({ \ diff --git a/core/utils/copy.h b/core/utils/copy.h index 026aeb866..a332d4993 100644 --- a/core/utils/copy.h +++ b/core/utils/copy.h @@ -107,7 +107,7 @@ static inline void CopySmall(void *__restrict__ dst, break; case 9: memcpy(d + 8, s + 8, 1); - FALLTHROUGH; + [[fallthrough]]; case 8: memcpy(d, s, 8); break; @@ -120,13 +120,13 @@ static inline void CopySmall(void *__restrict__ dst, break; case 5: memcpy(d + 4, s + 4, 1); - FALLTHROUGH; + [[fallthrough]]; case 4: memcpy(d, s, 4); break; case 3: memcpy(d + 2, s + 2, 1); - FALLTHROUGH; + [[fallthrough]]; case 2: memcpy(d, s, 2); break; @@ -200,22 +200,22 @@ static inline void CopyInlined(void *__restrict__ dst, switch (leftover_blocks) { case 7: copy_block(d + 6, s + 6); - FALLTHROUGH; + [[fallthrough]]; case 6: copy_block(d + 5, s + 5); - FALLTHROUGH; + [[fallthrough]]; case 5: copy_block(d + 4, s + 4); - FALLTHROUGH; + [[fallthrough]]; case 4: copy_block(d + 3, s + 3); - FALLTHROUGH; + [[fallthrough]]; case 3: copy_block(d + 2, s + 2); - FALLTHROUGH; + [[fallthrough]]; case 2: copy_block(d + 1, s + 1); - FALLTHROUGH; + [[fallthrough]]; case 1: copy_block(d + 0, s + 0); }