Author: tkreuzer
Date: Tue Feb 18 20:06:50 2014
New Revision: 62250
URL:
http://svn.reactos.org/svn/reactos?rev=62250&view=rev
Log:
[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.
Modified:
trunk/reactos/tools/spec2def/spec2def.c
Modified: trunk/reactos/tools/spec2def/spec2def.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
==============================================================================
--- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Tue Feb 18 20:06:50 2014
@@ -51,6 +51,7 @@
FL_PRIVATE = 1,
FL_STUB = 2,
FL_NONAME = 4,
+ FL_ORDINAL = 8,
};
enum
@@ -476,7 +477,7 @@
else
OutputLine_def_GCC(fileDest, pexp);
- if (pexp->nOrdinal != -1)
+ if (pexp->uFlags & FL_ORDINAL)
{
fprintf(fileDest, " @%d", pexp->nOrdinal);
}
@@ -541,8 +542,13 @@
// nLine, TokenLength(pc), pc);
/* Now we should get either an ordinal or @ */
- if (*pc == '@') exp.nOrdinal = -1;
- else exp.nOrdinal = atol(pc);
+ if (*pc == '@')
+ exp.nOrdinal = -1;
+ else
+ {
+ exp.nOrdinal = atol(pc);
+ exp.uFlags |= FL_ORDINAL;
+ }
/* Go to next token (type) */
if (!(pc = NextToken(pc)))
@@ -627,10 +633,13 @@
{
exp.uFlags |= FL_PRIVATE;
}
- else if (CompareToken(pc, "-noname") ||
- CompareToken(pc, "-ordinal"))
- {
- exp.uFlags |= FL_NONAME;
+ else if (CompareToken(pc, "-noname"))
+ {
+ exp.uFlags |= FL_ORDINAL | FL_NONAME;
+ }
+ else if (CompareToken(pc, "-ordinal"))
+ {
+ exp.uFlags |= FL_ORDINAL;
}
else if (CompareToken(pc, "-stub"))
{
@@ -667,7 +676,7 @@
sprintf(namebuffer, "ordinal%d", exp.nOrdinal);
exp.strName.len = strlen(namebuffer);
exp.strName.buf = namebuffer;
- exp.uFlags |= FL_NONAME;
+ exp.uFlags |= FL_ORDINAL | FL_NONAME;
}
/* Handle parameters */
@@ -804,9 +813,10 @@
}
/* Check for no-name without ordinal */
- if ((exp.uFlags & FL_NONAME) && (exp.nOrdinal == -1))
- {
- fprintf(stderr, "error: line %d, noname export without ordinal!\n",
nLine);
+ if ((exp.uFlags & FL_ORDINAL) && (exp.nOrdinal == -1))
+ {
+ fprintf(stderr, "error: line %d, ordinal export without
ordinal!\n", nLine);
+ return -1;
}
OutputLine(fileDest, &exp);