mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +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
b8e6a00b9c
commit
fc93f1d8af
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…
Reference in a new issue