TYPE_STDCALL, /* stdcall function (Win32) */
TYPE_CDECL, /* cdecl function (Win32) */
TYPE_VARARGS, /* varargs function (Win32) */
+ TYPE_THISCALL, /* thiscall function (Win32 on i386) */
TYPE_EXTERN, /* external symbol (Win32) */
TYPE_NBTYPES
} ORD_TYPE;
"stdcall", /* TYPE_STDCALL */
"cdecl", /* TYPE_CDECL */
"varargs", /* TYPE_VARARGS */
+ "thiscall", /* TYPE_THISCALL */
"extern" /* TYPE_EXTERN */
};
error( "'stdcall' not supported for Win16\n" );
return 0;
}
+ if (!is_win32 && odp->type == TYPE_THISCALL)
+ {
+ error( "'thiscall' not supported for Win16\n" );
+ return 0;
+ }
if (is_win32 && odp->type == TYPE_PASCAL)
{
error( "'pascal' not supported for Win32\n" );
odp->flags |= FLAG_FORWARD;
}
}
+ if (target_cpu == CPU_x86 && odp->type == TYPE_THISCALL && !(odp->flags & FLAG_FORWARD))
+ {
+ char *link_name = strmake( "__thiscall_%s", odp->link_name );
+ free( odp->link_name );
+ odp->link_name = link_name;
+ }
return 1;
}
case TYPE_STDCALL:
case TYPE_VARARGS:
case TYPE_CDECL:
+ case TYPE_THISCALL:
if (!parse_spec_export( odp, spec )) goto error;
break;
case TYPE_ABS:
case TYPE_STDCALL:
case TYPE_VARARGS:
case TYPE_CDECL:
+ case TYPE_THISCALL:
if (odp->flags & FLAG_FORWARD)
{
output( "\t%s .L__wine_spec_forwards+%u\n", get_asm_ptr_keyword(), fwd_size );
/* fall through */
case TYPE_VARARGS:
case TYPE_CDECL:
+ case TYPE_THISCALL:
/* try to reduce output */
if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))
output( "=%s", odp->link_name );
.B varargs
for a Win16 or Win32 function using the C calling convention with a
variable number of arguments
+.TP
+.B thiscall
+for a Win32 function using the
+.I thiscall
+calling convention (first parameter in %ecx register on i386)
.RE
.PP
.I args