misc cleanups

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-02-12 16:59:22 +02:00
parent a248429829
commit 1811c02a29
6 changed files with 2 additions and 171 deletions

View file

@ -56,8 +56,6 @@
/* FIXME: if all platforms have these, do they really need #defines? */
#define HAVE_STDINT_H 1
#define WTF_CHANGES 1
#ifdef __cplusplus
#undef new
#undef delete

View file

@ -1,81 +0,0 @@
/*
* 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;
}

View file

@ -83,12 +83,6 @@
#include <pthread.h>
#endif
#ifndef NO_TCMALLOC_SAMPLES
#ifdef WTF_CHANGES
#define NO_TCMALLOC_SAMPLES
#endif
#endif
// Use a background thread to periodically scavenge memory to release back to the system
// https://bugs.webkit.org/show_bug.cgi?id=27900: don't turn this on for Tiger until we have figured out why it caused a crash.
#if defined(BUILDING_ON_TIGER)

View file

@ -1,39 +0,0 @@
/*
* Copyright 2009, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AndroidThreading_h
#define AndroidThreading_h
namespace WTF {
// An interface to the embedding layer, which provides threading support.
class AndroidThreading {
public:
static void scheduleDispatchFunctionsOnMainThread();
};
} // namespace WTF
#endif // AndroidThreading_h

View file

@ -1,42 +0,0 @@
/*
* Copyright 2009, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "MainThread.h"
#include "AndroidThreading.h"
namespace WTF {
void initializeMainThreadPlatform()
{
}
void scheduleDispatchFunctionsOnMainThread()
{
AndroidThreading::scheduleDispatchFunctionsOnMainThread();
}
} // namespace WTF

View file

@ -519,9 +519,10 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_4_3 Version 3 (Qt 4.3)
\value Qt_4_4 Version 4 (Qt 4.4)
\value Qt_4_5 Version 5 (Qt 4.5)
\value Qt_4_6 Version 6 (Qt 4.6, Qt 4.7, Qt 4.8)
\value Qt_4_6 Version 6 (Qt 4.6, Qt 4.7, Qt 4.8, Katie 4.9)
\value Qt_4_7 Same as Qt_4_6.
\value Qt_4_8 Same as Qt_4_6.
\value Qt_4_9 Same as Qt_4_6.
\value Qt_Default
\sa setVersion(), version()