From nobody Mon Feb 9 15:09:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+96114+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+96114+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1667949185; cv=none; d=zohomail.com; s=zohoarc; b=eqnpfwadHsfzGCTI1aIxAblq6/3s60gfUlR2sy/AISMW4oDJwwSEW2M03a8/UZchcITdRFi9+uGvE97jit3wilmxmWjDxaTSMZenedVM+mCfU/evQvyKYcsFzLQJpZEXYuvYjpy6q+w8n+O1yiDusfhR71+E/wDJJo5FFmalzTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667949185; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mqv6cOJKWZHySS6OXuu/2+zGSJr3bXUvRwktVNOufRg=; b=QN5Yd+IP4X8xMMFHnSAAGAY3z5iigOsOkmgpn+ITUSq9gKaHFXtKR3kH77I6bDqTJRmlNoc3IrZjVx3nMaPmkqa74nuOwm5r6JjO9gpsIezvnar34m8D78sC29SwGYwy+7Mt7BgX9r5i0deIGBFCz7aUuHxrJPjHoThzXWVPK2Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+96114+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1667949185099559.5752069535082; Tue, 8 Nov 2022 15:13:05 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7K47YY1788612x6EjZ9DLfXw; Tue, 08 Nov 2022 15:13:04 -0800 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.21.1667949182063513285 for ; Tue, 08 Nov 2022 15:13:02 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="311990217" X-IronPort-AV: E=Sophos;i="5.96,149,1665471600"; d="scan'208";a="311990217" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 15:13:00 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="636512150" X-IronPort-AV: E=Sophos;i="5.96,149,1665471600"; d="scan'208";a="636512150" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.46.35]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 15:12:59 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Liming Gao , Zhiguang Liu Subject: [edk2-devel] [Patch v3 1/7] MdePkg/Include: Update Base.h to improve C++ compatibility Date: Tue, 8 Nov 2022 15:12:46 -0800 Message-Id: <20221108231252.1864-2-michael.d.kinney@intel.com> In-Reply-To: <20221108231252.1864-1-michael.d.kinney@intel.com> References: <20221108231252.1864-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: MvG8H7n1Lgh9eEphiE07PAm1x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1667949184; bh=oUTZnhU6f8z8VgBxPKN/h9cHLWWxqqQKLgIMibFIcr4=; h=Cc:Date:From:Reply-To:Subject:To; b=xAHJPKJZ+auflqN6hi9IW3crJwFPPgJu0xSEcR9bXqd2TRiyFKpvg70QQkayq0QiN/5 6fcCdxGeV9gQNabaP+i305ribObfgALakfaEB8W/VunKXXkW1euTDlgPY1bl6W+ql0SVO 2hgxD/m2C6UCSuzqE40TWhKMTmOkSqD8NZA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1667949185312100004 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4134 * Map NULL to nullptr or __null when c++ compiler is used. * Map STATIC_ASSERT to static_assert when a c++ compiler is used. * Typecast RETURN_SUCCESS to type RETURN_STATUS to match type used by all return error/warning status codes. C++ has stricter type checking and found this inconsistency. Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Michael D Kinney Reviewed-by: Liming Gao --- MdePkg/Include/Base.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index d19ddfe4bba7..d209e6de280a 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -309,7 +309,15 @@ struct _LIST_ENTRY { /// /// NULL pointer (VOID *) /// +#if defined (__cplusplus) + #if defined (_MSC_EXTENSIONS) +#define NULL nullptr + #else +#define NULL __null + #endif +#else #define NULL ((VOID *) 0) +#endif =20 // // Null character @@ -760,7 +768,7 @@ typedef UINTN *BASE_LIST; **/ #ifdef MDE_CPU_EBC #define STATIC_ASSERT(Expression, Message) -#elif defined (_MSC_EXTENSIONS) +#elif defined (_MSC_EXTENSIONS) || defined (__cplusplus) #define STATIC_ASSERT static_assert #else #define STATIC_ASSERT _Static_assert @@ -959,7 +967,7 @@ typedef UINTN RETURN_STATUS; /// /// The operation completed successfully. /// -#define RETURN_SUCCESS 0 +#define RETURN_SUCCESS (RETURN_STATUS)(0) =20 /// /// The image failed to load. --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#96114): https://edk2.groups.io/g/devel/message/96114 Mute This Topic: https://groups.io/mt/94902390/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-