diff options
author | Max Kellermann <max@musicpd.org> | 2019-12-23 17:47:01 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-12-23 17:53:57 +0100 |
commit | a1afe9afc6879960389491b6fb587f14ae1ae5df (patch) | |
tree | e0016b1b1f409e81c82a183191305ee35bf28416 /src/util/Compiler.h | |
parent | fe598e7d30d82794560df053623a16fee8d3fb9c (diff) |
util/Compiler.h: add gcc_fallthrough
Works around build failures with ccache which may feed processed code
to GCC, which doesn't have the "fall through" code comments.
Diffstat (limited to 'src/util/Compiler.h')
-rw-r--r-- | src/util/Compiler.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/Compiler.h b/src/util/Compiler.h index 6a64ad098..a97b34529 100644 --- a/src/util/Compiler.h +++ b/src/util/Compiler.h @@ -143,6 +143,12 @@ #define gcc_flatten #endif +#if CLANG_OR_GCC_VERSION(7,0) +#define gcc_fallthrough __attribute__((fallthrough)) +#else +#define gcc_fallthrough +#endif + #ifndef __cplusplus /* plain C99 has "restrict" */ #define gcc_restrict restrict |