From: Nicola Pero Date: Tue, 14 Dec 2010 21:57:31 +0000 (+0000) Subject: objects.c (object_copy): Do not #undef as we are no longer including objc/objc-api.h. X-Git-Tag: releases/gcc-4.6.0~1904 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ecfa8de88025917ab3442db65caf62abd46d538;p=thirdparty%2Fgcc.git objects.c (object_copy): Do not #undef as we are no longer including objc/objc-api.h. 2010-12-14 Nicola Pero * objects.c (object_copy): Do not #undef as we are no longer including objc/objc-api.h. * selector.c: Include objc/runtime.h and objc-private/module-abi-8.h. Do not include objc/objc-api.h and objc/encoding.h. Updated (__objc_register_selectors_from_class): Use struct objc_method_list * instead of MethodList_t. (__objc_register_selectors_from_list): Use Method instead of Method_t. (struct objc_method_description_list): Do not define here. (__objc_register_instance_methods_to_class): Use struct objc_method_list * instead of MethodList_t and Method instead of Method_t. From-SVN: r167818 --- diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 99f8e2392893..bbf4696211aa 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,19 @@ +2010-12-14 Nicola Pero + + * objects.c (object_copy): Do not #undef as we are no longer + including objc/objc-api.h. + * selector.c: Include objc/runtime.h and + objc-private/module-abi-8.h. Do not include objc/objc-api.h and + objc/encoding.h. Updated + (__objc_register_selectors_from_class): Use struct + objc_method_list * instead of MethodList_t. + (__objc_register_selectors_from_list): Use Method instead of + Method_t. + (struct objc_method_description_list): Do not define here. + (__objc_register_instance_methods_to_class): Use struct + objc_method_list * instead of MethodList_t and Method instead of + Method_t. + 2010-12-14 Nicola Pero * selector.c: Reindented some code and tidied up comments. No diff --git a/libobjc/objects.c b/libobjc/objects.c index 71b09afee569..ca12dc6d2ae3 100644 --- a/libobjc/objects.c +++ b/libobjc/objects.c @@ -72,9 +72,6 @@ class_create_instance (Class class) return class_createInstance (class, 0); } -/* Temporary, while we are including objc-api.h instead of runtime.h. */ -#undef object_copy - id object_copy (id object, size_t extraBytes) { diff --git a/libobjc/selector.c b/libobjc/selector.c index 582dc550d6e8..0e51e31b132e 100644 --- a/libobjc/selector.c +++ b/libobjc/selector.c @@ -23,13 +23,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #include "objc-private/common.h" -#include "objc/objc-api.h" +#include "objc/runtime.h" #include "objc/thr.h" #include "objc-private/hash.h" -#include "objc-private/objc-list.h" +#include "objc-private/objc-list.h" +#include "objc-private/module-abi-8.h" #include "objc-private/runtime.h" #include "objc-private/sarray.h" -#include "objc/encoding.h" /* Initial selector hash table size. Value doesn't matter much. */ #define SELECTOR_HASH_SIZE 128 @@ -57,7 +57,7 @@ void __objc_init_selector_tables (void) void __objc_register_selectors_from_class (Class class) { - MethodList_t method_list; + struct objc_method_list * method_list; method_list = class->methods; while (method_list) @@ -75,14 +75,14 @@ __objc_register_selectors_from_class (Class class) The name and type pointers in the method list must be permanent and immutable. */ void -__objc_register_selectors_from_list (MethodList_t method_list) +__objc_register_selectors_from_list (struct objc_method_list *method_list) { int i = 0; objc_mutex_lock (__objc_runtime_mutex); while (i < method_list->method_count) { - Method_t method = &method_list->method_list[i]; + Method method = &method_list->method_list[i]; if (method->method_name) { method->method_name @@ -94,15 +94,6 @@ __objc_register_selectors_from_list (MethodList_t method_list) objc_mutex_unlock (__objc_runtime_mutex); } -/* Temporary definition while we include objc/objc-api.h instead of - objc-private/module-abi-8.h. It should go away once we include - module-abi-8.h. */ -struct objc_method_description_list -{ - int count; - struct objc_method_description list[1]; -}; - /* The same as __objc_register_selectors_from_list, but works on a struct objc_method_description_list* instead of a struct objc_method_list*. This is only used for protocols, which have @@ -131,11 +122,11 @@ __objc_register_selectors_from_description_list /* Register instance methods as class methods for root classes. */ void __objc_register_instance_methods_to_class (Class class) { - MethodList_t method_list; - MethodList_t class_method_list; + struct objc_method_list *method_list; + struct objc_method_list *class_method_list; int max_methods_no = 16; - MethodList_t new_list; - Method_t curr_method; + struct objc_method_list *new_list; + Method curr_method; /* Only if a root class. */ if (class->super_class) @@ -156,7 +147,7 @@ void __objc_register_instance_methods_to_class (Class class) /* Iterate through the methods from this method list. */ for (i = 0; i < method_list->method_count; i++) { - Method_t mth = &method_list->method_list[i]; + Method mth = &method_list->method_list[i]; if (mth->method_name && ! search_for_method_in_list (class_method_list, mth->method_name))