Sync tool code to BuildTools project r1739.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9397 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2009-11-09 11:47:35 +00:00
parent 4c913fe619
commit b303ea726e
65 changed files with 1840 additions and 583 deletions

View File

@@ -628,23 +628,27 @@ CVfrCompiler::GenCFile (
if (!IS_RUN_STATUS(STATUS_GENBINARY)) {
goto Fail;
}
if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {
if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
Error (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
goto Fail;
}
if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
Error (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
goto Fail;
}
for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
}
for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
}
if (mOptions.CompatibleMode) {
gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
}
gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
fclose (pFile);
goto Fail;
}
fclose (pFile);
goto Fail;
}
fclose (pFile);
SET_RUN_STATUS (STATUS_FINISHED);
return;