mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
mostly win leftovers removal
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
e2ac497565
commit
4c2d49b3d3
13 changed files with 21 additions and 236 deletions
|
@ -41,19 +41,11 @@
|
||||||
|
|
||||||
#include "qtconcurrentiteratekernel.h"
|
#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)
|
#if defined(Q_OS_HURD)
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#elif defined(Q_OS_WIN)
|
|
||||||
#include <qt_windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "qfunctions_p.h"
|
#include "qfunctions_p.h"
|
||||||
|
|
||||||
|
@ -66,16 +58,6 @@ enum {
|
||||||
MedianSize = 7
|
MedianSize = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
|
|
||||||
static qint64 getticks()
|
|
||||||
{
|
|
||||||
return mach_absolute_time();
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(Q_OS_UNIX)
|
|
||||||
|
|
||||||
|
|
||||||
static qint64 getticks()
|
static qint64 getticks()
|
||||||
{
|
{
|
||||||
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
|
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
|
||||||
|
@ -115,19 +97,7 @@ static qint64 getticks()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(Q_OS_WIN)
|
static inline double elapsed(qint64 after, qint64 before)
|
||||||
|
|
||||||
static qint64 getticks()
|
|
||||||
{
|
|
||||||
LARGE_INTEGER x;
|
|
||||||
if (!QueryPerformanceCounter(&x))
|
|
||||||
return 0;
|
|
||||||
return x.QuadPart;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static double elapsed(qint64 after, qint64 before)
|
|
||||||
{
|
{
|
||||||
return double(after - before);
|
return double(after - before);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,10 @@
|
||||||
#define QT_NO_QWS_VNC
|
#define QT_NO_QWS_VNC
|
||||||
#define QT_NO_AUDIO_BACKEND
|
#define QT_NO_AUDIO_BACKEND
|
||||||
#define QT_NO_DIRECTWRITE
|
#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 */
|
/* Qt build specs */
|
||||||
#ifndef QT_EDITION
|
#ifndef QT_EDITION
|
||||||
|
@ -209,10 +213,6 @@
|
||||||
#cmakedefine QT_NO_STYLE_CLEANLOOKS
|
#cmakedefine QT_NO_STYLE_CLEANLOOKS
|
||||||
#cmakedefine QT_NO_STYLE_PLASTIQUE
|
#cmakedefine QT_NO_STYLE_PLASTIQUE
|
||||||
#cmakedefine QT_NO_STYLE_STYLESHEET
|
#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 */
|
/* Utilities */
|
||||||
#cmakedefine QT_NO_ACCESSIBILITY
|
#cmakedefine QT_NO_ACCESSIBILITY
|
||||||
|
|
|
@ -229,9 +229,6 @@
|
||||||
// QMotifStyle
|
// QMotifStyle
|
||||||
//#define QT_NO_STYLE_MOTIF
|
//#define QT_NO_STYLE_MOTIF
|
||||||
|
|
||||||
// QWindowsStyle
|
|
||||||
//#define QT_NO_STYLE_WINDOWS
|
|
||||||
|
|
||||||
// QSystemSemaphore
|
// QSystemSemaphore
|
||||||
//#define QT_NO_SYSTEMSEMAPHORE
|
//#define QT_NO_SYSTEMSEMAPHORE
|
||||||
|
|
||||||
|
@ -385,11 +382,6 @@
|
||||||
#define QT_NO_STYLE_CDE
|
#define QT_NO_STYLE_CDE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// QWindowsXPStyle
|
|
||||||
#if !defined(QT_NO_STYLE_WINDOWSXP) && (defined(QT_NO_STYLE_WINDOWS))
|
|
||||||
#define QT_NO_STYLE_WINDOWSXP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// QToolButton
|
// QToolButton
|
||||||
#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION))
|
#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION))
|
||||||
#define QT_NO_TOOLBUTTON
|
#define QT_NO_TOOLBUTTON
|
||||||
|
@ -450,11 +442,6 @@
|
||||||
#define QT_NO_SCROLLAREA
|
#define QT_NO_SCROLLAREA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// QWindowsVistaStyle
|
|
||||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWSXP))
|
|
||||||
#define QT_NO_STYLE_WINDOWSVISTA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// QTabBar
|
// QTabBar
|
||||||
#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON))
|
#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON))
|
||||||
#define QT_NO_TABBAR
|
#define QT_NO_TABBAR
|
||||||
|
@ -530,16 +517,6 @@
|
||||||
#define QT_NO_STYLE_STYLESHEET
|
#define QT_NO_STYLE_STYLESHEET
|
||||||
#endif
|
#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
|
// QtSvg module
|
||||||
#if !defined(QT_NO_SVG) && (defined(QT_NO_XMLSTREAMREADER) || defined(QT_NO_CSSPARSER))
|
#if !defined(QT_NO_SVG) && (defined(QT_NO_XMLSTREAMREADER) || defined(QT_NO_CSSPARSER))
|
||||||
#define QT_NO_SVG
|
#define QT_NO_SVG
|
||||||
|
|
|
@ -239,16 +239,12 @@ void QPollingFileSystemWatcherEngine::timeout()
|
||||||
|
|
||||||
QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
|
QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_LINUX)
|
||||||
return new QWindowsFileSystemWatcherEngine;
|
|
||||||
#elif defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY)
|
|
||||||
return QInotifyFileSystemWatcherEngine::create();
|
|
||||||
#elif defined(Q_OS_LINUX)
|
|
||||||
QFileSystemWatcherEngine *eng = QInotifyFileSystemWatcherEngine::create();
|
QFileSystemWatcherEngine *eng = QInotifyFileSystemWatcherEngine::create();
|
||||||
if(!eng)
|
if(!eng)
|
||||||
eng = QDnotifyFileSystemWatcherEngine::create();
|
eng = QDnotifyFileSystemWatcherEngine::create();
|
||||||
return eng;
|
return eng;
|
||||||
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
|
#elif defined(Q_OS_FREEBSD)
|
||||||
return QKqueueFileSystemWatcherEngine::create();
|
return QKqueueFileSystemWatcherEngine::create();
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -433,7 +433,6 @@ qint64 QFSFileEngine::size() const
|
||||||
return d->nativeSize();
|
return d->nativeSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
@ -448,7 +447,6 @@ qint64 QFSFileEnginePrivate::sizeFdFh() const
|
||||||
return 0;
|
return 0;
|
||||||
return metaData.size();
|
return metaData.size();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\reimp
|
\reimp
|
||||||
|
@ -683,11 +681,7 @@ qint64 QFSFileEnginePrivate::writeFdFh(const char *data, qint64 len)
|
||||||
} else if (fd != -1) {
|
} else if (fd != -1) {
|
||||||
// Unbuffered stdio mode.
|
// Unbuffered stdio mode.
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
int result;
|
|
||||||
#else
|
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
#endif
|
|
||||||
do {
|
do {
|
||||||
result = QT_WRITE(fd, data + writtenBytes, size_t(len - writtenBytes));
|
result = QT_WRITE(fd, data + writtenBytes, size_t(len - writtenBytes));
|
||||||
} while ((result == -1 && errno == EINTR)
|
} while ((result == -1 && errno == EINTR)
|
||||||
|
|
|
@ -119,10 +119,8 @@ public:
|
||||||
mutable uint is_sequential : 2;
|
mutable uint is_sequential : 2;
|
||||||
mutable uint could_stat : 1;
|
mutable uint could_stat : 1;
|
||||||
mutable uint tried_stat : 1;
|
mutable uint tried_stat : 1;
|
||||||
#if !defined(Q_OS_WINCE)
|
|
||||||
mutable uint need_lstat : 1;
|
mutable uint need_lstat : 1;
|
||||||
mutable uint is_link : 1;
|
mutable uint is_link : 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
bool doStat(QFileSystemMetaData::MetaDataFlags flags = QFileSystemMetaData::PosixStatFlags) const;
|
bool doStat(QFileSystemMetaData::MetaDataFlags flags = QFileSystemMetaData::PosixStatFlags) const;
|
||||||
bool isSymlink() const;
|
bool isSymlink() const;
|
||||||
|
|
|
@ -118,19 +118,6 @@ class QProcessEnvironmentPrivate: public QSharedData
|
||||||
public:
|
public:
|
||||||
typedef QProcEnvKey Key;
|
typedef QProcEnvKey Key;
|
||||||
typedef QProcEnvValue Value;
|
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
|
inline Key prepareName(const QString &name) const
|
||||||
{
|
{
|
||||||
Key &ent = nameMap[name];
|
Key &ent = nameMap[name];
|
||||||
|
@ -177,17 +164,14 @@ public:
|
||||||
hash.detach();
|
hash.detach();
|
||||||
nameMap.detach();
|
nameMap.detach();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef QHash<Key, Value> Hash;
|
typedef QHash<Key, Value> Hash;
|
||||||
Hash hash;
|
Hash hash;
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
|
||||||
typedef QHash<QString, Key> NameHash;
|
typedef QHash<QString, Key> NameHash;
|
||||||
mutable NameHash nameMap;
|
mutable NameHash nameMap;
|
||||||
|
|
||||||
mutable QMutex mutex;
|
mutable QMutex mutex;
|
||||||
#endif
|
|
||||||
|
|
||||||
static QProcessEnvironment fromList(const QStringList &list);
|
static QProcessEnvironment fromList(const QStringList &list);
|
||||||
QStringList toList() const;
|
QStringList toList() const;
|
||||||
|
|
|
@ -292,18 +292,6 @@ QStringList QStandardPaths::locateAll(StandardLocation type, const QString &file
|
||||||
return result;
|
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)
|
static QString checkExecutable(const QString &path)
|
||||||
{
|
{
|
||||||
const QFileInfo info(path);
|
const QFileInfo info(path);
|
||||||
|
@ -327,30 +315,6 @@ static inline QString searchExecutable(const QStringList &searchPaths,
|
||||||
return QString();
|
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,
|
Finds the executable named \a executableName in the paths specified by \a paths,
|
||||||
or the system paths if \a paths is empty.
|
or the system paths if \a paths is empty.
|
||||||
|
@ -378,12 +342,8 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
|
||||||
|
|
||||||
QStringList searchPaths = paths;
|
QStringList searchPaths = paths;
|
||||||
if (paths.isEmpty()) {
|
if (paths.isEmpty()) {
|
||||||
QByteArray pEnv = qgetenv("PATH");
|
const QByteArray pEnv = qgetenv("PATH");
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
const QLatin1Char pathSep(';');
|
|
||||||
#else
|
|
||||||
const QLatin1Char pathSep(':');
|
const QLatin1Char pathSep(':');
|
||||||
#endif
|
|
||||||
// Remove trailing slashes, which occur on Windows.
|
// Remove trailing slashes, which occur on Windows.
|
||||||
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, QString::SkipEmptyParts);
|
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, QString::SkipEmptyParts);
|
||||||
searchPaths.reserve(rawPaths.size());
|
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);
|
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.
|
an empty QString if no relevant location can be found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(Q_OS_MAC)
|
|
||||||
QString QStandardPaths::displayName(StandardLocation type)
|
QString QStandardPaths::displayName(StandardLocation type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -461,7 +407,6 @@ QString QStandardPaths::displayName(StandardLocation type)
|
||||||
// not reached
|
// not reached
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,7 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
|
||||||
return;
|
return;
|
||||||
d->error = NoError;
|
d->error = NoError;
|
||||||
d->errorString = QString();
|
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
|
// optimization to not destroy/create the file & semaphore
|
||||||
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {
|
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {
|
||||||
d->initialValue = initialValue;
|
d->initialValue = initialValue;
|
||||||
|
|
|
@ -58,9 +58,8 @@
|
||||||
#ifndef QT_NO_SYSTEMSEMAPHORE
|
#ifndef QT_NO_SYSTEMSEMAPHORE
|
||||||
|
|
||||||
#include "qsharedmemory_p.h"
|
#include "qsharedmemory_p.h"
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
# include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
|
||||||
#ifdef QT_POSIX_IPC
|
#ifdef QT_POSIX_IPC
|
||||||
# include <semaphore.h>
|
# include <semaphore.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -78,10 +77,7 @@ public:
|
||||||
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
|
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#if defined(QT_POSIX_IPC)
|
||||||
HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
|
|
||||||
void setErrorString(const QString &function);
|
|
||||||
#elif defined(QT_POSIX_IPC)
|
|
||||||
bool handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
|
bool handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
|
||||||
void setErrorString(const QString &function);
|
void setErrorString(const QString &function);
|
||||||
#else
|
#else
|
||||||
|
@ -94,10 +90,7 @@ public:
|
||||||
QString key;
|
QString key;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
int initialValue;
|
int initialValue;
|
||||||
#ifdef Q_OS_WIN
|
#if defined(QT_POSIX_IPC)
|
||||||
HANDLE semaphore;
|
|
||||||
HANDLE semaphoreLock;
|
|
||||||
#elif defined(QT_POSIX_IPC)
|
|
||||||
sem_t *semaphore;
|
sem_t *semaphore;
|
||||||
bool createdSemaphore;
|
bool createdSemaphore;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -44,11 +44,6 @@
|
||||||
|
|
||||||
#include <QtCore/qlibrary.h>
|
#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
|
#ifndef QT_NO_LIBRARY
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
QT_BEGIN_HEADER
|
||||||
|
|
|
@ -254,13 +254,6 @@ bool removeGroupSeparators(QLocalePrivate::CharBuff *num)
|
||||||
return true;
|
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
|
* Copyright (c) 1992, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* 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 */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
|
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
|
||||||
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
|
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
|
||||||
defined(__powerpc__) || defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_MAC) || \
|
defined(__powerpc__) || defined(mips) || defined(Q_OS_AIX) || \
|
||||||
defined(mips) || defined(Q_OS_AIX) || defined(Q_OS_SOLARIS)
|
defined(Q_OS_SOLARIS)
|
||||||
# define IEEE_BIG_OR_LITTLE_ENDIAN 1
|
# define IEEE_BIG_OR_LITTLE_ENDIAN 1
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2253,14 +2246,6 @@ static int quorem(Bigint *b, Bigint *S)
|
||||||
* calculation.
|
* 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
|
/* This actually sometimes returns a pointer to a string literal
|
||||||
cast to a char*. Do NOT try to modify the return value. */
|
cast to a char*. Do NOT try to modify the return value. */
|
||||||
|
|
||||||
|
|
|
@ -58,18 +58,7 @@
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
#include "qendian.h"
|
#include "qendian.h"
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
|
#include "qfunctions_p.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 <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -4574,12 +4563,6 @@ int QString::localeAwareCompare(const QString &other) const
|
||||||
return localeAwareCompare_helper(constData(), length(), other.constData(), other.length());
|
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
|
\internal
|
||||||
\since 4.5
|
\since 4.5
|
||||||
|
@ -4591,50 +4574,19 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1,
|
||||||
if (length1 == 0 || length2 == 0)
|
if (length1 == 0 || length2 == 0)
|
||||||
return ucstrcmp(data1, length1, data2, length2);
|
return ucstrcmp(data1, length1, data2, length2);
|
||||||
|
|
||||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
#if defined(QT_USE_ICU)
|
||||||
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)
|
|
||||||
int res;
|
int res;
|
||||||
if (qt_ucol_strcoll(data1, length1, data2, length2, &res)) {
|
if (qt_ucol_strcoll(data1, length1, data2, length2, &res)) {
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
res = ucstrcmp(data1, length1, data2, length2);
|
res = ucstrcmp(data1, length1, data2, length2);
|
||||||
return res;
|
return res;
|
||||||
} // else fall through
|
} // else fall through
|
||||||
# endif
|
#endif
|
||||||
// declared in <string.h>
|
// declared in <string.h>
|
||||||
int delta = strcoll(toLocal8Bit_helper(data1, length1), toLocal8Bit_helper(data2, length2));
|
int delta = strcoll(toLocal8Bit_helper(data1, length1), toLocal8Bit_helper(data2, length2));
|
||||||
if (delta == 0)
|
if (delta == 0)
|
||||||
delta = ucstrcmp(data1, length1, data2, length2);
|
delta = ucstrcmp(data1, length1, data2, length2);
|
||||||
return delta;
|
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': {
|
case 'p': {
|
||||||
void *arg = va_arg(ap, void*);
|
void *arg = va_arg(ap, void*);
|
||||||
#ifdef Q_OS_WIN64
|
|
||||||
quint64 i = reinterpret_cast<quint64>(arg);
|
|
||||||
#else
|
|
||||||
quint64 i = reinterpret_cast<unsigned long>(arg);
|
quint64 i = reinterpret_cast<unsigned long>(arg);
|
||||||
#endif
|
|
||||||
flags |= QLocalePrivate::Alternate;
|
flags |= QLocalePrivate::Alternate;
|
||||||
subst = locale.d()->unsLongLongToString(i, precision, 16, width, flags);
|
subst = locale.d()->unsLongLongToString(i, precision, 16, width, flags);
|
||||||
++c;
|
++c;
|
||||||
|
|
Loading…
Add table
Reference in a new issue