From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web10.4932.1603069406217315069 for ; Sun, 18 Oct 2020 18:03:27 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 19 Oct 2020 09:03:24 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Sean Brogan'" , , Cc: "'Yuwei Chen'" , "'Michael D Kinney'" , "'Sean Brogan'" References: <20201015112037.26556-1-bob.c.feng@intel.com> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BhdGNoXSBCYXNlVG9vbHM6IEZpeCBQY2RWYWx1ZUluaXQgdG9vbCBidWlsZCBpc3N1ZSB3aXRoIFZTIGNvbXBpbGVyIHg2NA==?= Date: Mon, 19 Oct 2020 09:03:23 +0800 Message-ID: <000701d6a5b3$a50ed4f0$ef2c7ed0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQLrgAxI5MVKTkD210Opd6iTWwnPmwOQzVMxp1fgs+A= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Sean and Bob: How verify this change? Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Sean Brogan > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: = 2020=E5=B9=B410=E6=9C=8817=E6=97=A5 6:17 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; = bob.c.feng@intel.com > =E6=8A=84=E9=80=81: Liming Gao ; Yuwei Chen > ; Michael D Kinney ; > Sean Brogan > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [Patch] BaseTools: Fix = PcdValueInit tool build issue > with VS compiler x64 >=20 > Reviewed-by: Sean Brogan >=20 > On 10/15/2020 4:20 AM, Bob Feng wrote: > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3001 > > > > When the 64-bit version of VS compiler is used, the generated > > PcdValueInit tool will be failed to compile. > > > > This patch is going to fix that issue. > > > > Signed-off-by: Bob Feng > > Cc: Liming Gao > > Cc: Yuwei Chen > > Cc: Michael D Kinney > > Cc: Sean Brogan > > > > --- > > BaseTools/Source/C/Common/PcdValueCommon.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/BaseTools/Source/C/Common/PcdValueCommon.h > b/BaseTools/Source/C/Common/PcdValueCommon.h > > index cfd3bb76e1..1652bd5430 100644 > > --- a/BaseTools/Source/C/Common/PcdValueCommon.h > > +++ b/BaseTools/Source/C/Common/PcdValueCommon.h > > @@ -12,11 +12,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #include > > #include > > > > #define __FIELD_SIZE(TYPE, Field) (sizeof((TYPE *)0)->Field) > > #define __ARRAY_ELEMENT_SIZE(TYPE, Field) (sizeof((TYPE > *)0)->Field[0]) > > -#define __OFFSET_OF(TYPE, Field) ((UINT32) &(((TYPE *)0)->Field)) > > +#define __OFFSET_OF(TYPE, Field) ((UINT32)(size_t) &(((TYPE = *)0)->Field)) > > #define __FLEXIBLE_SIZE(Size, TYPE, Field, MaxIndex) if > (__FIELD_SIZE(TYPE, Field) =3D=3D 0) Size =3D MAX((__OFFSET_OF(TYPE, = Field) + > __ARRAY_ELEMENT_SIZE(TYPE, Field) * (MaxIndex)), Size) > > #define __ARRAY_SIZE(Array) (sizeof(Array)/sizeof(Array[0])) > > > > #if defined(_MSC_EXTENSIONS) > > #define __STATIC_ASSERT static_assert > >