Blob Blame History Raw
--- Source/WebCore/platform/FileSystem.h.orig  2010-11-14 01:32:43.897746786 +0100
+++ Source/WebCore/platform/FileSystem.h       2010-11-14 01:33:35.471696924 +0100
@@ -72,7 +72,7 @@
 namespace WebCore {
 
 // PlatformModule
-#if OS(WINDOWS)
+#if OS(WINDOWS) && !PLATFORM(GTK)
 typedef HMODULE PlatformModule;
 #elif PLATFORM(QT)
 #if defined(Q_WS_MAC)
@@ -117,7 +117,7 @@
 #if PLATFORM(QT)
 typedef QFile* PlatformFileHandle;
 const PlatformFileHandle invalidPlatformFileHandle = 0;
-#elif OS(WINDOWS)
+#elif OS(WINDOWS) && !PLATFORM(GTK)
 typedef HANDLE PlatformFileHandle;
 // FIXME: -1 is INVALID_HANDLE_VALUE, defined in <winbase.h>. Chromium tries to
 // avoid using Windows headers in headers.  We'd rather move this into the .cpp.
@@ -203,7 +203,7 @@
 CString applicationDirectoryPath();
 #endif
 
-#if PLATFORM(WIN) && !OS(WINCE)
+#if PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(GTK)
 String localUserSpecificStorageDirectory();
 String roamingUserSpecificStorageDirectory();
 bool safeCreateFile(const String&, CFDataRef);
--- Source/WebCore/dom/XMLDocumentParserLibxml2.cpp.orig       2010-11-14 01:16:29.252186309 +0100
+++ Source/WebCore/dom/XMLDocumentParserLibxml2.cpp    2010-11-14 01:17:05.364811184 +0100
@@ -940,7 +940,7 @@
     if (isStopped())
         return;

-#if COMPILER(MSVC) || COMPILER(RVCT)
+#if COMPILER(MSVC) || COMPILER(RVCT) || COMPILER(MINGW)
     char m[1024];
     vsnprintf(m, sizeof(m) - 1, message, args);
 #else
@@ -954,7 +954,7 @@
     else
         handleError(type, m, lineNumber(), columnNumber());

-#if !COMPILER(MSVC) && !COMPILER(RVCT)
+#if !COMPILER(MSVC) && !COMPILER(RVCT) && !COMPILER(MINGW)
     free(m);
 #endif
 }
--- Source/WebKit/gtk/webkit/webkitwebsettings.cpp.orig	2011-04-21 00:25:52.740516641 +0200
+++ Source/WebKit/gtk/webkit/webkitwebsettings.cpp	2011-04-21 00:26:00.067653521 +0200
@@ -40,7 +40,7 @@
 #if OS(UNIX)
 #include <sys/utsname.h>
 #elif OS(WINDOWS)
-#include "SystemInfo.h"
+#include "win/SystemInfo.h"
 #endif
 
 /**
--- Source/WebCore/platform/graphics/WOFFFileFormat.cpp.orig	2011-04-21 00:37:18.437364878 +0200
+++ Source/WebCore/platform/graphics/WOFFFileFormat.cpp	2011-04-23 15:06:02.763002927 +0200
@@ -43,7 +43,7 @@
 #define ntohs(x) std_ntohs(x)
 #endif
 
-#if PLATFORM(WIN)
+#ifdef WIN32
 #if CPU(BIG_ENDIAN)
 #define ntohs(x) ((uint16_t)(x))
 #define htons(x) ((uint16_t)(x))
--- Source/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h.orig	2011-04-24 10:14:16.151292163 +0200
+++ Source/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h	2011-04-24 10:14:59.632105921 +0200
@@ -34,7 +34,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef WIN32
+typedef wchar_t UChar;
+#else
 typedef uint16_t UChar;
+#endif
 typedef int32_t UChar32;
 
 namespace WTF {
--- Source/WebCore/platform/KURL.cpp.orig      2010-11-14 01:23:55.869590450 +0100
+++ Source/WebCore/platform/KURL.cpp   2010-11-14 01:25:04.996595383 +0100
@@ -1454,7 +1454,7 @@
 #elif USE(GLIB_UNICODE)
     GOwnPtr<gchar> utf8Hostname;
     GOwnPtr<GError> utf8Err;
-    utf8Hostname.set(g_utf16_to_utf8(str, strLen, 0, 0, &utf8Err.outPtr()));
+    utf8Hostname.set(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(str), strLen, 0, 0, &utf8Err.outPtr()));
     if (utf8Err)
         return;
 
--- Source/WebCore/platform/text/TextEncoding.cpp.orig 2010-11-14 01:26:26.023458630 +0100
+++ Source/WebCore/platform/text/TextEncoding.cpp      2010-11-14 01:27:31.208555988 +0100
@@ -119,7 +119,7 @@
     return newTextCodec(*this)->encode(reinterpret_cast<const UChar *>(str.utf16()), str.length(), handling);
 #elif USE(GLIB_UNICODE)
     GOwnPtr<char> UTF8Source;
-    UTF8Source.set(g_utf16_to_utf8(characters, length, 0, 0, 0));
+    UTF8Source.set(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(characters), length, 0, 0, 0));
     if (!UTF8Source) {
         // If conversion to UTF-8 failed, try with the string without normalization
         return newTextCodec(*this)->encode(characters, length, handling);
@@ -130,7 +130,7 @@

     long UTF16Length;
     GOwnPtr<UChar> UTF16Normalized;
-    UTF16Normalized.set(g_utf8_to_utf16(UTF8Normalized.get(), -1, 0, &UTF16Length, 0));
+    UTF16Normalized.set(reinterpret_cast<UChar*>(g_utf8_to_utf16(UTF8Normalized.get(), -1, 0, &UTF16Length, 0)));

     return newTextCodec(*this)->encode(UTF16Normalized.get(), UTF16Length, handling);
 #elif OS(WINCE)
--- Source/WebCore/platform/gtk/PopupMenuGtk.cpp.orig	2011-04-24 12:19:13.327884741 +0200
+++ Source/WebCore/platform/gtk/PopupMenuGtk.cpp	2011-04-24 12:39:13.653313780 +0200
@@ -171,9 +171,9 @@
     // menulists.
     bool repeatingCharacter = unicodeCharacter != m_previousKeyEventCharacter;
     if (event->time - m_previousKeyEventTimestamp > gSearchTimeoutMs)
-        m_currentSearchString = String(static_cast<UChar*>(utf16String.get()), charactersWritten);
+        m_currentSearchString = String(reinterpret_cast<UChar*>(utf16String.get()), charactersWritten);
     else if (repeatingCharacter)
-        m_currentSearchString.append(String(static_cast<UChar*>(utf16String.get()), charactersWritten));
+        m_currentSearchString.append(String(reinterpret_cast<UChar*>(utf16String.get()), charactersWritten));
 
     m_previousKeyEventTimestamp = event->time;
     m_previousKeyEventCharacter = unicodeCharacter;
--- Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp.orig     2010-11-14 02:00:18.844672945 +0100
+++ Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp  2010-11-14 02:00:37.786081187 +0100
@@ -75,7 +75,7 @@
 bool CharacterIterator::setText(const UChar* string, int length)
 {
     long utf8Size = 0;
-    m_utf8.set(g_utf16_to_utf8(string, length, 0, &utf8Size, 0));
+    m_utf8.set(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(string), length, 0, &utf8Size, 0));
     if (!utf8Size)
         return false;

--- Source/WebCore/plugins/win/PluginDatabaseWin.cpp.orig	2010-11-14 01:45:58.543238260 +0100
+++ Source/WebCore/plugins/win/PluginDatabaseWin.cpp	2010-11-14 01:51:18.815019467 +0100
@@ -102,7 +102,7 @@
         DWORD pathStrSize = sizeof(pathStr);
         DWORD type;
 
-        result = SHGetValue(key, name, TEXT("Path"), &type, (LPBYTE)pathStr, &pathStrSize);
+        result = SHGetValueW(key, name, L"Path", &type, (LPBYTE)pathStr, &pathStrSize);
         if (result != ERROR_SUCCESS || type != REG_SZ)
             continue;
 
@@ -210,7 +210,7 @@
     HKEY key;
     LONG result;
     
-    result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Mozilla"), 0, KEY_READ, &key);
+    result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Mozilla", 0, KEY_READ, &key);
     if (result == ERROR_SUCCESS) {
         WCHAR name[128];
         FILETIME lastModified;
@@ -227,7 +227,7 @@
             HKEY extensionsKey;
 
             // Try opening the key
-            result = RegOpenKeyEx(key, extensionsPath.charactersWithNullTermination(), 0, KEY_READ, &extensionsKey);
+            result = RegOpenKeyExW(key, extensionsPath.charactersWithNullTermination(), 0, KEY_READ, &extensionsKey);
 
             if (result == ERROR_SUCCESS) {
                 // Now get the plugins directory
@@ -235,7 +235,7 @@
                 DWORD pluginsDirectorySize = sizeof(pluginsDirectoryStr);
                 DWORD type;
 
-                result = RegQueryValueEx(extensionsKey, TEXT("Plugins"), 0, &type, (LPBYTE)&pluginsDirectoryStr, &pluginsDirectorySize);
+                result = RegQueryValueExW(extensionsKey, L"Plugins", 0, &type, (LPBYTE)&pluginsDirectoryStr, &pluginsDirectorySize);
 
                 if (result == ERROR_SUCCESS && type == REG_SZ)
                     directories.append(String(pluginsDirectoryStr, pluginsDirectorySize / sizeof(WCHAR) - 1));
@@ -253,7 +253,7 @@
 #if !OS(WINCE)
     // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs
     WCHAR pluginDirectoryStr[_MAX_PATH + 1];
-    DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
+    DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(L"%SYSTEMDRIVE%\\PFiles\\Plugins", pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
 
     if (pluginDirectorySize > 0 && pluginDirectorySize <= WTF_ARRAY_LENGTH(pluginDirectoryStr))
         directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1));
@@ -263,7 +263,7 @@
     WCHAR installationDirectoryStr[_MAX_PATH];
     DWORD installationDirectorySize = sizeof(installationDirectoryStr);
 
-    HRESULT result = SHGetValue(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\MediaPlayer"), TEXT("Installation Directory"), &type, (LPBYTE)&installationDirectoryStr, &installationDirectorySize);
+    HRESULT result = SHGetValueW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\MediaPlayer", L"Installation Directory", &type, (LPBYTE)&installationDirectoryStr, &installationDirectorySize);
 
     if (result == ERROR_SUCCESS && type == REG_SZ)
         directories.append(String(installationDirectoryStr, installationDirectorySize / sizeof(WCHAR) - 1));
@@ -275,7 +275,7 @@
     WCHAR installationDirectoryStr[_MAX_PATH];
     DWORD installationDirectorySize = sizeof(installationDirectoryStr);
 
-    HRESULT result = SHGetValue(HKEY_LOCAL_MACHINE, TEXT("Software\\Apple Computer, Inc.\\QuickTime"), TEXT("InstallDir"), &type, (LPBYTE)&installationDirectoryStr, &installationDirectorySize);
+    HRESULT result = SHGetValueW(HKEY_LOCAL_MACHINE, L"Software\\Apple Computer, Inc.\\QuickTime", L"InstallDir", &type, (LPBYTE)&installationDirectoryStr, &installationDirectorySize);
 
     if (result == ERROR_SUCCESS && type == REG_SZ) {
         String pluginDir = String(installationDirectoryStr, installationDirectorySize / sizeof(WCHAR) - 1) + "\\plugins";
@@ -286,7 +286,7 @@
 static inline void addAdobeAcrobatPluginDirectory(Vector<String>& directories)
 {
     HKEY key;
-    HRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Adobe\\Acrobat Reader"), 0, KEY_READ, &key);
+    HRESULT result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Adobe\\Acrobat Reader", 0, KEY_READ, &key);
     if (result != ERROR_SUCCESS)
         return;
 
@@ -317,7 +317,7 @@
         DWORD acrobatInstallPathSize = sizeof(acrobatInstallPathStr);
 
         String acrobatPluginKeyPath = "Software\\Adobe\\Acrobat Reader\\" + latestAcrobatVersionString + "\\InstallPath";
-        result = SHGetValue(HKEY_LOCAL_MACHINE, acrobatPluginKeyPath.charactersWithNullTermination(), 0, &type, (LPBYTE)acrobatInstallPathStr, &acrobatInstallPathSize);
+        result = SHGetValueW(HKEY_LOCAL_MACHINE, acrobatPluginKeyPath.charactersWithNullTermination(), 0, &type, (LPBYTE)acrobatInstallPathStr, &acrobatInstallPathSize);
 
         if (result == ERROR_SUCCESS) {
             String acrobatPluginDirectory = String(acrobatInstallPathStr, acrobatInstallPathSize / sizeof(WCHAR) - 1) + "\\browser";
@@ -331,7 +331,7 @@
 static inline void addJavaPluginDirectory(Vector<String>& directories)
 {
     HKEY key;
-    HRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\JavaSoft\\Java Plug-in"), 0, KEY_READ, &key);
+    HRESULT result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\JavaSoft\\Java Plug-in", 0, KEY_READ, &key);
     if (result != ERROR_SUCCESS)
         return;
 
@@ -364,10 +364,10 @@
         DWORD useNewPluginSize;
 
         String javaPluginKeyPath = "Software\\JavaSoft\\Java Plug-in\\" + latestJavaVersionString;
-        result = SHGetValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination(), TEXT("UseNewJavaPlugin"), &type, (LPVOID)&useNewPluginValue, &useNewPluginSize);
+        result = SHGetValueW(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination(), L"UseNewJavaPlugin", &type, (LPVOID)&useNewPluginValue, &useNewPluginSize);
 
         if (result == ERROR_SUCCESS && useNewPluginValue == 1) {
-            result = SHGetValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination(), TEXT("JavaHome"), &type, (LPBYTE)javaInstallPathStr, &javaInstallPathSize);
+            result = SHGetValueW(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination(), L"JavaHome", &type, (LPBYTE)javaInstallPathStr, &javaInstallPathSize);
             if (result == ERROR_SUCCESS) {
                 String javaPluginDirectory = String(javaInstallPathStr, javaInstallPathSize / sizeof(WCHAR) - 1) + "\\bin\\new_plugin";
                 directories.append(javaPluginDirectory);
@@ -387,12 +387,12 @@
     if (!cachedPluginDirectory) {
         cachedPluginDirectory = true;
 
-        int moduleFileNameLen = GetModuleFileName(0, moduleFileNameStr, _MAX_PATH);
+        int moduleFileNameLen = GetModuleFileNameW(0, moduleFileNameStr, _MAX_PATH);
 
         if (!moduleFileNameLen || moduleFileNameLen == _MAX_PATH)
             goto exit;
 
-        if (!PathRemoveFileSpec(moduleFileNameStr))
+        if (!PathRemoveFileSpecW(moduleFileNameStr))
             goto exit;
 
         pluginsDirectory = String(moduleFileNameStr) + "\\Plugins";
@@ -406,15 +406,15 @@
 #if !OS(WINCE)
     WCHAR systemDirectoryStr[MAX_PATH];
 
-    if (!GetSystemDirectory(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
+    if (!GetSystemDirectoryW(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
         return;
 
     WCHAR macromediaDirectoryStr[MAX_PATH];
 
-    PathCombine(macromediaDirectoryStr, systemDirectoryStr, TEXT("macromed\\Flash"));
+    PathCombineW(macromediaDirectoryStr, systemDirectoryStr, L"macromed\\Flash");
     directories.append(macromediaDirectoryStr);
 
-    PathCombine(macromediaDirectoryStr, systemDirectoryStr, TEXT("macromed\\Shockwave 10"));
+    PathCombineW(macromediaDirectoryStr, systemDirectoryStr, L"macromed\\Shockwave 10");
     directories.append(macromediaDirectoryStr);
 #endif
 }
--- Source/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.cpp.orig	2010-11-14 02:39:27.495446094 +0100
+++ Source/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.cpp	2010-11-14 02:41:35.176717358 +0100
@@ -189,8 +189,8 @@
     GOwnPtr<char> utf8a;
     GOwnPtr<char> utf8b;
 
-    utf8a.set(g_utf16_to_utf8(a, len, 0, 0, 0));
-    utf8b.set(g_utf16_to_utf8(b, len, 0, 0, 0));
+    utf8a.set(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(a), len, 0, 0, 0));
+    utf8b.set(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(b), len, 0, 0, 0));
 
     GOwnPtr<char> foldedA;
     GOwnPtr<char> foldedB;