tobjcl3.pp 735 B

123456789101112131415161718192021222324252627282930313233343536
  1. { %target=darwin }
  2. { %cpu=powerpc64,x86_64,arm }
  3. { %NEEDLIBRARY }
  4. { %fail }
  5. {$mode objfpc}
  6. {$modeswitch objectivec1}
  7. const
  8. {$ifdef windows}
  9. libname='tobjcl1.dll';
  10. {$else}
  11. libname='tobjcl1';
  12. {$linklib tobjcl1}
  13. {$endif}
  14. type
  15. MyLibObjCClass = objcclass(NSObject)
  16. public
  17. fa: byte;
  18. fb: byte;
  19. { this field is declared as private in the real class,
  20. and the non-fragile ABI should be sure that this
  21. gives a linker error }
  22. fc: byte;
  23. function publicfun: byte; message 'publicfun';
  24. function protectedfun: byte; message 'protectedfun';
  25. function privatefun: byte; message 'privatefun';
  26. end; external;
  27. var
  28. a: MyLibObjCClass;
  29. begin
  30. a:=NSObject(MyLibObjCClass.alloc).init;
  31. a.fc:=55;
  32. end.