diff options
author | obrien <obrien@FreeBSD.org> | 2002-05-09 22:50:04 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-05-09 22:50:04 +0000 |
commit | 9202658d3cd1b82b9c9b96c52fde1774d313ab2c (patch) | |
tree | ba6f9907191b31996edc00ff6dae7cf7978d19e9 /contrib/libobjc/objc/objc-api.h | |
parent | eb81e01d5162436a00b210305c91bbba234a0238 (diff) | |
download | FreeBSD-src-9202658d3cd1b82b9c9b96c52fde1774d313ab2c.zip FreeBSD-src-9202658d3cd1b82b9c9b96c52fde1774d313ab2c.tar.gz |
Gcc 3.1.0 pre-release's Objective C support bits from the FSF anoncvs repo
on 9-May-2002 15:57:15 EDT.
Diffstat (limited to 'contrib/libobjc/objc/objc-api.h')
-rw-r--r-- | contrib/libobjc/objc/objc-api.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/contrib/libobjc/objc/objc-api.h b/contrib/libobjc/objc/objc-api.h index fe34daf..9268020 100644 --- a/contrib/libobjc/objc/objc-api.h +++ b/contrib/libobjc/objc/objc-api.h @@ -1,5 +1,5 @@ /* GNU Objective-C Runtime API. - Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -75,6 +75,7 @@ struct objc_method_description #define _C_UNION_E ')' #define _C_STRUCT_B '{' #define _C_STRUCT_E '}' +#define _C_VECTOR '!' /* @@ -260,7 +261,7 @@ typedef struct objc_method_list { struct objc_protocol_list { struct objc_protocol_list *next; - int count; + size_t count; Protocol *list[1]; }; @@ -414,6 +415,13 @@ extern void *(*_objc_realloc)(void *, size_t); extern void *(*_objc_calloc)(size_t, size_t); extern void (*_objc_free)(void *); +/* +** Hook for method forwarding. This makes it easy to substitute a +** library, such as ffcall, that implements closures, thereby avoiding +** gcc's __builtin_apply problems. +*/ +extern IMP (*__objc_msg_forward)(SEL); + Method_t class_get_class_method(MetaClass class, SEL aSel); Method_t class_get_instance_method(Class class, SEL aSel); @@ -571,21 +579,23 @@ object_get_super_class } static inline BOOL -object_is_class(id object) +object_is_class (id object) { - return CLS_ISCLASS((Class)object); + return ((object != nil) && CLS_ISMETA (object->class_pointer)); } - + static inline BOOL -object_is_instance(id object) +object_is_instance (id object) { - return (object!=nil)&&CLS_ISCLASS(object->class_pointer); + return ((object != nil) && CLS_ISCLASS (object->class_pointer)); } static inline BOOL -object_is_meta_class(id object) +object_is_meta_class (id object) { - return CLS_ISMETA((Class)object); + return ((object != nil) + && !object_is_instance (object) + && !object_is_class (object)); } struct sarray* |