library += -install_name /usr/lib/libcycript.$(dll)
library += -framework Foundation -framework CFNetwork
library += -framework JavaScriptCore -framework WebCore
-library += -lsubstrate
+library += -lsubstrate -liconv
include ObjectiveC.mk
CYUTF16String utf16(CYCastUTF16String(value));
const char *in(reinterpret_cast<const char *>(utf16.data));
+#ifdef __APPLE__
iconv_t conversion(_syscall(iconv_open("UTF-8", "UCS-2-INTERNAL")));
+#else
+ iconv_t conversion(_syscall(iconv_open("UTF-8", "UCS-2")));
+#endif
size_t size(JSStringGetMaximumUTF8CStringSize(value));
char *out(new(pool) char[size]);
JSValueRef args[argc];
for (int i(0); i != argc; ++i)
args[i] = CYCastJSValue(context, argv[i]);
+#ifdef __APPLE__
JSValueRef exception(NULL);
JSObjectRef array(JSObjectMakeArray(context, argc, args, &exception));
CYThrow(context, exception);
+#else
+ JSValueRef value(CYCallAsFunction(context, Array_, NULL, argc, args));
+ JSObjectRef array(CYCastJSObject(context, value));
+#endif
CYSetProperty(context, System_, CYJSString("args"), array);
}
Result_ = JSStringCreateWithUTF8CString("_");
+// XXX: this is very wrong and sad
+#ifdef __APPLE__
CYObjectiveC(context, global);
+#endif
}
return Context_;
ldid := true
dll := so
apr := $(shell apr-1-config --link-ld)
-library := $(apr) -lffi -liconv -lsqlite3
+library := $(apr) -lffi -lsqlite3
console := $(apr) -lreadline
depends :=
ifeq ($(filter ObjectiveC,$(filters)),)
ifneq ($(shell which gnustep-config 2>/dev/null),)
-include GNUstep.mk
+#include GNUstep.mk
endif
endif