summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/javascriptcore/JavaScriptCore/os-win32
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-15 12:06:11 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-15 12:06:11 (GMT)
commit22fd80b88e4d75b65d48403975ff0e7fb77d4ae5 (patch)
tree4e2d72720f3852d8dcdb6b7eb1ea5c85f6487b36 /src/3rdparty/javascriptcore/JavaScriptCore/os-win32
parent33c6983a19942c151fa0bcc878b5219e0b641ba9 (diff)
parent2ee0c797d9bb582073b53cb1f8348abaf2acc0db (diff)
downloadQt-22fd80b88e4d75b65d48403975ff0e7fb77d4ae5.zip
Qt-22fd80b88e4d75b65d48403975ff0e7fb77d4ae5.tar.gz
Qt-22fd80b88e4d75b65d48403975ff0e7fb77d4ae5.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (61 commits) Fix broken setCollectionFile (creating multiple models instead reusing) Enable the fast paths when converting to Rgb565 qdoc: ifdefed out all the debug code. Add missing QtScript API shims Further fix license whitespace. Remove NetworkManager test-bed application. Remove configure test for NetworkManager. Fix QDir::entryList regression Add DEFINES to mingw32/windres.exe command line. Fix up whitespace in license headers. Fix SetDialogPreference build error on Symbian. get known wifi networks a more complicated way, but without accessing Only enable BM by default in QNAM for appropriate platforms. fix crash on 10.6 with no wifi interface Fix creation of QNetworkSession. Make QNetworkConfigurationManager and QNetworkConfiguration threadsafe. remove qt_winQString2MB() and qt_winMB2QString() Fix include() path in qimportbase.pri Fix qmake crash on Windows Compile ...
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/os-win32')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/os-win32/WinMain.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/os-win32/WinMain.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/os-win32/WinMain.cpp
new file mode 100644
index 0000000..17800d0
--- /dev/null
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/os-win32/WinMain.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2009 Patrick Gansterer (paroga@paroga.com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "Vector.h"
+#include <winbase.h>
+#include <winnls.h>
+#include <wtf/UnusedParam.h>
+
+int main(int argc, char** argv);
+
+static inline char* convertToUtf8(LPCWSTR widecharString, int length)
+{
+ int requiredSize = WideCharToMultiByte(CP_UTF8, 0, widecharString, length, 0, 0, 0, 0);
+ char* multibyteString = new char[requiredSize + 1];
+
+ WideCharToMultiByte(CP_UTF8, 0, widecharString, length, multibyteString, requiredSize, 0, 0);
+ multibyteString[requiredSize] = '\0';
+
+ return multibyteString;
+}
+
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
+{
+ UNUSED_PARAM(hInstance);
+ UNUSED_PARAM(hPrevInstance);
+ UNUSED_PARAM(nCmdShow);
+
+ Vector<char*> arguments;
+ TCHAR buffer[MAX_PATH];
+
+ int length = GetModuleFileNameW(0, buffer, MAX_PATH);
+ arguments.append(convertToUtf8(buffer, length));
+
+ WCHAR* commandLine = lpCmdLine;
+ while (commandLine[0] != '\0') {
+ int commandLineLength = 1;
+ WCHAR endChar = ' ';
+
+ while (commandLine[0] == ' ')
+ ++commandLine;
+
+ if (commandLine[0] == '\"') {
+ ++commandLine;
+ endChar = '\"';
+ }
+
+ while (commandLine[commandLineLength] != endChar && commandLine[commandLineLength] != '\0')
+ ++commandLineLength;
+
+ arguments.append(convertToUtf8(commandLine, commandLineLength));
+
+ commandLine += commandLineLength;
+ if (endChar != ' ' && commandLine[0] != '\0')
+ ++commandLine;
+ }
+
+ int res = main(arguments.size(), arguments.data());
+
+ for (size_t i = 0; i < arguments.size(); i++)
+ delete arguments[i];
+
+ return res;
+}