]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix build failure for DynamicEx Pcd used in the Library
authorYonghong Zhu <yonghong.zhu@intel.com>
Tue, 21 Mar 2017 09:06:47 +0000 (17:06 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 27 Mar 2017 02:40:21 +0000 (10:40 +0800)
Update DynExPcdTokenNumberMapping logic, currently even it is Library,
its self's Pcd is saved into ModulePcdList.

Fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=434
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/GenC.py

index c1d64cccfdba0b4b4305ced4a81e87c2aa7c09de..96b1459253fdebebc4ae82cc7a6b50b97425b42f 100644 (file)
@@ -674,10 +674,8 @@ gModuleTypeHeaderFile = {
 def DynExPcdTokenNumberMapping(Info, AutoGenH):\r
     ExTokenCNameList = []\r
     PcdExList        = []\r
-    if Info.IsLibrary:\r
-        PcdList = Info.LibraryPcdList\r
-    else:\r
-        PcdList = Info.ModulePcdList\r
+    # Even it is the Library, the PCD is saved in the ModulePcdList\r
+    PcdList = Info.ModulePcdList\r
     for Pcd in PcdList:\r
         if Pcd.Type in gDynamicExPcd:\r
             ExTokenCNameList.append(Pcd.TokenCName)\r
@@ -1155,7 +1153,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
             AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds are different Guids but same CName.\n')\r
             AutoGenH.Append('// #define %s  %s\n' % (PcdTokenName, PcdExTokenName))\r
             AutoGenH.Append('// #define %s  LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
-            AutoGenH.Append('// #define %s  LibPcdGetExSize(&%s, %s \n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))\r
+            AutoGenH.Append('// #define %s  LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))\r
             if Pcd.DatumType == 'VOID*':\r
                 AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer)  LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
                 AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer)  LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r