mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
... and check superclasses when checking protocol conformance.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30589 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
521538ed20
commit
e7f3e84b89
1 changed files with 15 additions and 11 deletions
|
@ -1066,22 +1066,26 @@ BOOL class_conformsToProtocol(Class cls, Protocol *protocol)
|
|||
{
|
||||
struct objc_protocol_list *protocols;
|
||||
|
||||
for (protocols = cls->protocols;
|
||||
protocols != NULL ; protocols = protocols->next)
|
||||
while (cls)
|
||||
{
|
||||
int i;
|
||||
for (i=0 ; i<protocols->count ; i++)
|
||||
for (protocols = cls->protocols;
|
||||
protocols != NULL ; protocols = protocols->next)
|
||||
{
|
||||
Protocol *p1 = (Protocol*)protocols->list[i];
|
||||
if (strcmp(p1->protocol_name, protocol->protocol_name) == 0)
|
||||
int i;
|
||||
for (i=0 ; i<protocols->count ; i++)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
if (protocol_conformsToProtocol(p1, protocol))
|
||||
{
|
||||
return YES;
|
||||
Protocol *p1 = (Protocol*)protocols->list[i];
|
||||
if (strcmp(p1->protocol_name, protocol->protocol_name) == 0)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
if (protocol_conformsToProtocol(p1, protocol))
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
cls = cls ->super_class;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue