From 7cdfdc9fdde21d22c43ce160bfd9e34fb3ac24e1 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 8 Jul 2010 02:40:37 +0000 Subject: [PATCH] Abstract folder for Frameworks into a #defiine. --- Trampoline.t.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Trampoline.t.cpp b/Trampoline.t.cpp index 6a87b5d..78c8183 100644 --- a/Trampoline.t.cpp +++ b/Trampoline.t.cpp @@ -50,6 +50,9 @@ static _finline void dlset(Baton *baton, Type_ &function, const char *name, void baton->dlerror(); } +#define Framework(framework) \ + "/System/Library/Frameworks/" #framework ".framework/" #framework + void *Routine(void *arg) { Baton *baton(reinterpret_cast(arg)); @@ -57,13 +60,13 @@ void *Routine(void *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) { -- 2.49.0