mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Quick runtime fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17099 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a9a9958dfd
commit
2f6c120a86
2 changed files with 67 additions and 0 deletions
|
@ -687,6 +687,72 @@ static IMP autorelease_imp;
|
|||
static BOOL double_release_check_enabled = NO;
|
||||
|
||||
|
||||
|
||||
@implementation Protocol (Fixup)
|
||||
struct objc_method_description_list {
|
||||
int count;
|
||||
struct objc_method_description list[1];
|
||||
};
|
||||
|
||||
- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel
|
||||
{
|
||||
int i;
|
||||
struct objc_protocol_list* proto_list;
|
||||
const char* name = sel_get_name (aSel);
|
||||
struct objc_method_description *result;
|
||||
|
||||
if (instance_methods != 0)
|
||||
{
|
||||
for (i = 0; i < instance_methods->count; i++)
|
||||
{
|
||||
if (!strcmp ((char*)instance_methods->list[i].name, name))
|
||||
return &(instance_methods->list[i]);
|
||||
}
|
||||
}
|
||||
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
|
||||
{
|
||||
size_t j;
|
||||
for (j=0; j < proto_list->count; j++)
|
||||
{
|
||||
if ((result = [proto_list->list[j]
|
||||
descriptionForInstanceMethod: aSel]))
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
|
||||
{
|
||||
int i;
|
||||
struct objc_protocol_list* proto_list;
|
||||
const char* name = sel_get_name (aSel);
|
||||
struct objc_method_description *result;
|
||||
|
||||
if (class_methods != 0)
|
||||
{
|
||||
for (i = 0; i < class_methods->count; i++)
|
||||
{
|
||||
if (!strcmp ((char*)class_methods->list[i].name, name))
|
||||
return &(class_methods->list[i]);
|
||||
}
|
||||
}
|
||||
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
|
||||
{
|
||||
size_t j;
|
||||
for (j=0; j < proto_list->count; j++)
|
||||
{
|
||||
if ((result = [proto_list->list[j]
|
||||
descriptionForClassMethod: aSel]))
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue