123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- #ifndef _OBJC_OBJC_H_
- #define _OBJC_OBJC_H_
- #include <sys/types.h>
- #include <Availability.h>
- #include <objc/objc-api.h>
- #include <stdbool.h>
- #if !OBJC_TYPES_DEFINED
- typedef struct objc_class *Class;
- struct objc_object {
- Class _Nonnull isa OBJC_ISA_AVAILABILITY;
- };
- typedef struct objc_object *id;
- #endif
- typedef struct objc_selector *SEL;
- #if !OBJC_OLD_DISPATCH_PROTOTYPES
- typedef void (*IMP)(void );
- #else
- typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...);
- #endif
- #if defined(__OBJC_BOOL_IS_BOOL)
-
- # if __OBJC_BOOL_IS_BOOL
- # define OBJC_BOOL_IS_BOOL 1
- # else
- # define OBJC_BOOL_IS_BOOL 0
- # endif
- #else
-
- # if TARGET_OS_OSX || TARGET_OS_IOSMAC || (TARGET_OS_IOS && !__LP64__ && !__ARM_ARCH_7K)
- # define OBJC_BOOL_IS_BOOL 0
- # else
- # define OBJC_BOOL_IS_BOOL 1
- # endif
- #endif
- #if OBJC_BOOL_IS_BOOL
- typedef bool BOOL;
- #else
- # define OBJC_BOOL_IS_CHAR 1
- typedef signed char BOOL;
-
-
- #endif
- #define OBJC_BOOL_DEFINED
- #if __has_feature(objc_bool)
- #define YES __objc_yes
- #define NO __objc_no
- #else
- #define YES ((BOOL)1)
- #define NO ((BOOL)0)
- #endif
- #ifndef Nil
- # if __has_feature(cxx_nullptr)
- # define Nil nullptr
- # else
- # define Nil __DARWIN_NULL
- # endif
- #endif
- #ifndef nil
- # if __has_feature(cxx_nullptr)
- # define nil nullptr
- # else
- # define nil __DARWIN_NULL
- # endif
- #endif
- #ifndef __strong
- # if !__has_feature(objc_arc)
- # define __strong
- # endif
- #endif
- #ifndef __unsafe_unretained
- # if !__has_feature(objc_arc)
- # define __unsafe_unretained
- # endif
- #endif
- #ifndef __autoreleasing
- # if !__has_feature(objc_arc)
- # define __autoreleasing
- # endif
- #endif
- OBJC_EXPORT const char * _Nonnull sel_getName(SEL _Nonnull sel)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT SEL _Nonnull sel_registerName(const char * _Nonnull str)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT const char * _Nonnull object_getClassName(id _Nullable obj)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void * _Nullable object_getIndexedIvars(id _Nullable obj)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0)
- OBJC_ARC_UNAVAILABLE;
- OBJC_EXPORT BOOL sel_isMapped(SEL _Nonnull sel)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT SEL _Nonnull sel_getUid(const char * _Nonnull str)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- typedef const void* objc_objectptr_t;
- OBJC_EXPORT id _Nullable objc_retainedObject(objc_objectptr_t _Nullable obj)
- #if !OBJC_DECLARE_SYMBOLS
- OBJC_UNAVAILABLE("use CFBridgingRelease() or a (__bridge_transfer id) cast instead")
- #endif
- ;
- OBJC_EXPORT id _Nullable objc_unretainedObject(objc_objectptr_t _Nullable obj)
- #if !OBJC_DECLARE_SYMBOLS
- OBJC_UNAVAILABLE("use a (__bridge id) cast instead")
- #endif
- ;
- OBJC_EXPORT objc_objectptr_t _Nullable objc_unretainedPointer(id _Nullable obj)
- #if !OBJC_DECLARE_SYMBOLS
- OBJC_UNAVAILABLE("use a __bridge cast instead")
- #endif
- ;
- #if !__OBJC2__
- #if defined(__LP64__)
- typedef long arith_t;
- typedef unsigned long uarith_t;
- # define ARITH_SHIFT 32
- #else
- typedef int arith_t;
- typedef unsigned uarith_t;
- # define ARITH_SHIFT 16
- #endif
- typedef char *STR;
- #define ISSELECTOR(sel) sel_isMapped(sel)
- #define SELNAME(sel) sel_getName(sel)
- #define SELUID(str) sel_getUid(str)
- #define NAMEOF(obj) object_getClassName(obj)
- #define IV(obj) object_getIndexedIvars(obj)
- #endif
- #endif
|