From a1259a75be50d452c01e933a9c4b969aa7e4cde5 Mon Sep 17 00:00:00 2001 From: Haochen Tong Date: Fri, 27 Nov 2020 22:25:03 +0100 Subject: [PATCH] spa: enable fallthrough attribute on recent clang --- spa/include/spa/utils/defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index c3d927535..7a3ffa1fb 100644 --- a/spa/include/spa/utils/defs.h +++ b/spa/include/spa/utils/defs.h @@ -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