From f9393f362bbce8751d8befb86f9e28ea5be1a335 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 8 Jan 2014 20:48:21 -0800 Subject: [PATCH] -[NSCFType cy$toJSON:inContext:] 64-bit encoding. --- ObjectiveC/Library.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index dddbd95..7c364ad 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2734,8 +2734,13 @@ void CYObjectiveC_Initialize() { /*XXX*/ JSContextRef context(NULL); CYPoolTry { ObjectiveC_Protocols_ = JSClassCreate(&definition); #ifdef __APPLE__ +// XXX: this is horrible; there has to be a better way to do this +#ifdef __LP64__ + class_addMethod(NSCFType_, @selector(cy$toJSON:inContext:), reinterpret_cast(&NSCFType$cy$toJSON$inContext$), "^{OpaqueJSValue=}32@0:8@16^{OpaqueJSContext=}24"); +#else class_addMethod(NSCFType_, @selector(cy$toJSON:inContext:), reinterpret_cast(&NSCFType$cy$toJSON$inContext$), "^{OpaqueJSValue=}16@0:4@8^{OpaqueJSContext=}12"); #endif +#endif } CYPoolCatch() } void CYObjectiveC_SetupContext(JSContextRef context) { CYPoolTry { -- 2.49.0