Hi folks,
this question was asked sometime ago in this forum: supports FPC the "thiscall" calling convention. And the answer is: no.
And normaly nobody needs this,
BUT: the ASIO interface from Steinberg uses no calling convention keyword, so therefore the standard calling convention will be used in C++, and this is "thiscall".
A workaround with a C++ DLL with stdcall incapsulating the thiscall will be possible, but not beautiful

So I tried to work out a solution. What I've solved already:
1) Lazarus knows the keyword "thiscall" and highlights, etc.
2) FPC can compile thiscall... but not correct at the moment
Since "thiscall" is just for the i386 on windows, I've only make changes on the i386 compiler.
I've added a tcpuparamanager procedure create_msvcthiscall_paraloc_info for the calling convention "thiscall".
Since parameter passing is the sames as stdcall, I used this as a base.
for thiscall, in ECX the "this" pointer must be loaded. So here I need to add an Register (ECX) to the parameters.
if (side=callerside) then
begin
paraloc:=hp.paraloc[side].add_location;
paraloc^.size:=OS_ADDR;
paraloc^.def:=methodpointertype;
paraloc^.loc:=LOC_REGISTER;
paraloc^.register:=newreg(R_INTREGISTER,parasupregs[parareg],cgsize2subreg(R_INTREGISTER,paracgsize));
inc(parareg);
end;
The compiler crashes now, with Fatal: Internal error 200501162 on Pushdata in line 145 of i386/cgcpu.pas.
Seems it tries to push the LOC_REGSITER parameter location on the stack,

So some help would be wonderful
