From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.2518.1667593537052236213 for ; Fri, 04 Nov 2022 13:25:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=D0w5NY6g; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: michael.d.kinney@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667593537; x=1699129537; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BwWNkpRGJajojthHXMC9Vm+CrImh6xGy6pf1xF1diJo=; b=D0w5NY6gdmIaF/wBrAlejvFjy4606hUVDpkc8/P5ZqcWuWxf1obBfKYp F/ruEzCeCzGQOBnXIgJnPy+5MfGN8JVlyMp850fJiiKi4xGMcohL0NVMc 7HsKDpVOchfTa2tYh86CA/F4xh9OYxMOWVcXwiTPnjvTq3bT2PidJ9h03 Lvwr1Z44UwyT4ajZtulIgokf2ztulG/1f3/f1EoCKUHcoznhajO45Je56 7HSPIOr832E7SKEKbbqVlhEKjK7UMsYPcEHJTqnMMlIAbgh2evTh6f/Hi DtCFjAisIftliQDFdfoQuy7aARHQF079yiSuBAVxHmUFIYWVqytcSjcsW g==; X-IronPort-AV: E=McAfee;i="6500,9779,10521"; a="396363607" X-IronPort-AV: E=Sophos;i="5.96,138,1665471600"; d="scan'208";a="396363607" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 13:25:37 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10521"; a="777839152" X-IronPort-AV: E=Sophos;i="5.96,138,1665471600"; d="scan'208";a="777839152" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.212.255.31]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 13:25:37 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Liming Gao , Zhiguang Liu Subject: [Patch V2 2/7] MdePkg/Include/Library: Undefine _ASSERT() if already defined Date: Fri, 4 Nov 2022 13:25:23 -0700 Message-Id: <20221104202528.1157-3-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20221104202528.1157-1-michael.d.kinney@intel.com> References: <20221104202528.1157-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Zhiguang Liu Signed-off-by: Michael D Kinney --- 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