From 5f39cfcc958fd1ac3b5ef9af30002e500f3fb64e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 31 Dec 2013 15:33:14 -0800 Subject: [PATCH] Apple no longer supports *_stret() on -arch arm64. --- ObjectiveC/Library.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 59006c7..3a34f3e 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2165,10 +2165,13 @@ static int struct_forward_array[] = { #define OBJC_MAX_STRUCT_BY_VALUE 1 static int struct_forward_array[] = { 0, 0 }; +#elif defined(__arm64__) +#define CY_NO_STRET #else #error missing objc-runtime-info #endif +#ifndef CY_NO_STRET static bool stret(ffi_type *ffi_type) { return ffi_type->type == FFI_TYPE_STRUCT && ( ffi_type->size > OBJC_MAX_STRUCT_BY_VALUE || @@ -2176,6 +2179,7 @@ static bool stret(ffi_type *ffi_type) { ); } #endif +#endif JSValueRef CYSendMessage(CYPool &pool, JSContextRef context, id self, Class _class, SEL _cmd, size_t count, const JSValueRef arguments[], bool initialize, JSValueRef *exception) { CYTry { const char *type; @@ -2231,9 +2235,11 @@ JSValueRef CYSendMessage(CYPool &pool, JSContextRef context, id self, Class _cla if (imp == NULL) { #ifdef __APPLE__ +#ifndef CY_NO_STRET if (stret(cif.rtype)) imp = class_getMethodImplementation_stret(_class, _cmd); else +#endif imp = class_getMethodImplementation(_class, _cmd); #else objc_super super = {self, _class}; -- 2.45.2