#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 && (__x86_64__ || __i386__)
#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, OptimizedByDyldClosure = 1 << 7,
SwiftUnstableVersionMaskShift = 8,
SwiftUnstableVersionMask = 0xff << SwiftUnstableVersionMaskShift,
SwiftStableVersionMaskShift = 16,
SwiftStableVersionMask = 0xffffUL << SwiftStableVersionMaskShift
};
public:
enum : uint32_t {
SwiftVersion1 = 1,
SwiftVersion1_2 = 2,
SwiftVersion2 = 3,
SwiftVersion3 = 4,
SwiftVersion4 = 5,
SwiftVersion4_1 = 6,
SwiftVersion4_2 = 6, SwiftVersion5 = 7
};
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 optimizedByDyldClosure() const { return flags & OptimizedByDyldClosure; }
bool containsSwift() const { return (flags & SwiftUnstableVersionMask) != 0; }
uint32_t swiftUnstableVersion() const { return (flags & SwiftUnstableVersionMask) >> SwiftUnstableVersionMaskShift; }
#endif
} objc_image_info;
typedef struct _objc_duplicate_class {
uint32_t version;
uint32_t flags;
const char name[64];
} objc_duplicate_class;
#define OBJC_HAS_DUPLICATE_CLASS 1
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_MACCATALYST && !__arm64__
#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
# ifndef __APPLE_BLEACH_SDK__
__BRIDGEOS_UNAVAILABLE
# endif
#endif
OBJC_ROOT_CLASS
@interface Object {
Class isa;
}
@end
#pragma clang diagnostic pop
#endif
#endif