diff --git a/protocol.c b/protocol.c index 7e8003a..0324f40 100644 --- a/protocol.c +++ b/protocol.c @@ -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); +} diff --git a/runtime.c b/runtime.c index 0fa10d8..ec9b214 100644 --- a/runtime.c +++ b/runtime.c @@ -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;