This commit is contained in:
peter 2002-11-17 21:46:17 +00:00
parent 91dfe9bec5
commit 697b015e3f
3 changed files with 27 additions and 17 deletions

View File

@ -15,14 +15,13 @@
{ verifies the usage of external cdecl }
{ modules compiled with C compilers. }
{****************************************************************}
program tcalext;
{$ifndef USE_PASCAL_OBJECT}
{$MODE OBJFPC}
{$STATIC ON}
{$R+}
uses strings;
{$ifndef USE_PASCAL_OBJECT}
{$L ctest.o}
{$endif USE_PASCAL_OBJECT}
{ Use C alignment of records }
@ -746,7 +745,10 @@ end.
{
$Log$
Revision 1.6 2002-11-04 15:17:45 pierre
Revision 1.7 2002-11-17 21:46:17 peter
* fixed
Revision 1.6 2002/11/04 15:17:45 pierre
* compatibility with C checks improved
Revision 1.5 2002/09/07 15:40:51 peter

View File

@ -16,9 +16,17 @@
{ functions declared with cdecl modifier are correct }
{****************************************************************}
{$define USE_PASCAL_OBJECT}
{$MODE OBJFPC}
{$STATIC ON}
{$R+}
{ Compile ptest.o }
uses
strings,
ptest
;
{$ifdef USE_PASCAL_OBJECT}
{$ifdef win32}

View File

@ -9,38 +9,38 @@ type
constructor create;
procedure mymethod; virtual;
end;
tobj2 = class
constructor create;
procedure mymethod; virtual;
end;
constructor tobj2.create;
begin
end;
procedure tobj2.mymethod;
begin
end;
constructor tobj1.create;
begin
end;
procedure tobj1.mymethod;
begin
end;
var
_cla1 : tobj1;
_cla2 : tobj2;
Begin
_cla1:=tobj1.create;
_cla2:=tobj2.create;
tobj1(_cla2).mymethod;
tobj1(pointer(_cla2)).mymethod;
end.