From 37e863f3c1afe7c8b1e038027bdcc1c0f52dfd58 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 22 Nov 2022 18:01:07 +0800 Subject: [PATCH] util: Fixes -Wundef in util/compiler.h Signed-off-by: Yonggang Luo Reviewed-by: Eric Engestrom Part-of: --- src/util/compiler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/compiler.h b/src/util/compiler.h index f6a358e2f04..ebb0ac8c94b 100644 --- a/src/util/compiler.h +++ b/src/util/compiler.h @@ -87,7 +87,8 @@ # define HAS_CLANG_FALLTHROUGH 0 #endif -#if __cplusplus >= 201703L || __STDC_VERSION__ > 201710L +#if (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201710L)) /* Standard C++17/C23 attribute */ #define FALLTHROUGH [[fallthrough]] #elif HAS_CLANG_FALLTHROUGH