From 25312489050e3f2efca92d82a0b6dfa00bc99892 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 <mhaeuser@posteo.de> --- 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 e02970a052..03e84f3f3a 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -802,7 +802,7 @@ typedef UINTN *BASE_LIST; **/ #ifdef MDE_CPU_EBC #define STATIC_ASSERT(Expression, Message) -#elif defined (_MSC_EXTENSIONS) || defined (__cplusplus) +#elif defined (_MSC_EXTENSIONS) || defined (__cpp_static_assert) #define STATIC_ASSERT static_assert #else #define STATIC_ASSERT _Static_assert