[SPEC2DEF]

Fix creation of stubs for c++ mangled names

svn path=/trunk/; revision=52765
This commit is contained in:
Timo Kreuzer 2011-07-21 18:39:24 +00:00
parent c5dc599680
commit 59f0449d2a

View file

@ -19,6 +19,7 @@ typedef struct
int nArgCount;
int anArgs[30];
unsigned int uFlags;
int nNumber;
} EXPORT;
enum _ARCH
@ -168,7 +169,15 @@ OutputLine_stub(FILE *file, EXPORT *pexp)
fprintf(file, "__stdcall ");
}
fprintf(file, "%.*s(", pexp->nNameLength, pexp->pcName);
/* Check for C++ */
if (pexp->pcName[0] == '?')
{
fprintf(file, "stub_function%d(", pexp->nNumber);
}
else
{
fprintf(file, "%.*s(", pexp->nNameLength, pexp->pcName);
}
for (i = 0; i < pexp->nArgCount; i++)
{
@ -334,6 +343,13 @@ OutputLine_def(FILE *fileDest, EXPORT *pexp)
fprintf(fileDest, "=");
PrintName(fileDest, pexp, "", 1, fDeco && !gbMSComp);
}
else if (((pexp->uFlags & FL_STUB) || (pexp->nCallingConvention == CC_STUB)) &&
(pexp->pcName[0] == '?'))
{
/* C++ stubs are forwarded to C stubs */
fprintf(fileDest, "=");
fprintf(fileDest, "stub_function%d(", pexp->nNumber);
}
else if ((giArch == ARCH_X86) && gbKillAt && !gbMSComp &&
(pexp->nCallingConvention == CC_STDCALL ||
pexp->nCallingConvention == CC_FASTCALL))
@ -379,12 +395,14 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
/* Loop all lines */
nLine = 1;
exp.nNumber = 0;
for (pcLine = pcStart; *pcLine; pcLine = NextLine(pcLine), nLine++)
{
pc = pcLine;
exp.nArgCount = 0;
exp.uFlags = 0;
exp.nNumber++;
//fprintf(stderr, "info: line %d, token:'%d, %.20s'\n",
// nLine, TokenLength(pcLine), pcLine);
@ -591,7 +609,7 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
/* Check for c++ mangled name */
if (pc[0] == '?')
{
printf("Found c++ mangled name...\n");
//printf("Found c++ mangled name...\n");
//
}
else