* fixed COM parameter passing

git-svn-id: trunk@3389 -
This commit is contained in:
florian 2006-04-30 19:09:27 +00:00
parent 9bd2ee5477
commit 2bb707a4ee
2 changed files with 19 additions and 6 deletions

View File

@ -100,11 +100,16 @@ implementation
if pd.deftype=procdef then if pd.deftype=procdef then
akttokenpos:=tprocdef(pd).fileinfo; akttokenpos:=tprocdef(pd).fileinfo;
if is_interfacecom(tprocdef(pd)._class) then
paranr:=paranr_result_com
else
begin
{ For left to right add it at the end to be delphi compatible } { For left to right add it at the end to be delphi compatible }
if pd.proccalloption in pushleftright_pocalls then if pd.proccalloption in pushleftright_pocalls then
paranr:=paranr_result_leftright paranr:=paranr_result_leftright
else else
paranr:=paranr_result; paranr:=paranr_result;
end;
{ Generate result variable accessing function result } { Generate result variable accessing function result }
vs:=tparavarsym.create('$result',paranr,vs_var,pd.rettype,[vo_is_funcret,vo_is_hidden_para]); vs:=tparavarsym.create('$result',paranr,vs_var,pd.rettype,[vo_is_funcret,vo_is_hidden_para]);
pd.parast.insert(vs); pd.parast.insert(vs);
@ -152,6 +157,9 @@ implementation
begin begin
{ Generate self variable } { Generate self variable }
tt:=voidpointertype; tt:=voidpointertype;
if is_interfacecom(tprocdef(pd)._class) then
vs:=tparavarsym.create('$self',paranr_self_com,vs_value,tt,[vo_is_self,vo_is_hidden_para])
else
vs:=tparavarsym.create('$self',paranr_self,vs_value,tt,[vo_is_self,vo_is_hidden_para]); vs:=tparavarsym.create('$self',paranr_self,vs_value,tt,[vo_is_self,vo_is_hidden_para]);
pd.parast.insert(vs); pd.parast.insert(vs);
end end
@ -190,6 +198,9 @@ implementation
vsp:=vs_var; vsp:=vs_var;
tt.setdef(tprocdef(pd)._class); tt.setdef(tprocdef(pd)._class);
end; end;
if is_interfacecom(tprocdef(pd)._class) then
vs:=tparavarsym.create('$self',paranr_self_com,vsp,tt,[vo_is_self,vo_is_hidden_para])
else
vs:=tparavarsym.create('$self',paranr_self,vsp,tt,[vo_is_self,vo_is_hidden_para]); vs:=tparavarsym.create('$self',paranr_self,vsp,tt,[vo_is_self,vo_is_hidden_para]);
pd.parast.insert(vs); pd.parast.insert(vs);

View File

@ -96,7 +96,9 @@ const
will be inserted with n+1 } will be inserted with n+1 }
paranr_parentfp = 1; paranr_parentfp = 1;
paranr_result = 2; paranr_result = 2;
paranr_result_com = 3;
paranr_self = 3; paranr_self = 3;
paranr_self_com = 2;
paranr_vmt = 4; paranr_vmt = 4;
{ Required to support variations of syscalls on MorphOS } { Required to support variations of syscalls on MorphOS }
paranr_syscall_basesysv = 9; paranr_syscall_basesysv = 9;