Restored objc_getProtocol() which seems to have been accidentally removed.

Fixed class_replaceMethod() to update the dispatch table.
main
qmathe 16 years ago
parent 4a9187b1cc
commit e92f753091

@ -425,6 +425,12 @@ IMP class_replaceMethod(Class cls, SEL name, IMP imp, const char *types)
}
IMP old = (IMP)method->method_imp;
method->method_imp = (objc_imp_gnu)imp;
if (CLS_ISRESOLV(cls))
{
__objc_update_dispatch_table_for_class(cls);
}
return old;
}
@ -820,6 +826,14 @@ static id objectNew(id cls)
return newIMP((id)cls, newSel);
}
Protocol *objc_getProtocol(const char *name)
{
// Protocols are not centrally registered in the GNU runtime.
Protocol *protocol = (Protocol*)(objectNew(objc_getClass("Protocol")));
protocol->protocol_name = (char*)name;
return protocol;
}
BOOL protocol_conformsToProtocol(Protocol *p, Protocol *other)
{
return NO;

Loading…
Cancel
Save