Author: tkreuzer
Date: Sat May 10 14:12:20 2014
New Revision: 63218
URL:
http://svn.reactos.org/svn/reactos?rev=63218&view=rev
Log:
[SPEC2DEF]
Improve the previous fix.
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] Sat May 10 14:12:20 2014
@@ -325,7 +325,22 @@
int nNameLength = pstr->len;
const char* pcDot, *pcAt;
- if ((giArch == ARCH_X86) && fDeco &&
+ /* Check for non-x86 first */
+ if (giArch != ARCH_X86)
+ {
+ /* Does the string already have stdcall decoration? */
+ pcAt = ScanToken(pcName, '@');
+ if ((pcAt < (pcName + nNameLength)) && (pcName[0] == '_'))
+ {
+ /* Skip leading underscore and remove trailing decoration */
+ pcName++;
+ nNameLength = pcAt - pcName;
+ }
+
+ /* Print the undecorated function name */
+ fprintf(fileDest, "%.*s", nNameLength, pcName);
+ }
+ else if (fDeco &&
((pexp->nCallingConvention == CC_STDCALL) ||
(pexp->nCallingConvention == CC_FASTCALL)))
{
@@ -370,15 +385,6 @@
}
else
{
- /* Does the string already have stdcall decoration? */
- pcAt = ScanToken(pcName, '@');
- if (pcAt && (pcAt < (pcName + nNameLength)) && pcName[0] ==
'_')
- {
- /* Skip leading underscore and remove trailing decoration */
- pcName++;
- nNameLength = pcAt - pcName;
- }
-
/* Print the undecorated function name */
fprintf(fileDest, "%.*s", nNameLength, pcName);
}