spa: enable fallthrough attribute on recent clang

This commit is contained in:
Haochen Tong 2020-11-27 22:25:03 +01:00
parent 3ba73bde48
commit a1259a75be
No known key found for this signature in database
GPG key ID: D70E8B08E0BC48DF

View file

@ -54,8 +54,8 @@ extern "C" {
#if defined(__clang__) && __cplusplus >= 201103L
/* clang's fallthrough annotations are only available starting in C++11. */
# define SPA_FALLTHROUGH [[clang::fallthrough]];
#elif defined(__GNUC__) && __GNUC__ >= 7
#define SPA_FALLTHROUGH __attribute__ ((fallthrough));
#elif __GNUC__ >= 7 || __clang_major__ >= 10
# define SPA_FALLTHROUGH __attribute__ ((fallthrough));
#else
# define SPA_FALLTHROUGH /* FALLTHROUGH */
#endif