diff options
author | Max Kellermann <max@musicpd.org> | 2019-12-24 06:39:53 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-12-24 08:04:48 +0100 |
commit | 7770298a65e4c08eea1645abb121731867414488 (patch) | |
tree | 0ecb40215776fdb4a43fcd7f5e199b8b2a8a0aae | |
parent | fa50cdb39e7b8b9b82fc239495967232870a6386 (diff) |
util/Compiler.h: use `[[fallthrough]]` on clang
Older clang versions don't support the GCC __attribute__ syntax. For
those, don't use anything at all, and new clang versions shall use the
standard syntax.
-rw-r--r-- | src/util/Compiler.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/Compiler.h b/src/util/Compiler.h index a97b34529..96f63fae4 100644 --- a/src/util/Compiler.h +++ b/src/util/Compiler.h @@ -143,8 +143,10 @@ #define gcc_flatten #endif -#if CLANG_OR_GCC_VERSION(7,0) +#if GCC_CHECK_VERSION(7,0) #define gcc_fallthrough __attribute__((fallthrough)) +#elif CLANG_CHECK_VERSION(10,0) +#define gcc_fallthrough [[fallthrough]] #else #define gcc_fallthrough #endif |