summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2015-06-19 20:12:43 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-06 15:11:01 (GMT)
commit61bbbdcf9c0d1aed584fb976cd20c55ee9077850 (patch)
treeacf8514412a91b4057e7792eec9826fe7213e32e
parentde70c922d9c846cf3a6fabfbedd054c02f4b8934 (diff)
downloadCMake-61bbbdcf9c0d1aed584fb976cd20c55ee9077850.zip
CMake-61bbbdcf9c0d1aed584fb976cd20c55ee9077850.tar.gz
CMake-61bbbdcf9c0d1aed584fb976cd20c55ee9077850.tar.bz2
bindexplib: Fix treatment of some symbols
-rw-r--r--Source/bindexplib.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 4024e2f..6a63279 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -198,7 +198,16 @@ DumpExternalsObjects(PIMAGE_SYMBOL pSymbolTable,
symbol = stringTable + pSymbolTable->N.Name.Long;
}
+ // clear out any leading spaces
while (isspace(symbol[0])) symbol.erase(0,1);
+ // if it starts with _ and has an @ then it is a __cdecl
+ // so remove the @ stuff for the export
+ if(symbol[0] == '_') {
+ std::string::size_type posAt = symbol.find('@');
+ if (posAt != std::string::npos) {
+ symbol.erase(posAt);
+ }
+ }
if (symbol[0] == '_') symbol.erase(0,1);
if (fImportFlag) {
fImportFlag = 0;
@@ -210,9 +219,13 @@ DumpExternalsObjects(PIMAGE_SYMBOL pSymbolTable,
*/
const char *scalarPrefix = "??_G";
const char *vectorPrefix = "??_E";
+ // original code had a check for
+ // symbol.find("real@") == std::string::npos)
+ // but if this disallows memmber functions with the name real
+ // if scalarPrefix and vectorPrefix are not found then print
+ // the symbol
if (symbol.compare(0, 4, scalarPrefix) &&
- symbol.compare(0, 4, vectorPrefix) &&
- symbol.find("real@") == std::string::npos)
+ symbol.compare(0, 4, vectorPrefix) )
{
SectChar =
pSectionHeaders[pSymbolTable->SectionNumber-1].Characteristics;
@@ -224,7 +237,7 @@ DumpExternalsObjects(PIMAGE_SYMBOL pSymbolTable,
!(SectChar & IMAGE_SCN_MEM_READ)) {
fprintf(fout, "\t%s\n", symbol.c_str());
} else {
- // printf(" strange symbol: %s \n",s);
+ // printf(" strange symbol: %s \n",symbol.c_str());
}
}
}