diff options
Diffstat (limited to 'gcc/objc/objc.h')
-rw-r--r-- | gcc/objc/objc.h | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/gcc/objc/objc.h b/gcc/objc/objc.h index c06a0135962..d5eace390cb 100644 --- a/gcc/objc/objc.h +++ b/gcc/objc/objc.h @@ -53,29 +53,12 @@ extern const char* __objc_sparse_lookup_id; extern const char* __objc_hash_lookup_id; #endif +#ifndef __object_INCLUDE_GNU -#include <stdio.h> -#ifdef IN_GCC -#include <gstdarg.h> -#else -#include <stdarg.h> -#endif - -#define nil (id)0 /* id of Nil instance */ -#define Nil (Class_t)0 /* id of Nil class */ -typedef char *STR; /* String alias */ - - /* Boolean typedefs */ typedef char BOOL; #define YES (BOOL)1 #define NO (BOOL)0 - -/* For functions which return Method_t */ -#define METHOD_NULL (Method_t)0 - - - /* ** Definition of a selector. Selectors are really of type unsigned int. ** The runtime does this mapping from SEL's to names internally in the @@ -94,6 +77,30 @@ typedef struct objc_object { typedef id (*IMP)(id, SEL, ...); /* +** The compiler generates one of these structures for each class. +** +** This structure is the definition for meta classes. By definition a meta +** class is the class's class. Its most relevant contribution is that its +** method list contain the class's factory methods. +** +** This structure is generated by the compiler in the executable and used by +** the run-time during normal messaging operations. Therefore some members +** change type. The compiler generates "char* const" and places a string in +** the following member variables: class_pointer and super_class. +*/ +typedef struct objc_class MetaClass; +typedef struct objc_class Class; + +#define nil (id)0 /* id of Nil instance */ +#define Nil (Class*)0 /* id of Nil class */ +typedef char *STR; /* String alias */ + +#endif /* __object_INCLUDE_GNU */ + +/* For functions which return Method_t */ +#define METHOD_NULL (Method_t)0 + /* Boolean typedefs */ +/* ** Method descriptor returned by introspective Object methods. ** This is really just the first part of the more complete objc_method ** structure defined below and used internally by the runtime. @@ -159,7 +166,7 @@ typedef struct objc_symtab { compiled (defined) in the module. */ void *defs[1]; /* Variable array of pointers. - cls_def_cnt of type Class_t + cls_def_cnt of type Class* followed by cat_def_cnt of type Category_t. */ } Symtab, *Symtab_t; @@ -272,20 +279,6 @@ struct objc_cache { /* ** The compiler generates one of these structures for each class. -** -** This structure is the definition for meta classes. By definition a meta -** class is the class's class. Its most relevant contribution is that its -** method list contain the class's factory methods. -** -** This structure is generated by the compiler in the executable and used by -** the run-time during normal messaging operations. Therefore some members -** change type. The compiler generates "char* const" and places a string in -** the following member variables: class_pointer and super_class. -*/ -typedef struct objc_class *MetaClass_t; - -/* -** The compiler generates one of these structures for each class. ** ** This structure is the definition for classes. ** @@ -295,7 +288,7 @@ typedef struct objc_class *MetaClass_t; ** the following member variables: super_class. */ struct objc_class { - MetaClass_t class_pointer; /* Pointer to the class's + MetaClass* class_pointer; /* Pointer to the class's meta class. */ struct objc_class* super_class; /* Pointer to the super class. NULL for class @@ -331,10 +324,8 @@ struct objc_class { struct objc_protocol_list *protocols; /* Protocols conformed to */ }; -#define Class struct objc_class -#define Class_t Class* -typedef struct objc_class MetaClass; +#ifndef __object_INCLUDE_GNU /* Protocol support */ #ifndef __OBJC__ @@ -349,13 +340,14 @@ typedef struct objc_protocol { @class Protocol; #endif +#endif + struct objc_protocol_list { struct objc_protocol_list *next; int count; Protocol *list[1]; }; - /* ** This is used to assure consistent access to the info field of ** classes @@ -368,12 +360,12 @@ struct objc_protocol_list { #define __CLS_ISINFO(cls, mask) ((__CLS_INFO(cls)&mask)==mask) #define __CLS_SETINFO(cls, mask) (__CLS_INFO(cls) |= mask) -/* The structure is of type MetaClass_t */ +/* The structure is of type MetaClass* */ #define _CLS_META 0x2L #define CLS_ISMETA(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_META)) -/* The structure is of type Class_t */ +/* The structure is of type Class* */ #define _CLS_CLASS 0x1L #define CLS_ISCLASS(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_CLASS)) @@ -428,7 +420,9 @@ typedef struct objc_category { ** Well... */ +#ifndef __object_INCLUDE_GNU typedef struct objc_typed_stream TypedStream; +#endif /* ** Structure used when a message is send to a class's super class. The @@ -438,7 +432,7 @@ typedef struct objc_typed_stream TypedStream; typedef struct objc_super { id self; /* Id of the object sending the message. */ - Class_t class; /* Object's super class. */ + Class* class; /* Object's super class. */ } Super, *Super_t; IMP objc_msg_lookup_super(Super_t super, SEL sel); @@ -446,7 +440,9 @@ IMP objc_msg_lookup_super(Super_t super, SEL sel); typedef void* retval_t; /* return value */ typedef void(*apply_t)(void); /* function pointer */ -#if defined(REG_ARGS) || defined(STACK_ARGS) +#ifndef __object_INCLUDE_GNU + +#if defined(REG_ARGS) || defined(STACK_ARGS) typedef struct { char* arg_pointer; @@ -471,6 +467,7 @@ typedef struct { typedef void* arglist_t; #endif +#endif /* not __object_INCLUDE_GNU */ retval_t objc_msg_sendv(id, SEL, size_t, arglist_t); |