mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Fixed conformsToProtocol: which was failing for protocols implemented
in categories git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11819 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8422f1755e
commit
22a1a902af
1 changed files with 14 additions and 7 deletions
|
@ -710,24 +710,31 @@ static BOOL deallocNotifications = NO;
|
|||
|
||||
+ (BOOL) conformsToProtocol: (Protocol*)aProtocol
|
||||
{
|
||||
int i;
|
||||
struct objc_protocol_list* proto_list;
|
||||
|
||||
for (proto_list = ((struct objc_class*)self)->class_pointer->protocols;
|
||||
for (proto_list = ((struct objc_class*)self)->protocols;
|
||||
proto_list; proto_list = proto_list->next)
|
||||
{
|
||||
for (i=0; i < proto_list->count; i++)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < proto_list->count; i++)
|
||||
{
|
||||
/* xxx We should add conformsToProtocol to Protocol class. */
|
||||
if ([proto_list->list[i] conformsTo: aProtocol])
|
||||
return YES;
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ([self superclass])
|
||||
return [[self superclass] conformsToProtocol: aProtocol];
|
||||
{
|
||||
return [[self superclass] conformsToProtocol: aProtocol];
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) conformsToProtocol: (Protocol*)aProtocol
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue