Prevent accidental mixing of GNU runtime headers with GNUstep runtime.h.

main
theraven 16 years ago
parent 108247eb5d
commit bd58a33b84

@ -3,9 +3,10 @@
// If __LEGACY_GNU_MODE__ is defined then we include the old GNU runtime header // If __LEGACY_GNU_MODE__ is defined then we include the old GNU runtime header
// instead of this one // instead of this one
#ifndef __OBJC_LEGACY_GNU_MODE__
#define __GNUSTEP_RUNTIME__ #define __GNUSTEP_RUNTIME__
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <sys/types.h> #include <sys/types.h>
@ -20,22 +21,26 @@
// Undo GNUstep substitutions // Undo GNUstep substitutions
#ifdef class_setVersion #ifdef class_setVersion
#undef class_setVersion # undef class_setVersion
#endif #endif
#ifdef class_getClassMethod #ifdef class_getClassMethod
#undef class_getClassMethod # undef class_getClassMethod
#endif #endif
#ifdef objc_getClass #ifdef objc_getClass
#undef objc_getClass # undef objc_getClass
#endif #endif
#ifdef objc_lookUpClass #ifdef objc_lookUpClass
#undef objc_lookUpClass # undef objc_lookUpClass
#endif #endif
typedef struct objc_ivar* Ivar; typedef struct objc_ivar* Ivar;
// Don't redefine these types if the old GNU header was included first. // Don't redefine these types if the old GNU header was included first.
#ifndef __objc_INCLUDE_GNU #ifndef __objc_INCLUDE_GNU
// Define the macro so that including the old GNU header does nothing.
# define __objc_INCLUDE_GNU
# define __objc_api_INCLUDE_GNU
typedef struct objc_selector *SEL; typedef struct objc_selector *SEL;
typedef struct objc_class *Class; typedef struct objc_class *Class;
@ -45,7 +50,8 @@ typedef struct objc_object
Class isa; Class isa;
} *id; } *id;
struct objc_super { struct objc_super
{
id receiver; id receiver;
# if !defined(__cplusplus) && !__OBJC2__ # if !defined(__cplusplus) && !__OBJC2__
Class class; Class class;
@ -95,28 +101,30 @@ struct objc_method_description
#ifndef YES #ifndef YES
#define YES ((BOOL)1) # define YES ((BOOL)1)
#endif #endif
#ifndef NO #ifndef NO
#define NO ((BOOL)0) # define NO ((BOOL)0)
#endif #endif
#ifdef __GNUC #ifdef __GNUC
#define _OBJC_NULL_PTR __null # define _OBJC_NULL_PTR __null
#elif defined(__cplusplus) #elif defined(__cplusplus)
#define _OBJC_NULL_PTR 0 # define _OBJC_NULL_PTR 0
#else #else
#define _OBJC_NULL_PTR ((void*)0) # define _OBJC_NULL_PTR ((void*)0)
#endif #endif
#ifndef nil #ifndef nil
#define nil ((id)_OBJC_NULL_PTR) # define nil ((id)_OBJC_NULL_PTR)
#endif #endif
#ifndef Nil #ifndef Nil
#define Nil ((Class)_OBJC_NULL_PTR) # define Nil ((Class)_OBJC_NULL_PTR)
#endif #endif
#include "slot.h"
BOOL class_addIvar(Class cls, BOOL class_addIvar(Class cls,
const char *name, const char *name,
size_t size, size_t size,
@ -302,11 +310,6 @@ const char *sel_getType_np(SEL aSel);
*/ */
unsigned sel_copyTypes(const char *selName, const char **types, unsigned count); unsigned sel_copyTypes(const char *selName, const char **types, unsigned count);
#else
#include "runtime-legacy.h"
#endif // __LEGACY_GNU_MODE__
#include "slot.h"
/** /**
* New ABI lookup function. Receiver may be modified during lookup or proxy * New ABI lookup function. Receiver may be modified during lookup or proxy
* forwarding and the sender may affect how lookup occurs. * forwarding and the sender may affect how lookup occurs.

Loading…
Cancel
Save