]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Library.mm
Don't rely on cc1obj for Objective-C struct tables.
[cycript.git] / ObjectiveC / Library.mm
index f4a72d738cc4604b4e2dd6f433849b98848b0074..f0e6b20411ee4f1ad7c84e770b785c7256e91b95 100644 (file)
 **/
 /* }}} */
 
-#ifdef __APPLE__
-#include "Struct.hpp"
-#endif
-
 #include <Foundation/Foundation.h>
 
 #include "ObjectiveC/Internal.hpp"
@@ -2166,6 +2162,18 @@ static void ObjectiveC_Constants_getPropertyNames(JSContextRef context, JSObject
 }
 
 #ifdef __APPLE__
+#if defined(__i386__) || defined(__x86_64__)
+#define OBJC_MAX_STRUCT_BY_VALUE 8
+static int struct_forward_array[] = {
+    0, 0, 0, 1, 0, 1, 1, 1, 0 };
+#elif defined(__arm__)
+#define OBJC_MAX_STRUCT_BY_VALUE 1
+static int struct_forward_array[] = {
+    0, 0 };
+#else
+#error missing objc-runtime-info
+#endif
+
 static bool stret(ffi_type *ffi_type) {
     return ffi_type->type == FFI_TYPE_STRUCT && (
         ffi_type->size > OBJC_MAX_STRUCT_BY_VALUE ||