Author: akhaldi
Date: Thu Oct 6 11:10:54 2011
New Revision: 54021
URL:
http://svn.reactos.org/svn/reactos?rev=54021&view=rev
Log:
[SPEC2DEF]
* Support thiscall and float specifiers. By Samuel Serapion.
See issue #6539 for more details.
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] Thu Oct 6 11:10:54 2011
@@ -54,6 +54,7 @@
CC_STDCALL,
CC_CDECL,
CC_FASTCALL,
+ CC_THISCALL,
CC_EXTERN,
CC_STUB,
};
@@ -65,7 +66,8 @@
ARG_STR,
ARG_WSTR,
ARG_DBL,
- ARG_INT64
+ ARG_INT64,
+ ARG_FLOAT
};
char* astrCallingConventions[] =
@@ -73,6 +75,7 @@
"STDCALL",
"CDECL",
"FASTCALL",
+ "THISCALL",
"EXTERN"
};
@@ -189,6 +192,7 @@
case ARG_STR: fprintf(file, "char*"); break;
case ARG_WSTR: fprintf(file, "wchar_t*"); break;
case ARG_DBL: case ARG_INT64 : fprintf(file, "__int64"); break;
+ case ARG_FLOAT: fprintf(file, "float"); break;
}
fprintf(file, " a%d", i);
}
@@ -206,6 +210,7 @@
case ARG_WSTR: fprintf(file, "'%%ws'"); break;
case ARG_DBL: fprintf(file, "%%f"); break;
case ARG_INT64: fprintf(file, "%%\"PRix64\""); break;
+ case ARG_FLOAT: fprintf(file, "%%f"); break;
}
}
fprintf(file, ")\\n\"");
@@ -221,6 +226,7 @@
case ARG_WSTR: fprintf(file, "(wchar_t*)a%d", i); break;
case ARG_DBL: fprintf(file, "(double)a%d", i); break;
case ARG_INT64: fprintf(file, "(__int64)a%d", i); break;
+ case ARG_FLOAT: fprintf(file, "(float)a%d", i); break;
}
}
fprintf(file, ");\n");
@@ -451,6 +457,10 @@
else if (CompareToken(pc, "fastcall"))
{
exp.nCallingConvention = CC_FASTCALL;
+ }
+ else if (CompareToken(pc, "thiscall"))
+ {
+ exp.nCallingConvention = CC_THISCALL;
}
else if (CompareToken(pc, "extern"))
{
@@ -590,6 +600,11 @@
exp.nStackBytes += 8;
exp.anArgs[exp.nArgCount] = ARG_INT64;
}
+ else if (CompareToken(pc, "float"))
+ {
+ exp.nStackBytes += 4;
+ exp.anArgs[exp.nArgCount] = ARG_FLOAT;
+ }
else
fprintf(stderr, "error: line %d, expected type, got:
%.10s\n", nLine, pc);