baton->dlerror();
}
+#define Framework(framework) \
+ "/System/Library/Frameworks/" #framework ".framework/" #framework
+
void *Routine(void *arg) {
Baton *baton(reinterpret_cast<Baton *>(arg));
dlset(baton, dlopen, "dlopen");
if (baton->dlsym(RTLD_DEFAULT, "JSEvaluateScript") == NULL)
- dlopen("/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore", RTLD_GLOBAL | RTLD_LAZY);
+ dlopen(Framework(JavaScriptCore), RTLD_GLOBAL | RTLD_LAZY);
void *(*objc_getClass)(const char *);
dlset(baton, objc_getClass, "objc_getClass");
if (objc_getClass("WebUndefined") == NULL)
- dlopen("/System/Library/Frameworks/WebKit.framework/WebKit", RTLD_GLOBAL | RTLD_LAZY);
+ dlopen(Framework(WebKit), RTLD_GLOBAL | RTLD_LAZY);
void *handle(dlopen(baton->library, RTLD_LAZY | RTLD_LOCAL));
if (handle == NULL) {