From c64645fd6665411c1281dbd7359628fcaf59a9d1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 17 May 2014 10:58:10 +0000 Subject: [PATCH] [SPEC2DEF] Fix def file generation on non-86 svn path=/trunk/; revision=63323 --- reactos/tools/spec2def/spec2def.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/tools/spec2def/spec2def.c b/reactos/tools/spec2def/spec2def.c index c197cf5ef43..c7e907ccc57 100644 --- a/reactos/tools/spec2def/spec2def.c +++ b/reactos/tools/spec2def/spec2def.c @@ -329,7 +329,7 @@ PrintName(FILE *fileDest, EXPORT *pexp, PSTRING pstr, int fDeco) { /* Does the string already have stdcall decoration? */ pcAt = ScanToken(pcName, '@'); - if ((pcAt < (pcName + nNameLength)) && (pcName[0] == '_')) + if (pcAt && (pcAt < (pcName + nNameLength)) && (pcName[0] == '_')) { /* Skip leading underscore and remove trailing decoration */ pcName++; @@ -485,6 +485,7 @@ OutputLine_def_GCC(FILE *fileDest, EXPORT *pexp) int OutputLine_def(FILE *fileDest, EXPORT *pexp) { + DbgPrint("OutputLine_def: '%.*s'...\n", pexp->strName.len, pexp->strName.buf); fprintf(fileDest, " "); if (gbMSComp) @@ -684,6 +685,7 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) /* Get name */ exp.strName.buf = pc; exp.strName.len = TokenLength(pc); + DbgPrint("Got name: '%.*s'\n", exp.strName.len, exp.strName.buf); /* Check for autoname */ if ((exp.strName.len == 1) && (exp.strName.buf[0] == '@')) @@ -699,7 +701,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) if (exp.nCallingConvention != CC_EXTERN && exp.nCallingConvention != CC_STUB) { - //fprintf(stderr, "info: options:'%.10s'\n", pc); /* Go to next token */ if (!(pc = NextToken(pc))) {