123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- #ifndef _OBJC_ABI_H
- #define _OBJC_ABI_H
- #include <malloc/malloc.h>
- #include <TargetConditionals.h>
- #include <objc/objc.h>
- #include <objc/runtime.h>
- #include <objc/message.h>
- #if TARGET_OS_OSX
- #if __OBJC2__
- OBJC_EXPORT const char __objc_nsobject_class_10_5
- __asm__("$ld$hide$os10.5$_OBJC_CLASS_$_NSObject");
- OBJC_EXPORT const char __objc_nsobject_class_10_6
- __asm__("$ld$hide$os10.6$_OBJC_CLASS_$_NSObject");
- OBJC_EXPORT const char __objc_nsobject_class_10_7
- __asm__("$ld$hide$os10.7$_OBJC_CLASS_$_NSObject");
- OBJC_EXPORT const char __objc_nsobject_metaclass_10_5
- __asm__("$ld$hide$os10.5$_OBJC_METACLASS_$_NSObject");
- OBJC_EXPORT const char __objc_nsobject_metaclass_10_6
- __asm__("$ld$hide$os10.6$_OBJC_METACLASS_$_NSObject");
- OBJC_EXPORT const char __objc_nsobject_metaclass_10_7
- __asm__("$ld$hide$os10.7$_OBJC_METACLASS_$_NSObject");
- OBJC_EXPORT const char __objc_nsobject_isa_10_5
- __asm__("$ld$hide$os10.5$_OBJC_IVAR_$_NSObject.isa");
- OBJC_EXPORT const char __objc_nsobject_isa_10_6
- __asm__("$ld$hide$os10.6$_OBJC_IVAR_$_NSObject.isa");
- OBJC_EXPORT const char __objc_nsobject_isa_10_7
- __asm__("$ld$hide$os10.7$_OBJC_IVAR_$_NSObject.isa");
- #else
- OBJC_EXPORT const char __objc_nsobject_class_10_5
- __asm__("$ld$hide$os10.5$.objc_class_name_NSObject");
- OBJC_EXPORT const char __objc_nsobject_class_10_6
- __asm__("$ld$hide$os10.6$.objc_class_name_NSObject");
- OBJC_EXPORT const char __objc_nsobject_class_10_7
- __asm__("$ld$hide$os10.7$.objc_class_name_NSObject");
- #endif
- #endif
- OBJC_EXPORT void
- _objcInit(void)
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- typedef struct objc_image_info {
- uint32_t version;
- uint32_t flags;
- #if __cplusplus >= 201103L
- private:
- enum : uint32_t {
- IsReplacement = 1<<0,
- SupportsGC = 1<<1,
- RequiresGC = 1<<2,
- OptimizedByDyld = 1<<3,
- CorrectedSynthesize = 1<<4,
- IsSimulated = 1<<5,
- HasCategoryClassProperties = 1<<6,
- SwiftVersionMaskShift = 8,
- SwiftVersionMask = 0xff << SwiftVersionMaskShift
- };
- public:
- enum : uint32_t {
- SwiftVersion1 = 1,
- SwiftVersion1_2 = 2,
- SwiftVersion2 = 3,
- SwiftVersion3 = 4
- };
- public:
- bool isReplacement() const { return flags & IsReplacement; }
- bool supportsGC() const { return flags & SupportsGC; }
- bool requiresGC() const { return flags & RequiresGC; }
- bool optimizedByDyld() const { return flags & OptimizedByDyld; }
- bool hasCategoryClassProperties() const { return flags & HasCategoryClassProperties; }
- bool containsSwift() const { return (flags & SwiftVersionMask) != 0; }
- uint32_t swiftVersion() const { return (flags & SwiftVersionMask) >> SwiftVersionMaskShift; }
- #endif
- } objc_image_info;
- OBJC_EXPORT id _Nullable
- objc_getProperty(id _Nullable self, SEL _Nonnull _cmd,
- ptrdiff_t offset, BOOL atomic)
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_setProperty(id _Nullable self, SEL _Nonnull _cmd, ptrdiff_t offset,
- id _Nullable newValue, BOOL atomic, signed char shouldCopy)
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_setProperty_atomic(id _Nullable self, SEL _Nonnull _cmd,
- id _Nullable newValue, ptrdiff_t offset)
- OBJC_AVAILABLE(10.8, 6.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_setProperty_nonatomic(id _Nullable self, SEL _Nonnull _cmd,
- id _Nullable newValue, ptrdiff_t offset)
- OBJC_AVAILABLE(10.8, 6.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_setProperty_atomic_copy(id _Nullable self, SEL _Nonnull _cmd,
- id _Nullable newValue, ptrdiff_t offset)
- OBJC_AVAILABLE(10.8, 6.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_setProperty_nonatomic_copy(id _Nullable self, SEL _Nonnull _cmd,
- id _Nullable newValue, ptrdiff_t offset)
- OBJC_AVAILABLE(10.8, 6.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_copyStruct(void * _Nonnull dest, const void * _Nonnull src,
- ptrdiff_t size, BOOL atomic, BOOL hasStrong)
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_copyCppObjectAtomic(void * _Nonnull dest, const void * _Nonnull src,
- void (* _Nonnull copyHelper)
- (void * _Nonnull dest, const void * _Nonnull source))
- OBJC_AVAILABLE(10.8, 6.0, 9.0, 1.0, 2.0);
- #if __OBJC2__
- OBJC_EXPORT IMP _Nonnull _objc_empty_vtable
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- #endif
- OBJC_EXPORT struct objc_cache _objc_empty_cache
- OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
- #if __OBJC2__
- OBJC_EXPORT id _Nullable
- objc_msgSendSuper2(struct objc_super * _Nonnull super, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.6, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_msgSendSuper2_stret(struct objc_super * _Nonnull super,
- SEL _Nonnull op,...)
- OBJC_AVAILABLE(10.6, 2.0, 9.0, 1.0, 2.0)
- OBJC_ARM64_UNAVAILABLE;
- OBJC_EXPORT id _Nullable
- objc_msgSend_noarg(id _Nullable self, SEL _Nonnull _cmd)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- #endif
- #if __OBJC2__
- OBJC_EXPORT id _Nullable
- objc_msgSend_debug(id _Nullable self, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT id _Nullable
- objc_msgSendSuper2_debug(struct objc_super * _Nonnull super,
- SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT void
- objc_msgSend_stret_debug(id _Nullable self, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0)
- OBJC_ARM64_UNAVAILABLE;
- OBJC_EXPORT void
- objc_msgSendSuper2_stret_debug(struct objc_super * _Nonnull super,
- SEL _Nonnull op,...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0)
- OBJC_ARM64_UNAVAILABLE;
- # if defined(__i386__)
- OBJC_EXPORT double
- objc_msgSend_fpret_debug(id _Nullable self, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- # elif defined(__x86_64__)
- OBJC_EXPORT long double
- objc_msgSend_fpret_debug(id _Nullable self, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- # if __STDC_VERSION__ >= 199901L
- OBJC_EXPORT _Complex long double
- objc_msgSend_fp2ret_debug(id _Nullable self, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- # else
- OBJC_EXPORT void
- objc_msgSend_fp2ret_debug(id _Nullable self, SEL _Nonnull op, ...)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- # endif
- # endif
- #endif
- #if __OBJC2__
- OBJC_EXPORT void
- objc_msgLookup(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- OBJC_EXPORT void
- objc_msgLookupSuper2(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- OBJC_EXPORT void
- objc_msgLookup_stret(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0)
- OBJC_ARM64_UNAVAILABLE;
- OBJC_EXPORT void
- objc_msgLookupSuper2_stret(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0)
- OBJC_ARM64_UNAVAILABLE;
- # if defined(__i386__)
- OBJC_EXPORT void
- objc_msgLookup_fpret(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- # elif defined(__x86_64__)
- OBJC_EXPORT void
- objc_msgLookup_fpret(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- OBJC_EXPORT void
- objc_msgLookup_fp2ret(void)
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- # endif
- #endif
- #if (TARGET_OS_OSX || TARGET_OS_SIMULATOR) && defined(__x86_64__)
- OBJC_EXPORT void
- objc_msgSend_fixup(void)
- __OSX_DEPRECATED(10.5, 10.8, "fixup dispatch is no longer optimized");
- OBJC_EXPORT void
- objc_msgSend_stret_fixup(void)
- __OSX_DEPRECATED(10.5, 10.8, "fixup dispatch is no longer optimized");
- OBJC_EXPORT void
- objc_msgSendSuper2_fixup(void)
- __OSX_DEPRECATED(10.5, 10.8, "fixup dispatch is no longer optimized");
- OBJC_EXPORT void
- objc_msgSendSuper2_stret_fixup(void)
- __OSX_DEPRECATED(10.5, 10.8, "fixup dispatch is no longer optimized");
- OBJC_EXPORT void
- objc_msgSend_fpret_fixup(void)
- __OSX_DEPRECATED(10.5, 10.8, "fixup dispatch is no longer optimized");
- OBJC_EXPORT void
- objc_msgSend_fp2ret_fixup(void)
- __OSX_DEPRECATED(10.5, 10.8, "fixup dispatch is no longer optimized");
- #endif
- #if __OBJC2__
- OBJC_EXPORT const void * _Nullable objc_ehtype_vtable[]
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- OBJC_EXPORT struct objc_typeinfo OBJC_EHTYPE_id
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- struct _Unwind_Exception;
- struct _Unwind_Context;
- OBJC_EXPORT int
- __objc_personality_v0(int version,
- int actions,
- uint64_t exceptionClass,
- struct _Unwind_Exception * _Nonnull exceptionObject,
- struct _Unwind_Context * _Nonnull context)
- OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
- #endif
- OBJC_EXPORT id _Nullable
- objc_retainBlock(id _Nullable)
- OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0);
- #if __OBJC2__
-
- #if TARGET_OS_SIMULATOR && !TARGET_OS_IOSMAC
-
-
- #elif __LP64__
- # define OBJC_HAVE_NONPOINTER_ISA 1
- # define OBJC_HAVE_PACKED_NONPOINTER_ISA 1
- OBJC_EXPORT const struct { char c; } objc_absolute_packed_isa_class_mask
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- #elif (__ARM_ARCH_7K__ >= 2 || (__arm64__ && !__LP64__))
- # define OBJC_HAVE_NONPOINTER_ISA 1
- # define OBJC_HAVE_INDEXED_NONPOINTER_ISA 1
- OBJC_EXPORT const struct { char c; } objc_absolute_indexed_isa_magic_mask
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- OBJC_EXPORT const struct { char c; } objc_absolute_indexed_isa_magic_value
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- OBJC_EXPORT const struct { char c; } objc_absolute_indexed_isa_index_mask
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- OBJC_EXPORT const struct { char c; } objc_absolute_indexed_isa_index_shift
- OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0);
- #endif
- #endif
- #if __OBJC__ && __OBJC2__
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wobjc-interface-ivars"
- #if !defined(OBJC_DECLARE_SYMBOLS)
- __OSX_AVAILABLE(10.0)
- __IOS_UNAVAILABLE __TVOS_UNAVAILABLE
- __WATCHOS_UNAVAILABLE __BRIDGEOS_UNAVAILABLE
- #endif
- OBJC_ROOT_CLASS
- @interface Object {
- Class isa;
- }
- @end
- #pragma clang diagnostic pop
- #endif
- #endif
|