mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:23:14 +00:00
Add support for fastcall functions in .spec files
svn path=/trunk/; revision=34837
This commit is contained in:
parent
0bd0421c3b
commit
615f0216fa
3 changed files with 26 additions and 4 deletions
|
@ -40,6 +40,7 @@ typedef enum
|
||||||
TYPE_STDCALL, /* stdcall function (Win32) */
|
TYPE_STDCALL, /* stdcall function (Win32) */
|
||||||
TYPE_CDECL, /* cdecl function (Win32) */
|
TYPE_CDECL, /* cdecl function (Win32) */
|
||||||
TYPE_VARARGS, /* varargs function (Win32) */
|
TYPE_VARARGS, /* varargs function (Win32) */
|
||||||
|
TYPE_FASTCALL, /* fastcall function (Win32) */
|
||||||
TYPE_EXTERN, /* external symbol (Win32) */
|
TYPE_EXTERN, /* external symbol (Win32) */
|
||||||
TYPE_NBTYPES
|
TYPE_NBTYPES
|
||||||
} ORD_TYPE;
|
} ORD_TYPE;
|
||||||
|
|
|
@ -57,6 +57,7 @@ static const char * const TypeNames[TYPE_NBTYPES] =
|
||||||
"stdcall", /* TYPE_STDCALL */
|
"stdcall", /* TYPE_STDCALL */
|
||||||
"cdecl", /* TYPE_CDECL */
|
"cdecl", /* TYPE_CDECL */
|
||||||
"varargs", /* TYPE_VARARGS */
|
"varargs", /* TYPE_VARARGS */
|
||||||
|
"fastcall", /* TYPE_FASTCALL */
|
||||||
"extern" /* TYPE_EXTERN */
|
"extern" /* TYPE_EXTERN */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -490,6 +491,7 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec )
|
||||||
case TYPE_STDCALL:
|
case TYPE_STDCALL:
|
||||||
case TYPE_VARARGS:
|
case TYPE_VARARGS:
|
||||||
case TYPE_CDECL:
|
case TYPE_CDECL:
|
||||||
|
case TYPE_FASTCALL:
|
||||||
if (!parse_spec_export( odp, spec )) goto error;
|
if (!parse_spec_export( odp, spec )) goto error;
|
||||||
break;
|
break;
|
||||||
case TYPE_ABS:
|
case TYPE_ABS:
|
||||||
|
|
|
@ -577,23 +577,25 @@ void BuildDef32File( DLLSPEC *spec )
|
||||||
|
|
||||||
if (!(odp->flags & FLAG_PRIVATE)) total++;
|
if (!(odp->flags & FLAG_PRIVATE)) total++;
|
||||||
|
|
||||||
|
|
||||||
output( " %s", name );
|
|
||||||
|
|
||||||
switch(odp->type)
|
switch(odp->type)
|
||||||
{
|
{
|
||||||
case TYPE_EXTERN:
|
case TYPE_EXTERN:
|
||||||
|
output( " %s", name );
|
||||||
is_data = 1;
|
is_data = 1;
|
||||||
/* fall through */
|
if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))
|
||||||
|
output( "=%s", odp->link_name );
|
||||||
|
break;
|
||||||
case TYPE_VARARGS:
|
case TYPE_VARARGS:
|
||||||
case TYPE_CDECL:
|
case TYPE_CDECL:
|
||||||
/* try to reduce output */
|
/* try to reduce output */
|
||||||
|
output( " %s", name );
|
||||||
if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))
|
if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))
|
||||||
output( "=%s", odp->link_name );
|
output( "=%s", odp->link_name );
|
||||||
break;
|
break;
|
||||||
case TYPE_STDCALL:
|
case TYPE_STDCALL:
|
||||||
{
|
{
|
||||||
int at_param = strlen(odp->u.func.arg_types) * get_ptr_size();
|
int at_param = strlen(odp->u.func.arg_types) * get_ptr_size();
|
||||||
|
output( " %s", name );
|
||||||
if (!kill_at) output( "@%d", at_param );
|
if (!kill_at) output( "@%d", at_param );
|
||||||
if (odp->flags & FLAG_FORWARD)
|
if (odp->flags & FLAG_FORWARD)
|
||||||
{
|
{
|
||||||
|
@ -606,8 +608,25 @@ void BuildDef32File( DLLSPEC *spec )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TYPE_FASTCALL:
|
||||||
|
{
|
||||||
|
int at_param = strlen(odp->u.func.arg_types) * get_ptr_size();
|
||||||
|
output( " @%s", name );
|
||||||
|
if (!kill_at) output( "@%d", at_param );
|
||||||
|
if (odp->flags & FLAG_FORWARD)
|
||||||
|
{
|
||||||
|
output( "=@%s", odp->link_name );
|
||||||
|
}
|
||||||
|
else if (strcmp(name, odp->link_name)) /* try to reduce output */
|
||||||
|
{
|
||||||
|
output( "=@%s", odp->link_name );
|
||||||
|
if (!kill_at) output( "@%d", at_param );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case TYPE_STUB:
|
case TYPE_STUB:
|
||||||
{
|
{
|
||||||
|
output( " %s", name );
|
||||||
if (!kill_at)
|
if (!kill_at)
|
||||||
{
|
{
|
||||||
const char *check = name + strlen(name);
|
const char *check = name + strlen(name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue