mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 09:39:25 +02:00

* the objc unit links against the Foundation instead of against the Cocoa framework, and inludes an interface to either the fragile or non-fragile obj-c run time depending on the target platform + support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now are now also supported for the objectivec1 modeswitch + support for private_extern symbol bindings, required for the above * mark objcclasses that are declared in the implementation section of a unit as "hidden" (not sure what the effect is, since the Objective-C runtime does not seem to do anything with this flag) * enabled all obj-c tests for the newly supported platforms git-svn-id: branches/objc@13763 -
40 lines
572 B
ObjectPascal
40 lines
572 B
ObjectPascal
{ %target=darwin }
|
|
{ %cpu=powerpc,powerpc64,i386,x86_64,arm }
|
|
|
|
program project1;
|
|
|
|
{$mode objfpc}{$H+}
|
|
{$modeswitch objectivec1}
|
|
type
|
|
|
|
MyObject = objcclass(NSObject)
|
|
|
|
function getsspara(l1,l2: longint): shortstring ; message 'getss:l1:';
|
|
|
|
end;
|
|
|
|
var
|
|
m: MyObject;
|
|
b: boolean;
|
|
|
|
function MyObject.getsspara(l1,l2: longint): shortstring;
|
|
begin
|
|
if (self<>m) then
|
|
halt(1);
|
|
if (self.self<>m) then
|
|
halt(2);
|
|
if _cmd<>objcselector('getss:l1:') then
|
|
halt(3);
|
|
result:='';
|
|
end;
|
|
|
|
|
|
begin
|
|
m := MyObject.alloc;
|
|
m:=m.init;
|
|
|
|
m.getsspara(1,2);
|
|
|
|
m.release;
|
|
end.
|