diff --git a/objc/runtime.h b/objc/runtime.h index d415ee2..0e25c4b 100644 --- a/objc/runtime.h +++ b/objc/runtime.h @@ -231,7 +231,7 @@ objc_property_t* class_copyPropertyList(Class cls, unsigned int *outCount); * outCount argument is set to the number of protocols returned. The caller is * responsible for freeing the returned buffer. */ -Protocol *const* class_copyProtocolList(Class cls, unsigned int *outCount); +Protocol *__unsafe_unretained* class_copyProtocolList(Class cls, unsigned int *outCount); /** * Creates an instance of this class, allocating memory using malloc. @@ -613,7 +613,7 @@ objc_property_t *protocol_copyPropertyList(Protocol *p, unsigned int *count); * number of protocols in the array being returned via the last argument. The * caller is responsible for freeing this array. */ -Protocol *const*protocol_copyProtocolList(Protocol *p, unsigned int *count); +Protocol *__unsafe_unretained*protocol_copyProtocolList(Protocol *p, unsigned int *count); /** * Returns all of the protocols that the runtime is aware of. Note that @@ -623,7 +623,7 @@ Protocol *const*protocol_copyProtocolList(Protocol *p, unsigned int *count); * * The caller is responsible for freeing the returned array. */ -Protocol *const*objc_copyProtocolList(unsigned int *outCount); +Protocol *__unsafe_unretained*objc_copyProtocolList(unsigned int *outCount); /** * Returns the method description for the specified method within a given * protocol. diff --git a/protocol.c b/protocol.c index d2791c5..28835ad 100644 --- a/protocol.c +++ b/protocol.c @@ -329,7 +329,7 @@ struct objc_method_description *protocol_copyMethodDescriptionList(Protocol *p, return out; } -Protocol*const* protocol_copyProtocolList(Protocol *p, unsigned int *count) +Protocol*__unsafe_unretained* protocol_copyProtocolList(Protocol *p, unsigned int *count) { if (NULL == p) { return NULL; } *count = 0; @@ -474,7 +474,7 @@ BOOL protocol_isEqual(Protocol *p, Protocol *other) return NO; } -Protocol*const* objc_copyProtocolList(unsigned int *outCount) +Protocol*__unsafe_unretained* objc_copyProtocolList(unsigned int *outCount) { unsigned int total = known_protocol_table->table_used; Protocol **p = calloc(sizeof(Protocol*), known_protocol_table->table_used); diff --git a/runtime.c b/runtime.c index f2ffcb2..290e3fb 100644 --- a/runtime.c +++ b/runtime.c @@ -235,7 +235,7 @@ Method * class_copyMethodList(Class cls, unsigned int *outCount) return list; } -Protocol*const* class_copyProtocolList(Class cls, unsigned int *outCount) +Protocol*__unsafe_unretained* class_copyProtocolList(Class cls, unsigned int *outCount) { CHECK_ARG(cls); struct objc_protocol_list *protocolList = NULL;