diff options
author | kan <kan@FreeBSD.org> | 2003-07-11 03:42:15 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-07-11 03:42:15 +0000 |
commit | bb754981e6f83bc1f224dc4b7f478d80024e6c9f (patch) | |
tree | b912048c8df69db39da9eded7043642b2854fa0d /contrib/libobjc/objc | |
parent | c7bbbdd036d3dd7ae253fb13c9994215af06f073 (diff) | |
download | FreeBSD-src-bb754981e6f83bc1f224dc4b7f478d80024e6c9f.zip FreeBSD-src-bb754981e6f83bc1f224dc4b7f478d80024e6c9f.tar.gz |
Gcc 3.3.1-pre 2003-07-11 Objective C support bits.
Diffstat (limited to 'contrib/libobjc/objc')
-rw-r--r-- | contrib/libobjc/objc/encoding.h | 34 | ||||
-rw-r--r-- | contrib/libobjc/objc/hash.h | 12 | ||||
-rw-r--r-- | contrib/libobjc/objc/objc.h | 9 | ||||
-rw-r--r-- | contrib/libobjc/objc/runtime.h | 5 | ||||
-rw-r--r-- | contrib/libobjc/objc/thr.h | 86 |
5 files changed, 77 insertions, 69 deletions
diff --git a/contrib/libobjc/objc/encoding.h b/contrib/libobjc/objc/encoding.h index b4def430..36a3d89 100644 --- a/contrib/libobjc/objc/encoding.h +++ b/contrib/libobjc/objc/encoding.h @@ -1,5 +1,5 @@ /* Encoding of types for Objective C. - Copyright (C) 1993, 1997 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. Author: Kresten Krab Thorup @@ -50,30 +50,30 @@ Boston, MA 02111-1307, USA. */ #define _F_ONEWAY 0x10 #define _F_GCINVISIBLE 0x20 -int objc_aligned_size (const char* type); -int objc_sizeof_type (const char* type); -int objc_alignof_type (const char* type); -int objc_aligned_size (const char* type); -int objc_promoted_size (const char* type); +int objc_aligned_size (const char *type); +int objc_sizeof_type (const char *type); +int objc_alignof_type (const char *type); +int objc_aligned_size (const char *type); +int objc_promoted_size (const char *type); -const char* objc_skip_type_qualifiers (const char* type); -const char* objc_skip_typespec (const char* type); -const char* objc_skip_offset (const char* type); -const char* objc_skip_argspec (const char* type); -int method_get_number_of_arguments (struct objc_method*); -int method_get_sizeof_arguments (struct objc_method*); +const char *objc_skip_type_qualifiers (const char *type); +const char *objc_skip_typespec (const char *type); +const char *objc_skip_offset (const char *type); +const char *objc_skip_argspec (const char *type); +int method_get_number_of_arguments (struct objc_method *); +int method_get_sizeof_arguments (struct objc_method *); -char* method_get_first_argument (struct objc_method*, +char *method_get_first_argument (struct objc_method *, arglist_t argframe, - const char** type); -char* method_get_next_argument (arglist_t argframe, + const char **type); +char *method_get_next_argument (arglist_t argframe, const char **type); -char* method_get_nth_argument (struct objc_method* m, +char *method_get_nth_argument (struct objc_method *m, arglist_t argframe, int arg, const char **type); -unsigned objc_get_type_qualifiers (const char* type); +unsigned objc_get_type_qualifiers (const char *type); struct objc_struct_layout diff --git a/contrib/libobjc/objc/hash.h b/contrib/libobjc/objc/hash.h index fc3cc9e..e695012a 100644 --- a/contrib/libobjc/objc/hash.h +++ b/contrib/libobjc/objc/hash.h @@ -60,7 +60,7 @@ typedef struct cache_node * typedef. Therefore, to remove compiler warnings the functions passed to * hash_new will have to be casted to this type. */ -typedef unsigned int (*hash_func_type)(void *, const void *); +typedef unsigned int (*hash_func_type) (void *, const void *); /* * This data type is the function that compares two hash keys and returns an @@ -69,7 +69,7 @@ typedef unsigned int (*hash_func_type)(void *, const void *); * second. */ -typedef int (*compare_func_type)(const void *, const void *); +typedef int (*compare_func_type) (const void *, const void *); /* @@ -174,8 +174,8 @@ hash_string (cache_ptr cache, const void *key) unsigned int ctr = 0; - while (*(char*)key) { - ret ^= *(char*)key++ << ctr; + while (*(char *) key) { + ret ^= *(char *) key++ << ctr; ctr = (ctr + 1) % sizeof (void *); } @@ -187,7 +187,7 @@ hash_string (cache_ptr cache, const void *key) static inline int compare_ptrs (const void *k1, const void *k2) { - return !(k1 - k2); + return ! (k1 - k2); } @@ -200,7 +200,7 @@ compare_strings (const void *k1, const void *k2) else if (k1 == 0 || k2 == 0) return 0; else - return !strcmp (k1, k2); + return ! strcmp (k1, k2); } diff --git a/contrib/libobjc/objc/objc.h b/contrib/libobjc/objc/objc.h index 79b2519..699542c 100644 --- a/contrib/libobjc/objc/objc.h +++ b/contrib/libobjc/objc/objc.h @@ -73,7 +73,14 @@ typedef struct objc_object { /* ** Definition of method type. When retrieving the implementation of a -** method, this is type of the pointer returned +** method, this is type of the pointer returned. The idea of the +** definition of IMP is to represent a 'pointer to a general function +** taking an id, a SEL, followed by other unspecified arguments'. You +** must always cast an IMP to a pointer to a function taking the +** appropriate, specific types for that function, before calling it - +** to make sure the appropriate arguments are passed to it. The code +** generated by the compiler to perform method calls automatically +** does this cast inside method calls. */ typedef id (*IMP)(id, SEL, ...); diff --git a/contrib/libobjc/objc/runtime.h b/contrib/libobjc/objc/runtime.h index b0eae4a..bea9253 100644 --- a/contrib/libobjc/objc/runtime.h +++ b/contrib/libobjc/objc/runtime.h @@ -1,5 +1,5 @@ /* GNU Objective C Runtime internal declarations - Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. Contributed by Kresten Krab Thorup This file is part of GNU CC. @@ -65,7 +65,7 @@ extern Method_t search_for_method_in_list(MethodList_t list, SEL op); extern BOOL __objc_class_links_resolved; /* Number of selectors stored in each of the selector tables */ -extern int __objc_selector_max_index; +extern unsigned int __objc_selector_max_index; /* Mutex locking __objc_selector_max_index and its arrays. */ extern objc_mutex_t __objc_runtime_mutex; @@ -82,6 +82,7 @@ extern int __objc_runtime_threads_alive; BOOL __objc_responds_to (id object, SEL sel); /* for internal use only! */ SEL __sel_register_typed_name (const char*, const char*, struct objc_selector*, BOOL is_const); +extern void __objc_generate_gc_type_description (Class); #endif /* not __objc_runtime_INCLUDE_GNU */ diff --git a/contrib/libobjc/objc/thr.h b/contrib/libobjc/objc/thr.h index 59766f6..48ad0be 100644 --- a/contrib/libobjc/objc/thr.h +++ b/contrib/libobjc/objc/thr.h @@ -1,5 +1,5 @@ /* Thread and mutex controls for Objective C. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) This file is part of GNU CC. @@ -74,30 +74,30 @@ struct objc_condition typedef struct objc_condition *objc_condition_t; /* Frontend mutex functions */ -objc_mutex_t objc_mutex_allocate(void); -int objc_mutex_deallocate(objc_mutex_t mutex); -int objc_mutex_lock(objc_mutex_t mutex); -int objc_mutex_unlock(objc_mutex_t mutex); -int objc_mutex_trylock(objc_mutex_t mutex); +objc_mutex_t objc_mutex_allocate (void); +int objc_mutex_deallocate (objc_mutex_t mutex); +int objc_mutex_lock (objc_mutex_t mutex); +int objc_mutex_unlock (objc_mutex_t mutex); +int objc_mutex_trylock (objc_mutex_t mutex); /* Frontend condition mutex functions */ -objc_condition_t objc_condition_allocate(void); -int objc_condition_deallocate(objc_condition_t condition); -int objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex); -int objc_condition_signal(objc_condition_t condition); -int objc_condition_broadcast(objc_condition_t condition); +objc_condition_t objc_condition_allocate (void); +int objc_condition_deallocate (objc_condition_t condition); +int objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex); +int objc_condition_signal (objc_condition_t condition); +int objc_condition_broadcast (objc_condition_t condition); /* Frontend thread functions */ -objc_thread_t objc_thread_detach(SEL selector, id object, id argument); -void objc_thread_yield(void); -int objc_thread_exit(void); -int objc_thread_set_priority(int priority); -int objc_thread_get_priority(void); -void * objc_thread_get_data(void); -int objc_thread_set_data(void *value); -objc_thread_t objc_thread_id(void); -void objc_thread_add(void); -void objc_thread_remove(void); +objc_thread_t objc_thread_detach (SEL selector, id object, id argument); +void objc_thread_yield (void); +int objc_thread_exit (void); +int objc_thread_set_priority (int priority); +int objc_thread_get_priority (void); +void * objc_thread_get_data (void); +int objc_thread_set_data (void *value); +objc_thread_t objc_thread_id (void); +void objc_thread_add (void); +void objc_thread_remove (void); /* Use this to set the hook function that will be called when the @@ -111,35 +111,35 @@ void objc_thread_remove(void); it can be informed; for example, the GNUstep Base Library sets it so it can implement the NSBecomingMultiThreaded notification. */ -typedef void (*objc_thread_callback)(); -objc_thread_callback objc_set_thread_callback(objc_thread_callback func); +typedef void (*objc_thread_callback) (void); +objc_thread_callback objc_set_thread_callback (objc_thread_callback func); /* Backend initialization functions */ -int __objc_init_thread_system(void); -int __objc_fini_thread_system(void); +int __objc_init_thread_system (void); +int __objc_fini_thread_system (void); /* Backend mutex functions */ -int __objc_mutex_allocate(objc_mutex_t mutex); -int __objc_mutex_deallocate(objc_mutex_t mutex); -int __objc_mutex_lock(objc_mutex_t mutex); -int __objc_mutex_trylock(objc_mutex_t mutex); -int __objc_mutex_unlock(objc_mutex_t mutex); +int __objc_mutex_allocate (objc_mutex_t mutex); +int __objc_mutex_deallocate (objc_mutex_t mutex); +int __objc_mutex_lock (objc_mutex_t mutex); +int __objc_mutex_trylock (objc_mutex_t mutex); +int __objc_mutex_unlock (objc_mutex_t mutex); /* Backend condition mutex functions */ -int __objc_condition_allocate(objc_condition_t condition); -int __objc_condition_deallocate(objc_condition_t condition); -int __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex); -int __objc_condition_broadcast(objc_condition_t condition); -int __objc_condition_signal(objc_condition_t condition); +int __objc_condition_allocate (objc_condition_t condition); +int __objc_condition_deallocate (objc_condition_t condition); +int __objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex); +int __objc_condition_broadcast (objc_condition_t condition); +int __objc_condition_signal (objc_condition_t condition); /* Backend thread functions */ -objc_thread_t __objc_thread_detach(void (*func)(void *arg), void *arg); -int __objc_thread_set_priority(int priority); -int __objc_thread_get_priority(void); -void __objc_thread_yield(void); -int __objc_thread_exit(void); -objc_thread_t __objc_thread_id(void); -int __objc_thread_set_data(void *value); -void * __objc_thread_get_data(void); +objc_thread_t __objc_thread_detach (void (*func) (void *arg), void *arg); +int __objc_thread_set_priority (int priority); +int __objc_thread_get_priority (void); +void __objc_thread_yield (void); +int __objc_thread_exit (void); +objc_thread_t __objc_thread_id (void); +int __objc_thread_set_data (void *value); +void * __objc_thread_get_data (void); #endif /* not __thread_INCLUDE_GNU */ |