Made objc_getProtocol() return a protocol from the protocol table, rather than creating a new one.

main
theraven 16 years ago
parent 8310615a7c
commit a2dbc582de

@ -133,3 +133,10 @@ struct objc_protocol2 *__objc_unique_protocol(struct objc_protocol2 *aProto)
}
}
}
// Public functions:
Protocol *objc_getProtocol(const char *name)
{
return (Protocol*)protocol_for_name(name);
}

@ -391,7 +391,7 @@ IMP class_getMethodImplementation_stret(Class cls, SEL name)
const char * class_getName(Class cls)
{
return class_get_class_name(cls);
return cls->name;
}
Class class_getSuperclass(Class cls)
@ -826,14 +826,6 @@ 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