From bf112940d0bf8f526dd6229a619c1283835b49c2 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 3 Aug 2021 12:59:26 +0100 Subject: [PATCH] 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. --- spa/include/spa/utils/defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index d87038577..36f1789dc 100644 --- a/spa/include/spa/utils/defs.h +++ b/spa/include/spa/utils/defs.h @@ -60,7 +60,7 @@ extern "C" { * 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. */ # define SPA_FALLTHROUGH [[clang::fallthrough]]; #elif __GNUC__ >= 7 || __clang_major__ >= 10