Fixed track EDKT153, change PCDAutogen code to generate static variable referent...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 30 Jul 2006 14:48:14 +0000 (14:48 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 30 Jul 2006 14:48:14 +0000 (14:48 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1153 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java

index 2abcea8..2f7d5ae 100644 (file)
@@ -259,14 +259,27 @@ public class UsageInstance {
                                          parentToken.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
                                          parentToken.cName);\r
             if (!isBuildUsedLibrary) {\r
-                hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
-                                             parentToken.cName, \r
-                                             printDatum);\r
-                if (isByteArray) {\r
-                    cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_%s[] = _PCD_VALUE_%s;\r\n",\r
-                                                 parentToken.cName,\r
-                                                 parentToken.cName);\r
+                if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {\r
+                    if (isByteArray) {\r
+                        hAutogenStr += String.format("#define _PCD_VALUE_%s   (VOID*)_gPcd_FixedAtBuild_%s\r\n", \r
+                                                     parentToken.cName, \r
+                                                     parentToken.cName);\r
+                        cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_%s[] = %s;\r\n",\r
+                                                     parentToken.cName,\r
+                                                     printDatum);\r
+                    } else {\r
+                        hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                                     parentToken.cName, \r
+                                                     printDatum);\r
+                        cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
+                                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                                     parentToken.cName,\r
+                                                     parentToken.cName);\r
+                    }\r
                 } else {\r
+                    hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                                 parentToken.cName, \r
+                                                 printDatum);\r
                     cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
                                                  Token.getAutogendatumTypeString(parentToken.datumType),\r
                                                  parentToken.cName,\r