mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-27 03:51:40 +01:00
* handle interface methods with cdecl modifier correctly, second and final part to resolve #10684
git-svn-id: trunk@12828 -
This commit is contained in:
parent
cc622779c9
commit
67d1604c49
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8623,6 +8623,7 @@ tests/webtbs/tw1066a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1066b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1068.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10681.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10684.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1071.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10727.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1073.pp svneol=native#text/plain
|
||||
|
||||
@ -657,6 +657,7 @@ unit cgcpu;
|
||||
end;
|
||||
{ restore param1 value self to interface }
|
||||
g_adjust_self_value(list,procdef,-ioffset);
|
||||
list.concat(taicpu.op_none(A_RET,S_L));
|
||||
end
|
||||
else if po_virtualmethod in procdef.procoptions then
|
||||
begin
|
||||
|
||||
48
tests/webtbs/tw10684.pp
Normal file
48
tests/webtbs/tw10684.pp
Normal file
@ -0,0 +1,48 @@
|
||||
program test_intf_query;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$MODE OBJFPC}{$H+}
|
||||
{$ENDIF}
|
||||
|
||||
uses
|
||||
Classes;
|
||||
|
||||
type
|
||||
ISimple = interface
|
||||
['{24811FF3-4F01-4601-AC5C-22A5B5D46928}']
|
||||
function ShowSomething: Integer; cdecl;
|
||||
function GetIsBlob: Boolean; cdecl;
|
||||
end;
|
||||
|
||||
TSimple = class(TInterfacedObject, ISimple)
|
||||
protected
|
||||
{ ISimple implementation }
|
||||
function ShowSomething: Integer; cdecl;
|
||||
function GetIsBlob: Boolean; cdecl;
|
||||
end;
|
||||
|
||||
function QuerySimple(const OnChange: TNotifyEvent = nil): ISimple; cdecl;
|
||||
begin
|
||||
Result := TSimple.Create;
|
||||
end;
|
||||
|
||||
function TSimple.ShowSomething: Integer; cdecl;
|
||||
begin
|
||||
Writeln('Message from ISimple');
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TSimple.GetIsBlob: Boolean; cdecl;
|
||||
begin
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
{*** main program ***}
|
||||
|
||||
var
|
||||
FSimple: ISimple;
|
||||
|
||||
begin
|
||||
FSimple := QuerySimple;
|
||||
FSimple.ShowSomething;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user