Changeset 21916 for trunk/tools/impdef/ImpDef.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/tools/impdef/ImpDef.cpp
r8002 r21916 14 14 #include <string.h> 15 15 #include <stdlib.h> 16 17 #include <string> 18 #include <set> 16 19 17 20 #include "kTypes.h" … … 186 189 static long processFile(const char *pszInput, const char *pszOutput, const POPTIONS pOptions) 187 190 { 191 std::set<std::string> exports; 192 188 193 long lRc = 0; 189 194 … … 197 202 { 198 203 kFile * pOutput = new kFile(pszOutput, FALSE); 199 kExportEntry exp ort;204 kExportEntry exp; 200 205 201 206 /* generate LIBRARY line */ … … 210 215 211 216 /* Exports */ 212 if (pDefFile->exportFindFirst(&exp ort))217 if (pDefFile->exportFindFirst(&exp)) 213 218 { 214 219 pOutput->printf("EXPORTS\n"); 215 220 do 216 221 { 217 char szName[MAXEXPORTNAME ];222 char szName[MAXEXPORTNAME + 2 /*quotes*/]; 218 223 const char *pszName; 219 224 220 225 /* validate export struct */ 221 if (exp ort.achName[0] == '\0')226 if (exp.achName[0] == '\0') 222 227 { 223 228 kFile::StdErr.printf( 224 229 "Warning export name is missing.\n" 225 230 "info:\texport.achIntName=%s\n\texport.achName=%s\n\texport.ulOrdinal=%ld\n", 226 exp ort.achIntName, export.achName, export.ulOrdinal);231 exp.achIntName, exp.achName, exp.ulOrdinal); 227 232 continue; 228 233 } 229 if (exp ort.ulOrdinal == ~0UL)234 if (exp.ulOrdinal == ~0UL) 230 235 { 231 236 kFile::StdErr.printf( 232 237 "warning: export is missing ordinal value. Export is ignored\n" 233 238 "info:\texport.achIntName=%s\n\texport.achName=%s\n\texport.ulOrdinal=%ld\n", 234 exp ort.achIntName, export.achName, export.ulOrdinal);239 exp.achIntName, exp.achName, exp.ulOrdinal); 235 240 continue; 236 241 } 237 242 238 243 /* real work */ 239 pszName = generateExportName(&export, &szName[0], pOptions); 240 241 pOutput->printf(" %-*s @%ld\n", 40, pszName, export.ulOrdinal); 242 } while (pDefFile->exportFindNext(&export)); 244 pszName = generateExportName(&exp, &szName[1], pOptions); 245 if (exports.count(pszName) == 0) { 246 exports.insert(pszName); 247 szName[0] = '"'; 248 strcat(szName, "\""); 249 pszName = szName; 250 251 pOutput->printf(" %-*s @%ld\n", 40, pszName, exp.ulOrdinal); 252 } 253 } while (pDefFile->exportFindNext(&exp)); 243 254 pOutput->setSize(); 244 255 delete pOutput;
Note:
See TracChangeset
for help on using the changeset viewer.