mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 19:14:48 +00:00
[SPEC2DEF] Handle auto-naming of "@()" functions during output
This allows to do the parsing and output separately, since the generated name is no longer stored on the stack during parsing.
This commit is contained in:
parent
8b0086e465
commit
824e08c710
1 changed files with 12 additions and 7 deletions
|
@ -443,8 +443,8 @@ OutputLine_asmstub(FILE *fileDest, EXPORT *pexp)
|
||||||
/* Handle autoname */
|
/* Handle autoname */
|
||||||
if (pexp->strName.len == 1 && pexp->strName.buf[0] == '@')
|
if (pexp->strName.len == 1 && pexp->strName.buf[0] == '@')
|
||||||
{
|
{
|
||||||
sprintf(szNameBuffer, "%sordinal%d\n%sordinal%d: nop\n",
|
sprintf(szNameBuffer, "%s_stub_ordinal%d",
|
||||||
gpszUnderscore, pexp->nOrdinal, gpszUnderscore, pexp->nOrdinal);
|
gpszUnderscore, pexp->nOrdinal);
|
||||||
}
|
}
|
||||||
else if (giArch != ARCH_X86)
|
else if (giArch != ARCH_X86)
|
||||||
{
|
{
|
||||||
|
@ -496,6 +496,14 @@ PrintName(FILE *fileDest, EXPORT *pexp, PSTRING pstr, int fDeco)
|
||||||
const char *pcName = pstr->buf;
|
const char *pcName = pstr->buf;
|
||||||
int nNameLength = pstr->len;
|
int nNameLength = pstr->len;
|
||||||
const char* pcDot, *pcAt;
|
const char* pcDot, *pcAt;
|
||||||
|
char namebuffer[16];
|
||||||
|
|
||||||
|
if ((nNameLength == 1) && (pcName[0] == '@'))
|
||||||
|
{
|
||||||
|
sprintf(namebuffer, "ordinal%d", pexp->nOrdinal);
|
||||||
|
pcName = namebuffer;
|
||||||
|
nNameLength = strlen(namebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for non-x86 first */
|
/* Check for non-x86 first */
|
||||||
if (giArch != ARCH_X86)
|
if (giArch != ARCH_X86)
|
||||||
|
@ -570,7 +578,8 @@ OutputLine_def_MS(FILE *fileDest, EXPORT *pexp)
|
||||||
if (gbImportLib)
|
if (gbImportLib)
|
||||||
{
|
{
|
||||||
/* Redirect to a stub function, to get the right decoration in the lib */
|
/* Redirect to a stub function, to get the right decoration in the lib */
|
||||||
fprintf(fileDest, "=_stub_%.*s", pexp->strName.len, pexp->strName.buf);
|
fprintf(fileDest, "=_stub_");
|
||||||
|
PrintName(fileDest, pexp, &pexp->strName, 0);
|
||||||
}
|
}
|
||||||
else if (pexp->strTarget.buf)
|
else if (pexp->strTarget.buf)
|
||||||
{
|
{
|
||||||
|
@ -786,7 +795,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
|
||||||
int nLine;
|
int nLine;
|
||||||
EXPORT exp;
|
EXPORT exp;
|
||||||
int included, version_included;
|
int included, version_included;
|
||||||
char namebuffer[16];
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
//fprintf(stderr, "info: line %d, pcStart:'%.30s'\n", nLine, pcStart);
|
//fprintf(stderr, "info: line %d, pcStart:'%.30s'\n", nLine, pcStart);
|
||||||
|
@ -1029,9 +1037,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
|
||||||
/* Check for autoname */
|
/* Check for autoname */
|
||||||
if ((exp.strName.len == 1) && (exp.strName.buf[0] == '@'))
|
if ((exp.strName.len == 1) && (exp.strName.buf[0] == '@'))
|
||||||
{
|
{
|
||||||
sprintf(namebuffer, "ordinal%d", exp.nOrdinal);
|
|
||||||
exp.strName.len = strlen(namebuffer);
|
|
||||||
exp.strName.buf = namebuffer;
|
|
||||||
exp.uFlags |= FL_ORDINAL | FL_NONAME;
|
exp.uFlags |= FL_ORDINAL | FL_NONAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue