Reviewed-by: Liming Gao <gaolim...@byosoft.com.cn> > -----邮件原件----- > 发件人: Michael D Kinney <michael.d.kin...@intel.com> > 发送时间: 2022年11月5日 4:25 > 收件人: devel@edk2.groups.io > 抄送: Liming Gao <gaolim...@byosoft.com.cn>; Zhiguang Liu > <zhiguang....@intel.com> > 主题: [Patch V2 2/7] 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 <gaolim...@byosoft.com.cn> > Cc: Zhiguang Liu <zhiguang....@intel.com> > Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com> > --- > MdePkg/Include/Library/DebugLib.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/MdePkg/Include/Library/DebugLib.h > b/MdePkg/Include/Library/DebugLib.h > index 8d3d08638d73..9110be2f41b3 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 > -- > 2.37.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#96072): https://edk2.groups.io/g/devel/message/96072 Mute This Topic: https://groups.io/mt/94885501/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-