summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorBob Feng <bob.c.feng@intel.com>2020-10-15 19:20:37 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-10-26 02:58:00 +0000
commitb70c4fdcde83689d8cd1e5e2faf598d0087934a3 (patch)
tree3b07a29b7cab7d49c7ac3d473cea9560ae35c327 /BaseTools
parent264eccb5dfc345c2e004883f00e62959f818fafd (diff)
downloadedk2-b70c4fdcde83689d8cd1e5e2faf598d0087934a3.tar.gz
edk2-b70c4fdcde83689d8cd1e5e2faf598d0087934a3.tar.bz2
edk2-b70c4fdcde83689d8cd1e5e2faf598d0087934a3.zip
BaseTools: Fix PcdValueInit tool build issue with VS compiler x64
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3001 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 <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/C/Common/PcdValueCommon.h2
1 files changed, 1 insertions, 1 deletions
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
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#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) == 0) Size = MAX((__OFFSET_OF(TYPE, Field) + __ARRAY_ELEMENT_SIZE(TYPE, Field) * (MaxIndex)), Size)
#define __ARRAY_SIZE(Array) (sizeof(Array)/sizeof(Array[0]))