diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2022-10-11 12:03:48 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-11-11 05:46:51 +0000 |
commit | c1b073a9dccc11fbd9fdfd69f76de6e972ad1550 (patch) | |
tree | f1d964acc976491eee7c4dfa7be1c6dad2b24384 | |
parent | 933b4c333c8f9a78280def62bab55eee5a6b2456 (diff) | |
download | edk2-c1b073a9dccc11fbd9fdfd69f76de6e972ad1550.tar.gz edk2-c1b073a9dccc11fbd9fdfd69f76de6e972ad1550.tar.bz2 edk2-c1b073a9dccc11fbd9fdfd69f76de6e972ad1550.zip |
MdePkg/Include/Library: Undefine _ASSERT() if already defined
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134
When unit testing is enabled, make sure _ASSERT() is not already
defined by the host environment before defining _ASSERT(). This
avoids conflicts with VS20xx builds of GoogleTest based unit tests.
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
-rw-r--r-- | MdePkg/Include/Library/DebugLib.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index 8d3d08638d..9110be2f41 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -337,6 +337,9 @@ UnitTestDebugAssert ( IN CONST CHAR8 *Description
);
+ #if defined (_ASSERT)
+ #undef _ASSERT
+ #endif
#if defined (__clang__) && defined (__FILE_NAME__)
#define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
#else
|