[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 13:36:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 257fc18b037c752fb8e7e11b1d07338e1258e322
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 21 16:26:02 2010 +0000

    Fix build.
    
    * mac/MainMac.cpp:
    (closeUnusedFileDescriptors):
    Move this out into a separate function.
    
    (main):
    Don't use the soft linking macros, they were bringing in WTFReportAssertionFailure.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67959 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index a4c2350..a0b0235 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-21  Anders Carlsson  <andersca at apple.com>
+
+        Fix build.
+
+        * mac/MainMac.cpp:
+        (closeUnusedFileDescriptors):
+        Move this out into a separate function.
+
+        (main):
+        Don't use the soft linking macros, they were bringing in WTFReportAssertionFailure.
+
 2010-09-20  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebKit2/mac/MainMac.cpp b/WebKit2/mac/MainMac.cpp
index 0f79b61..9ffdd4f 100644
--- a/WebKit2/mac/MainMac.cpp
+++ b/WebKit2/mac/MainMac.cpp
@@ -23,18 +23,33 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <WebCore/SoftLinking.h>
+#include <dlfcn.h>
 
-SOFT_LINK_FRAMEWORK(WebKit2);
-SOFT_LINK(WebKit2, WebKitMain, int, (int argc, char **argv), (argc, argv));
-
-int main(int argc, char** argv)
+static void closeUnusedFileDescriptors()
 {
     int numFDs = getdtablesize();
 
     // Close all file descriptors except stdin, stdout and stderr.
     for (int fd = 3; fd < numFDs; ++fd)
         close(fd);
+}
+
+int main(int argc, char** argv)
+{
+    closeUnusedFileDescriptors();
+
+    static void* frameworkLibrary = dlopen("/System/Library/Frameworks/WebKit2.framework/WebKit2", RTLD_NOW);
+    if (!frameworkLibrary) {
+        fprintf(stderr, "Unable to load WebKit2.framework: %s\n", dlerror());
+        return EXIT_FAILURE;
+    }
+
+    typedef int (*WebKitMainFunction)(int argc, char** argv);
+    WebKitMainFunction webKitMain = reinterpret_cast<WebKitMainFunction>(dlsym(frameworkLibrary, "WebKitMain"));
+    if (!webKitMain) {
+        fprintf(stderr, "Unable to find entry point in WebKit2.framework: %s\n", dlerror());
+        return EXIT_FAILURE;
+    }
 
-    return WebKitMain(argc, argv);
+    return webKitMain(argc, argv);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list