From 6336e5366b871edf0afc0b235d7ab1239af4ec1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20Ha=CC=88user?= <8659494+mhaeuser@users.noreply.github.com> Date: Wed, 8 Mar 2023 17:02:48 +0100 Subject: [PATCH] MdePkg/Base.h: Only use C++ static_assert when supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To support GoogleTest, 933b4c3 added support for C++ static_assert. However, this is not a mandatory or universally supported C++ feature. Guard its usage by the __cpp_static_assert support flag. Signed-off-by: Marvin Häuser --- MdePkg/Include/Base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index ee5940a2d1..900523df66 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -800,7 +800,7 @@ typedef UINTN *BASE_LIST; @param Message Raised compiler diagnostic message when expression is false. **/ -#if defined (__cplusplus) +#if defined (__cpp_static_assert) #define STATIC_ASSERT static_assert #elif defined (__GNUC__) || defined (__clang__) #define STATIC_ASSERT _Static_assert