mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 17:50:16 +02:00
* fixed conformsToProtocol() declaration (the protocol is not a changeable
parameter, and it's already declared as a pointer type) git-svn-id: trunk@34246 -
This commit is contained in:
parent
74890fb256
commit
de97285393
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -15193,6 +15193,7 @@ tests/webtbs/tw30329.pp -text svneol=native#text/plain
|
|||||||
tests/webtbs/tw30357.pp svneol=native#text/pascal
|
tests/webtbs/tw30357.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3038.pp svneol=native#text/plain
|
tests/webtbs/tw3038.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3041.pp svneol=native#text/plain
|
tests/webtbs/tw3041.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw30443.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3045.pp svneol=native#text/plain
|
tests/webtbs/tw3045.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3048.pp svneol=native#text/plain
|
tests/webtbs/tw3048.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3063.pp svneol=native#text/plain
|
tests/webtbs/tw3063.pp svneol=native#text/plain
|
||||||
|
@ -166,7 +166,7 @@ type
|
|||||||
function class_respondsToSelector(cls:pobjc_class; sel:SEL):BOOL; cdecl; external libname;
|
function class_respondsToSelector(cls:pobjc_class; sel:SEL):BOOL; cdecl; external libname;
|
||||||
function class_copyMethodList(cls:pobjc_class; outCount:pdword):PMethod; cdecl; external libname;
|
function class_copyMethodList(cls:pobjc_class; outCount:pdword):PMethod; cdecl; external libname;
|
||||||
|
|
||||||
function class_conformsToProtocol(cls:pobjc_class; var protocol: pobjc_protocol):BOOL; cdecl; external libname;
|
function class_conformsToProtocol(cls:pobjc_class; protocol: pobjc_protocol):BOOL; cdecl; external libname;
|
||||||
function class_copyProtocolList(cls:pobjc_class; var outCount: dword):ppobjc_protocol; cdecl; external libname;
|
function class_copyProtocolList(cls:pobjc_class; var outCount: dword):ppobjc_protocol; cdecl; external libname;
|
||||||
|
|
||||||
function class_createInstance(cls:pobjc_class; extraBytes:size_t):id; cdecl; external libname;
|
function class_createInstance(cls:pobjc_class; extraBytes:size_t):id; cdecl; external libname;
|
||||||
|
30
tests/webtbs/tw30443.pp
Normal file
30
tests/webtbs/tw30443.pp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ %target=darwin }
|
||||||
|
{ %cpu=powerpc,powerpc64,i386,x86_64,arm,aarch64 }
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
{$modeswitch objectivec1}
|
||||||
|
|
||||||
|
uses
|
||||||
|
CocoaAll;
|
||||||
|
|
||||||
|
procedure CheckProtocol;
|
||||||
|
const
|
||||||
|
NSObjectProtocolName: UTF8String = 'NSObject';
|
||||||
|
var
|
||||||
|
nso: id;
|
||||||
|
proto: pobjc_protocol;
|
||||||
|
cls: pobjc_class;
|
||||||
|
begin
|
||||||
|
nso := NSObject.alloc.init;
|
||||||
|
cls := object_getClass(nso);
|
||||||
|
proto := objc_getProtocol(PAnsiChar(NSObjectProtocolName));
|
||||||
|
if class_conformsToProtocol(cls, proto) then
|
||||||
|
WriteLn('NSObject implements the NSObject protocol, as expected.')
|
||||||
|
else
|
||||||
|
halt(1);
|
||||||
|
nso.release;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
CheckProtocol;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user