spa: Only test __cplusplus value when it's defined

In higher warning levels, clang complains about testing the value of
__cplusplus when it's not defined.
This commit is contained in:
Daniel Stone 2021-08-03 12:59:26 +01:00 committed by George Kiagiadakis
parent 99359c3998
commit bf112940d0

View file

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