/* }}} */
#include <substrate.h>
+#include <dlfcn.h>
+
#include "cycript.hpp"
#include "sig/parse.hpp"
} \
}
+#ifndef __APPLE__
+#define class_getSuperclass GSObjCSuper
+#define object_getClass GSObjCClass
+#endif
+
void CYThrow(JSContextRef context, JSValueRef value);
const char *CYPoolCCYON(apr_pool_t *pool, JSContextRef context, JSValueRef value, JSValueRef *exception);
static JSObjectRef Make(JSContextRef context, id object, Flags flags = None) {
JSObjectRef value(JSObjectMake(context, Instance_, new Instance(object, flags)));
- JSObjectSetPrototype(context, value, CYGetClassPrototype(context, object == nil ? nil : object_getClass(object)));
+ JSObjectSetPrototype(context, value, CYGetClassPrototype(context, object_getClass(object)));
return value;
}
object = (id) (CYCastBool(context, value) ? kCFBooleanTrue : kCFBooleanFalse);
copy = false;
#else
- object = [[NSNumber alloc] initWithBoolean:value];
+ object = [[NSNumber alloc] initWithBool:CYCastBool(context, value)];
copy = true;
#endif
break;
$(target)g++ $(flags) -c -o $@ $<
%.o: %.mm $(header)
- $(target)g++ $(flags) -c -o $@ $< $(objc)
+ $(target)g++ $(objc) $(flags) -c -o $@ $<
libcycript.$(dll): $(code)
$(target)g++ $(flags) -shared -dynamiclib -o $@ $(filter %.o,$^) $(library) $(link)