[SPEC2DEF]

Don't make exports by ordinal NONAME automatically. Fixes a bunch of tests. Thanks to Amine for finding the problem in the first place.

svn path=/trunk/; revision=62250
This commit is contained in:
Timo Kreuzer 2014-02-18 20:06:50 +00:00
parent 7792a6513b
commit ab51c09946

View file

@ -51,6 +51,7 @@ enum
FL_PRIVATE = 1, FL_PRIVATE = 1,
FL_STUB = 2, FL_STUB = 2,
FL_NONAME = 4, FL_NONAME = 4,
FL_ORDINAL = 8,
}; };
enum enum
@ -476,7 +477,7 @@ OutputLine_def(FILE *fileDest, EXPORT *pexp)
else else
OutputLine_def_GCC(fileDest, pexp); OutputLine_def_GCC(fileDest, pexp);
if (pexp->nOrdinal != -1) if (pexp->uFlags & FL_ORDINAL)
{ {
fprintf(fileDest, " @%d", pexp->nOrdinal); fprintf(fileDest, " @%d", pexp->nOrdinal);
} }
@ -541,8 +542,13 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
// nLine, TokenLength(pc), pc); // nLine, TokenLength(pc), pc);
/* Now we should get either an ordinal or @ */ /* Now we should get either an ordinal or @ */
if (*pc == '@') exp.nOrdinal = -1; if (*pc == '@')
else exp.nOrdinal = atol(pc); exp.nOrdinal = -1;
else
{
exp.nOrdinal = atol(pc);
exp.uFlags |= FL_ORDINAL;
}
/* Go to next token (type) */ /* Go to next token (type) */
if (!(pc = NextToken(pc))) if (!(pc = NextToken(pc)))
@ -627,10 +633,13 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
{ {
exp.uFlags |= FL_PRIVATE; exp.uFlags |= FL_PRIVATE;
} }
else if (CompareToken(pc, "-noname") || else if (CompareToken(pc, "-noname"))
CompareToken(pc, "-ordinal"))
{ {
exp.uFlags |= FL_NONAME; exp.uFlags |= FL_ORDINAL | FL_NONAME;
}
else if (CompareToken(pc, "-ordinal"))
{
exp.uFlags |= FL_ORDINAL;
} }
else if (CompareToken(pc, "-stub")) else if (CompareToken(pc, "-stub"))
{ {
@ -667,7 +676,7 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
sprintf(namebuffer, "ordinal%d", exp.nOrdinal); sprintf(namebuffer, "ordinal%d", exp.nOrdinal);
exp.strName.len = strlen(namebuffer); exp.strName.len = strlen(namebuffer);
exp.strName.buf = namebuffer; exp.strName.buf = namebuffer;
exp.uFlags |= FL_NONAME; exp.uFlags |= FL_ORDINAL | FL_NONAME;
} }
/* Handle parameters */ /* Handle parameters */
@ -804,9 +813,10 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
} }
/* Check for no-name without ordinal */ /* Check for no-name without ordinal */
if ((exp.uFlags & FL_NONAME) && (exp.nOrdinal == -1)) if ((exp.uFlags & FL_ORDINAL) && (exp.nOrdinal == -1))
{ {
fprintf(stderr, "error: line %d, noname export without ordinal!\n", nLine); fprintf(stderr, "error: line %d, ordinal export without ordinal!\n", nLine);
return -1;
} }
OutputLine(fileDest, &exp); OutputLine(fileDest, &exp);