BaseTools: Support PCD flexible values format

https://bugzilla.tianocore.org/show_bug.cgi?id=541

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu
2017-12-26 16:17:13 +08:00
parent 68ba919f78
commit 726c501c2c
9 changed files with 430 additions and 114 deletions

View File

@ -1033,6 +1033,8 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
if Pcd.DatumType in ['UINT64', 'UINT32', 'UINT16', 'UINT8']:
try:
if Value.upper().endswith('L'):
Value = Value[:-1]
if Value.upper().startswith('0X'):
ValueNumber = int (Value, 16)
else: