2008-05-08 Ariya Hidayat <ariya.hidayat@trolltech.com>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2008 09:39:35 +0000 (09:39 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2008 09:39:35 +0000 (09:39 +0000)
        Reviewed by Simon.

        Use native Windows library handling (instead of QLibrary)
        for Qt/Win32's PlatformModule.

        * platform/FileSystem.h:
        (WebCore::PlatformModuleVersion::PlatformModuleVersion):
        * platform/qt/FileSystemQt.cpp:
        (WebCore::unloadModule):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32976 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/FileSystem.h
WebCore/platform/qt/FileSystemQt.cpp

index eef5fa2..4464616 100644 (file)
@@ -1,3 +1,15 @@
+2008-05-08  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon.
+
+        Use native Windows library handling (instead of QLibrary) 
+        for Qt/Win32's PlatformModule.
+
+        * platform/FileSystem.h:
+        (WebCore::PlatformModuleVersion::PlatformModuleVersion):
+        * platform/qt/FileSystemQt.cpp:
+        (WebCore::unloadModule):
+
 2008-05-08  Simon Hausmann  <hausmann@webkit.org>
 
         Reviewed and found by Holger.
index c9279af..29c2ddf 100644 (file)
@@ -36,6 +36,9 @@
 #if PLATFORM(QT)
 #include <QFile>
 #include <QLibrary>
+#if defined(Q_OS_WIN32)
+#include <windows.h>
+#endif
 #endif
 
 #include <time.h>
@@ -72,10 +75,34 @@ struct PlatformModuleVersion {
 
 };
 #elif PLATFORM(QT)
+
 typedef QFile* PlatformFileHandle;
-typedef QLibrary* PlatformModule;
 const PlatformFileHandle invalidPlatformFileHandle = 0;
+#if defined(Q_WS_X11)
+typedef QLibrary* PlatformModule;
 typedef unsigned PlatformModuleVersion;
+#endif
+#if defined(Q_OS_WIN32)
+typedef HMODULE PlatformModule;
+struct PlatformModuleVersion {
+    unsigned leastSig;
+    unsigned mostSig;
+
+    PlatformModuleVersion(unsigned)
+        : leastSig(0)
+        , mostSig(0)
+    {
+    }
+
+    PlatformModuleVersion(unsigned lsb, unsigned msb)
+        : leastSig(lsb)
+        , mostSig(msb)
+    {
+    }
+
+};
+#endif
+
 #else
 typedef int PlatformFileHandle;
 #if PLATFORM(GTK)
index cb9a14c..bb5e4e9 100644 (file)
@@ -127,6 +127,7 @@ int writeToFile(PlatformFileHandle handle, const char* data, int length)
     return 0;
 }
 
+#if defined(Q_WS_X11)
 bool unloadModule(PlatformModule module)
 {
     if (module->unload()) {
@@ -136,6 +137,14 @@ bool unloadModule(PlatformModule module)
 
     return false;
 }
+#endif
+
+#if defined(Q_OS_WIN32)
+bool unloadModule(PlatformModule module)
+{
+    return ::FreeLibrary(module);
+}
+#endif
 
 }