mostly win leftovers removal

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2016-09-15 20:09:10 +00:00
parent e2ac497565
commit 4c2d49b3d3
13 changed files with 21 additions and 236 deletions

View file

@ -41,19 +41,11 @@
#include "qtconcurrentiteratekernel.h"
#if defined(Q_OS_MAC)
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <unistd.h>
#elif defined(Q_OS_UNIX)
#if defined(Q_OS_HURD)
#include <sys/time.h>
#endif
#include <time.h>
#include <unistd.h>
#elif defined(Q_OS_WIN)
#include <qt_windows.h>
#endif
#include "qfunctions_p.h"
@ -66,16 +58,6 @@ enum {
MedianSize = 7
};
#if defined(Q_OS_MAC)
static qint64 getticks()
{
return mach_absolute_time();
}
#elif defined(Q_OS_UNIX)
static qint64 getticks()
{
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
@ -115,19 +97,7 @@ static qint64 getticks()
#endif
}
#elif defined(Q_OS_WIN)
static qint64 getticks()
{
LARGE_INTEGER x;
if (!QueryPerformanceCounter(&x))
return 0;
return x.QuadPart;
}
#endif
static double elapsed(qint64 after, qint64 before)
static inline double elapsed(qint64 after, qint64 before)
{
return double(after - before);
}

View file

@ -75,6 +75,10 @@
#define QT_NO_QWS_VNC
#define QT_NO_AUDIO_BACKEND
#define QT_NO_DIRECTWRITE
#define QT_NO_STYLE_WINDOWSCE
#define QT_NO_STYLE_WINDOWSMOBILE
#define QT_NO_STYLE_WINDOWSXP
#define QT_NO_STYLE_WINDOWSVISTA
/* Qt build specs */
#ifndef QT_EDITION
@ -209,10 +213,6 @@
#cmakedefine QT_NO_STYLE_CLEANLOOKS
#cmakedefine QT_NO_STYLE_PLASTIQUE
#cmakedefine QT_NO_STYLE_STYLESHEET
#cmakedefine QT_NO_STYLE_WINDOWSCE
#cmakedefine QT_NO_STYLE_WINDOWSMOBILE
#cmakedefine QT_NO_STYLE_WINDOWSVISTA
#cmakedefine QT_NO_STYLE_WINDOWSXP
/* Utilities */
#cmakedefine QT_NO_ACCESSIBILITY

View file

@ -229,9 +229,6 @@
// QMotifStyle
//#define QT_NO_STYLE_MOTIF
// QWindowsStyle
//#define QT_NO_STYLE_WINDOWS
// QSystemSemaphore
//#define QT_NO_SYSTEMSEMAPHORE
@ -385,11 +382,6 @@
#define QT_NO_STYLE_CDE
#endif
// QWindowsXPStyle
#if !defined(QT_NO_STYLE_WINDOWSXP) && (defined(QT_NO_STYLE_WINDOWS))
#define QT_NO_STYLE_WINDOWSXP
#endif
// QToolButton
#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION))
#define QT_NO_TOOLBUTTON
@ -450,11 +442,6 @@
#define QT_NO_SCROLLAREA
#endif
// QWindowsVistaStyle
#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWSXP))
#define QT_NO_STYLE_WINDOWSVISTA
#endif
// QTabBar
#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON))
#define QT_NO_TABBAR
@ -530,16 +517,6 @@
#define QT_NO_STYLE_STYLESHEET
#endif
// QWindowsCEStyle
#if !defined(QT_NO_STYLE_WINDOWSCE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM))
#define QT_NO_STYLE_WINDOWSCE
#endif
// QWindowsMobileStyle
#if !defined(QT_NO_STYLE_WINDOWSMOBILE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM))
#define QT_NO_STYLE_WINDOWSMOBILE
#endif
// QtSvg module
#if !defined(QT_NO_SVG) && (defined(QT_NO_XMLSTREAMREADER) || defined(QT_NO_CSSPARSER))
#define QT_NO_SVG

View file

@ -239,16 +239,12 @@ void QPollingFileSystemWatcherEngine::timeout()
QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
{
#if defined(Q_OS_WIN)
return new QWindowsFileSystemWatcherEngine;
#elif defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY)
return QInotifyFileSystemWatcherEngine::create();
#elif defined(Q_OS_LINUX)
#if defined(Q_OS_LINUX)
QFileSystemWatcherEngine *eng = QInotifyFileSystemWatcherEngine::create();
if(!eng)
eng = QDnotifyFileSystemWatcherEngine::create();
return eng;
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
#elif defined(Q_OS_FREEBSD)
return QKqueueFileSystemWatcherEngine::create();
#else
return 0;

View file

@ -433,7 +433,6 @@ qint64 QFSFileEngine::size() const
return d->nativeSize();
}
#ifndef Q_OS_WIN
/*!
\internal
*/
@ -448,7 +447,6 @@ qint64 QFSFileEnginePrivate::sizeFdFh() const
return 0;
return metaData.size();
}
#endif
/*!
\reimp
@ -683,11 +681,7 @@ qint64 QFSFileEnginePrivate::writeFdFh(const char *data, qint64 len)
} else if (fd != -1) {
// Unbuffered stdio mode.
#ifdef Q_OS_WIN
int result;
#else
ssize_t result;
#endif
do {
result = QT_WRITE(fd, data + writtenBytes, size_t(len - writtenBytes));
} while ((result == -1 && errno == EINTR)

View file

@ -119,10 +119,8 @@ public:
mutable uint is_sequential : 2;
mutable uint could_stat : 1;
mutable uint tried_stat : 1;
#if !defined(Q_OS_WINCE)
mutable uint need_lstat : 1;
mutable uint is_link : 1;
#endif
bool doStat(QFileSystemMetaData::MetaDataFlags flags = QFileSystemMetaData::PosixStatFlags) const;
bool isSymlink() const;

View file

@ -118,19 +118,6 @@ class QProcessEnvironmentPrivate: public QSharedData
public:
typedef QProcEnvKey Key;
typedef QProcEnvValue Value;
#ifdef Q_OS_WIN
inline Key prepareName(const QString &name) const { return Key(name); }
inline QString nameToString(const Key &name) const { return name; }
inline Value prepareValue(const QString &value) const { return value; }
inline QString valueToString(const Value &value) const { return value; }
struct MutexLocker {
MutexLocker(const QProcessEnvironmentPrivate *) {}
};
struct OrderedMutexLocker {
OrderedMutexLocker(const QProcessEnvironmentPrivate *,
const QProcessEnvironmentPrivate *) {}
};
#else
inline Key prepareName(const QString &name) const
{
Key &ent = nameMap[name];
@ -177,17 +164,14 @@ public:
hash.detach();
nameMap.detach();
}
#endif
typedef QHash<Key, Value> Hash;
Hash hash;
#ifdef Q_OS_UNIX
typedef QHash<QString, Key> NameHash;
mutable NameHash nameMap;
mutable QMutex mutex;
#endif
static QProcessEnvironment fromList(const QStringList &list);
QStringList toList() const;

View file

@ -292,18 +292,6 @@ QStringList QStandardPaths::locateAll(StandardLocation type, const QString &file
return result;
}
#ifdef Q_OS_WIN
static QStringList executableExtensions()
{
// If %PATHEXT% does not contain .exe, it is either empty, malformed, or distorted in ways that we cannot support, anyway.
const QStringList pathExt = QString::fromLocal8Bit(qgetenv("PATHEXT")).toLower().split(QLatin1Char(';'));
return pathExt.contains(QLatin1String(".exe"), Qt::CaseInsensitive) ?
pathExt :
QStringList() << QLatin1String(".exe") << QLatin1String(".com")
<< QLatin1String(".bat") << QLatin1String(".cmd");
}
#endif
static QString checkExecutable(const QString &path)
{
const QFileInfo info(path);
@ -327,30 +315,6 @@ static inline QString searchExecutable(const QStringList &searchPaths,
return QString();
}
#ifdef Q_OS_WIN
// Find executable appending candidate suffixes, used for suffix-less executables
// on Windows.
static inline QString
searchExecutableAppendSuffix(const QStringList &searchPaths,
const QString &executableName,
const QStringList &suffixes)
{
const QDir currentDir = QDir::current();
foreach (const QString & searchPath, searchPaths) {
const QString candidateRoot = currentDir.absoluteFilePath(searchPath + QLatin1Char('/') + executableName);
foreach (const QString & suffix, suffixes) {
const QString absPath = checkExecutable(candidateRoot + suffix);
if (!absPath.isEmpty()) {
return absPath;
}
}
}
return QString();
}
#endif // Q_OS_WIN
/*!
Finds the executable named \a executableName in the paths specified by \a paths,
or the system paths if \a paths is empty.
@ -378,12 +342,8 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
QStringList searchPaths = paths;
if (paths.isEmpty()) {
QByteArray pEnv = qgetenv("PATH");
#if defined(Q_OS_WIN)
const QLatin1Char pathSep(';');
#else
const QByteArray pEnv = qgetenv("PATH");
const QLatin1Char pathSep(':');
#endif
// Remove trailing slashes, which occur on Windows.
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, QString::SkipEmptyParts);
searchPaths.reserve(rawPaths.size());
@ -396,19 +356,6 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
}
}
#ifdef Q_OS_WIN
// On Windows, if the name does not have a suffix or a suffix not
// in PATHEXT ("xx.foo"), append suffixes from PATHEXT.
static const QStringList executable_extensions = executableExtensions();
if (executableName.contains(QLatin1Char('.'))) {
const QString suffix = QFileInfo(executableName).suffix();
if (suffix.isEmpty() || !executable_extensions.contains(QLatin1Char('.') + suffix, Qt::CaseInsensitive)) {
return searchExecutableAppendSuffix(searchPaths, executableName, executable_extensions);
}
} else {
return searchExecutableAppendSuffix(searchPaths, executableName, executable_extensions);
}
#endif
return searchExecutable(searchPaths, executableName);
}
@ -419,7 +366,6 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
an empty QString if no relevant location can be found.
*/
#if !defined(Q_OS_MAC)
QString QStandardPaths::displayName(StandardLocation type)
{
switch (type) {
@ -461,7 +407,6 @@ QString QStandardPaths::displayName(StandardLocation type)
// not reached
return QString();
}
#endif
QT_END_NAMESPACE

View file

@ -235,7 +235,7 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
return;
d->error = NoError;
d->errorString = QString();
#if !defined(Q_OS_WIN) && !defined(QT_POSIX_IPC)
#if !defined(QT_POSIX_IPC)
// optimization to not destroy/create the file & semaphore
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {
d->initialValue = initialValue;

View file

@ -58,9 +58,8 @@
#ifndef QT_NO_SYSTEMSEMAPHORE
#include "qsharedmemory_p.h"
#ifndef Q_OS_WINCE
# include <sys/types.h>
#endif
#include <sys/types.h>
#ifdef QT_POSIX_IPC
# include <semaphore.h>
#endif
@ -78,10 +77,7 @@ public:
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
}
#ifdef Q_OS_WIN
HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function);
#elif defined(QT_POSIX_IPC)
#if defined(QT_POSIX_IPC)
bool handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function);
#else
@ -94,10 +90,7 @@ public:
QString key;
QString fileName;
int initialValue;
#ifdef Q_OS_WIN
HANDLE semaphore;
HANDLE semaphoreLock;
#elif defined(QT_POSIX_IPC)
#if defined(QT_POSIX_IPC)
sem_t *semaphore;
bool createdSemaphore;
#else

View file

@ -44,11 +44,6 @@
#include <QtCore/qlibrary.h>
#if defined(QT_NO_LIBRARY) && defined(Q_OS_WIN)
#undef QT_NO_LIBRARY
#pragma message("QT_NO_LIBRARY is not supported on Windows")
#endif
#ifndef QT_NO_LIBRARY
QT_BEGIN_HEADER

View file

@ -254,13 +254,6 @@ bool removeGroupSeparators(QLocalePrivate::CharBuff *num)
return true;
}
#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
inline bool isascii(int c)
{
return (c >= 0 && c <=127);
}
#endif
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@ -557,11 +550,11 @@ __RCSID("$NetBSD: strtod.c,v 1.26 1998/02/03 18:44:21 perry Exp $");
#endif /* LIBC_SCCS and not lint */
/*
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
defined(__powerpc__) || defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_MAC) || \
defined(mips) || defined(Q_OS_AIX) || defined(Q_OS_SOLARIS)
# define IEEE_BIG_OR_LITTLE_ENDIAN 1
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
defined(__powerpc__) || defined(mips) || defined(Q_OS_AIX) || \
defined(Q_OS_SOLARIS)
# define IEEE_BIG_OR_LITTLE_ENDIAN 1
#endif
*/
@ -2253,14 +2246,6 @@ static int quorem(Bigint *b, Bigint *S)
* calculation.
*/
#if defined(Q_OS_WIN) && defined (Q_CC_GNU) && !defined(_clear87) // See QTBUG-7576
extern "C" {
__attribute__ ((dllimport)) unsigned int __cdecl __MINGW_NOTHROW _control87 (unsigned int unNew, unsigned int unMask);
__attribute__ ((dllimport)) unsigned int __cdecl __MINGW_NOTHROW _clearfp (void); /* Clear the FPU status word */
}
# define _clear87 _clearfp
#endif
/* This actually sometimes returns a pointer to a string literal
cast to a char*. Do NOT try to modify the return value. */

View file

@ -58,18 +58,7 @@
#include "qdebug.h"
#include "qendian.h"
#include "qmutex.h"
#ifdef Q_OS_MAC
#include <qcore_mac_p.h>
#endif
#include <qfunctions_p.h>
#if defined(Q_OS_WINCE)
#include <windows.h>
#include <winnls.h>
#endif
#include "qfunctions_p.h"
#include <limits.h>
#include <string.h>
@ -4574,12 +4563,6 @@ int QString::localeAwareCompare(const QString &other) const
return localeAwareCompare_helper(constData(), length(), other.constData(), other.length());
}
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
QT_END_NAMESPACE
#include "qt_windows.h"
QT_BEGIN_NAMESPACE
#endif
/*!
\internal
\since 4.5
@ -4591,50 +4574,19 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1,
if (length1 == 0 || length2 == 0)
return ucstrcmp(data1, length1, data2, length2);
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
int res = CompareString(GetUserDefaultLCID(), 0, (wchar_t*)data1, length1, (wchar_t*)data2, length2);
switch (res) {
case CSTR_LESS_THAN:
return -1;
case CSTR_GREATER_THAN:
return 1;
default:
return 0;
}
#elif defined (Q_OS_MAC)
// Use CFStringCompare for comparing strings on Mac. This makes Qt order
// strings the same way as native applications do, and also respects
// the "Order for sorted lists" setting in the International preferences
// panel.
const CFStringRef thisString =
CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault,
reinterpret_cast<const UniChar *>(data1), length1, kCFAllocatorNull);
const CFStringRef otherString =
CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault,
reinterpret_cast<const UniChar *>(data2), length2, kCFAllocatorNull);
const int result = CFStringCompare(thisString, otherString, kCFCompareLocalized);
CFRelease(thisString);
CFRelease(otherString);
return result;
#elif defined(Q_OS_UNIX)
# if defined(QT_USE_ICU)
#if defined(QT_USE_ICU)
int res;
if (qt_ucol_strcoll(data1, length1, data2, length2, &res)) {
if (res == 0)
res = ucstrcmp(data1, length1, data2, length2);
return res;
} // else fall through
# endif
#endif
// declared in <string.h>
int delta = strcoll(toLocal8Bit_helper(data1, length1), toLocal8Bit_helper(data2, length2));
if (delta == 0)
delta = ucstrcmp(data1, length1, data2, length2);
return delta;
#else
return ucstrcmp(data1, length1, data2, length2);
#endif
}
@ -5233,11 +5185,7 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
}
case 'p': {
void *arg = va_arg(ap, void*);
#ifdef Q_OS_WIN64
quint64 i = reinterpret_cast<quint64>(arg);
#else
quint64 i = reinterpret_cast<unsigned long>(arg);
#endif
flags |= QLocalePrivate::Alternate;
subst = locale.d()->unsLongLongToString(i, precision, 16, width, flags);
++c;