Author: hpoussin Date: Sun Jul 27 04:12:37 2008 New Revision: 34837
URL: http://svn.reactos.org/svn/reactos?rev=34837&view=rev Log: Add support for fastcall functions in .spec files
Modified: trunk/reactos/tools/winebuild/build.h trunk/reactos/tools/winebuild/parser.c trunk/reactos/tools/winebuild/spec32.c
Modified: trunk/reactos/tools/winebuild/build.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/build.h?rev... ============================================================================== --- trunk/reactos/tools/winebuild/build.h [iso-8859-1] (original) +++ trunk/reactos/tools/winebuild/build.h [iso-8859-1] Sun Jul 27 04:12:37 2008 @@ -40,6 +40,7 @@ TYPE_STDCALL, /* stdcall function (Win32) */ TYPE_CDECL, /* cdecl function (Win32) */ TYPE_VARARGS, /* varargs function (Win32) */ + TYPE_FASTCALL, /* fastcall function (Win32) */ TYPE_EXTERN, /* external symbol (Win32) */ TYPE_NBTYPES } ORD_TYPE;
Modified: trunk/reactos/tools/winebuild/parser.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/parser.c?re... ============================================================================== --- trunk/reactos/tools/winebuild/parser.c [iso-8859-1] (original) +++ trunk/reactos/tools/winebuild/parser.c [iso-8859-1] Sun Jul 27 04:12:37 2008 @@ -57,6 +57,7 @@ "stdcall", /* TYPE_STDCALL */ "cdecl", /* TYPE_CDECL */ "varargs", /* TYPE_VARARGS */ + "fastcall", /* TYPE_FASTCALL */ "extern" /* TYPE_EXTERN */ };
@@ -490,6 +491,7 @@ case TYPE_STDCALL: case TYPE_VARARGS: case TYPE_CDECL: + case TYPE_FASTCALL: if (!parse_spec_export( odp, spec )) goto error; break; case TYPE_ABS:
Modified: trunk/reactos/tools/winebuild/spec32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/spec32.c?re... ============================================================================== --- trunk/reactos/tools/winebuild/spec32.c [iso-8859-1] (original) +++ trunk/reactos/tools/winebuild/spec32.c [iso-8859-1] Sun Jul 27 04:12:37 2008 @@ -577,23 +577,25 @@
if (!(odp->flags & FLAG_PRIVATE)) total++;
- - output( " %s", name ); - switch(odp->type) { case TYPE_EXTERN: + output( " %s", name ); 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_CDECL: /* try to reduce output */ + output( " %s", name ); if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD)) output( "=%s", odp->link_name ); break; case TYPE_STDCALL: { 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) { @@ -606,8 +608,25 @@ } 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: { + output( " %s", name ); if (!kill_at) { const char *check = name + strlen(name);