summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-08-31 13:10:18 +0200
committerLiang Qi <liang.qi@qt.io>2017-08-31 14:31:31 +0200
commit112a4af10741409b3d8503cb77852a777b607ce0 (patch)
treefa99f0f37fc1505522fe9368e95484c7732ccda8 /src/corelib
parent29ef0d2bccd1874e20de94485ee05777c3a95c5d (diff)
parente938150412d22e61926fe16791158805b71268bb (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/corelib.pro10
-rw-r--r--src/corelib/global/qfloat16.h2
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/global/qnamespace.qdoc34
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp9
-rw-r--r--src/corelib/global/qoperatingsystemversion.h1
-rw-r--r--src/corelib/global/qrandom.cpp73
-rw-r--r--src/corelib/io/qfileinfo.cpp22
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp14
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp10
-rw-r--r--src/corelib/io/qprocess.cpp10
-rw-r--r--src/corelib/io/qprocess_unix.cpp12
-rw-r--r--src/corelib/kernel/qcore_mac_p.h3
-rw-r--r--src/corelib/thread/qthread_unix.cpp2
-rw-r--r--src/corelib/tools/qhash.cpp2
-rw-r--r--src/corelib/tools/qsimd_p.h3
-rw-r--r--src/corelib/tools/qstring.h2
17 files changed, 132 insertions, 81 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 376ef872ee..7f018bdb94 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -53,8 +53,10 @@ win32 {
# Override MinGW's definition in _mingw.h
DEFINES += WINVER=0x600 _WIN32_WINNT=0x0600
}
-
- !winrt: LIBS_PRIVATE += -lwinmm
+ LIBS_PRIVATE += -lws2_32
+ !winrt {
+ LIBS_PRIVATE += -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lwinmm
+ }
}
darwin {
@@ -66,7 +68,9 @@ darwin {
LIBS_PRIVATE += -framework Foundation
}
-QMAKE_LIBS += $$QMAKE_LIBS_CORE
+integrity {
+ LIBS_PRIVATE += -lposix -livfs -lsocket -lnet -lshm_client
+}
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 054d503249..89a62a93db 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -141,7 +141,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
#elif defined (__ARM_FP16_FORMAT_IEEE)
__fp16 f16;
memcpy(&f16, &b16, sizeof(quint16));
- return f16;
+ return float(f16);
#else
quint32 u = mantissatable[offsettable[b16 >> 10] + (b16 & 0x3ff)]
+ exponenttable[b16 >> 10];
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 33d7d58df4..f2f807e1d9 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2385,6 +2385,7 @@ Lollipop
Marshmallow
Nougat
Nougat
+Oreo
*/
static const char versions_string[] =
"\0"
@@ -2400,13 +2401,14 @@ Nougat
"Lollipop\0"
"Marshmallow\0"
"Nougat\0"
+ "Oreo\0"
"\0";
static const int versions_indices[] = {
0, 0, 0, 1, 9, 15, 15, 15,
22, 28, 28, 40, 40, 40, 50, 50,
69, 69, 69, 80, 80, 87, 87, 96,
- 108, 108, -1
+ 108, 108, 115, -1
};
static const int versions_count = (sizeof versions_indices) / (sizeof versions_indices[0]);
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 93f468f64b..e74ba4026a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -128,15 +128,13 @@
\value AA_PluginApplication Indicates that Qt is used to author a plugin. Depending
on the operating system, it suppresses specific initializations that do not
necessarily make sense in the plugin case.
- For example on OS X, this includes avoiding loading our nib for the main
+ For example on \macos, this includes avoiding loading our nib for the main
menu and not taking possession of the native menu bar. Setting this
attribute to true will also set the AA_DontUseNativeMenuBar attribute
to true. It also disables native event filters.
This attribute has been added in Qt 5.7. It must be set before
- \l {QGuiApplication}{Q(Gui)Application} is constructed.
+ \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
- \value AA_MacPluginApplication This attribute has been deprecated.
- Use AA_PluginApplication instead.
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
@@ -155,8 +153,6 @@
to be consistent in pixels-per-point across devices rather than
defining 1 point as 1/72 inch.
- \value AA_X11InitThreads This value is obsolete and has no effect.
-
\value AA_SynthesizeTouchForUnhandledMouseEvents All mouse events
that are not accepted by the application will be translated
to touch events instead.
@@ -179,12 +175,13 @@
\value AA_UseDesktopOpenGL Forces the usage of desktop OpenGL (for example,
\e opengl32.dll or \e libGL.so) on platforms that use dynamic loading
of the OpenGL implementation. This value has been added in Qt 5.3.
- This attribute must be set before Q(Gui)Application is constructed.
+ This attribute must be set before \l {QGuiApplication}
+ {Q\(Gui\)Application} is constructed.
\value AA_UseOpenGLES Forces the usage of OpenGL ES 2.0 or higher on
platforms that use dynamic loading of the OpenGL implementation.
This value has been added in Qt 5.3. This attribute must be set
- before Q(Gui)Application is constructed.
+ before \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
\value AA_UseSoftwareOpenGL Forces the usage of a software based OpenGL
implementation on platforms that use dynamic loading of the OpenGL
@@ -196,24 +193,25 @@
variable \e QT_OPENGL_DLL. See the platform-specific pages, for
instance \l{Qt for Windows}, for more information. This value has
been added in Qt 5.4. This attribute must be set before
- Q(Gui)Application is constructed.
+ \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
\value AA_ShareOpenGLContexts Enables resource sharing between the OpenGL
contexts used by classes like QOpenGLWidget and QQuickWidget. This
allows sharing OpenGL resources, like textures, between QOpenGLWidget
instances that belong to different top-level windows. This value has
been added in Qt 5.4. This attribute must be set before
- Q(Gui)Application is constructed.
+ \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
\value AA_SetPalette Indicates whether a palette was explicitly set on the
- QApplication/QGuiApplication. This value has been added in Qt 5.5.
+ \l {QGuiApplication}{Q\(Gui\)Application}. This value has been added
+ in Qt 5.5.
\value AA_EnableHighDpiScaling Enables high-DPI scaling in Qt on supported
platforms (see also \l{High DPI Displays}). Supported platforms are
X11, Windows and Android. Enabling makes Qt scale the main (device
independent) coordinate system according to display scale factors
provided by the operating system. This corresponds to setting the
- QT_AUTO_SCREEN_SCALE_FACTOR environment variable to 1. This value
+ QT_AUTO_SCREEN\unicode{0x200b}_SCALE_FACTOR environment variable to 1. This value
has been added in Qt 5.6. This attribute must be set before
Q(Gui)Application is constructed.
@@ -221,8 +219,9 @@
system coordinates. Note that the window system may do its own scaling,
so this does not guarantee that QPaintDevice::devicePixelRatio() will
be equal to 1. In addition, scale factors set by QT_SCALE_FACTOR will not
- be affected. This corresponds to setting the QT_AUTO_SCREEN_SCALE_FACTOR
- environment variable to 0. This value has been added in Qt 5.6. This
+ be affected. This corresponds to setting the
+ QT_AUTO_SCREEN\unicode{0x200b}_SCALE_FACTOR environment variable to 0.
+ This value has been added in Qt 5.6. This
attribute must be set before Q(Gui)Application is constructed.
\value AA_UseStyleSheetPropagationInWidgetStyles By default, Qt Style Sheets
@@ -281,7 +280,7 @@
This value has been added in Qt 5.10. For Qt 6, WindowContextHelpButtonHint
will not be set by default.
- The following values are obsolete:
+ The following values are deprecated or obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
supported in Qt 5. It ensures that widgets are created
@@ -293,9 +292,14 @@
Therefore, if it is important to minimize resource
consumption, do not set this attribute.
+ \value AA_MacPluginApplication This attribute has been deprecated.
+ Use AA_PluginApplication instead.
+
\value AA_MSWindowsUseDirect3DByDefault This value is obsolete and
has no effect.
+ \value AA_X11InitThreads This value is obsolete and has no effect.
+
\omitvalue AA_AttributeCount
*/
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index 83ba6e69ee..594dc6bc17 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -204,6 +204,7 @@ QOperatingSystemVersion QOperatingSystemVersion::current()
{ 6, 0 }, // API level 23
{ 7, 0 }, // API level 24
{ 7, 1 }, // API level 25
+ { 8, 0 }, // API level 26
};
// This will give us at least the first 2 version components
@@ -501,4 +502,12 @@ const QOperatingSystemVersion QOperatingSystemVersion::AndroidNougat =
const QOperatingSystemVersion QOperatingSystemVersion::AndroidNougat_MR1 =
QOperatingSystemVersion(QOperatingSystemVersion::Android, 7, 1);
+/*!
+ \variable QOperatingSystemVersion::AndroidOreo
+ \brief a version corresponding to Android Oreo (version 8.0, API level 26).
+ \since 5.9.2
+ */
+const QOperatingSystemVersion QOperatingSystemVersion::AndroidOreo =
+ QOperatingSystemVersion(QOperatingSystemVersion::Android, 8, 0);
+
QT_END_NAMESPACE
diff --git a/src/corelib/global/qoperatingsystemversion.h b/src/corelib/global/qoperatingsystemversion.h
index 2e319e66d5..1f3ff8e1ab 100644
--- a/src/corelib/global/qoperatingsystemversion.h
+++ b/src/corelib/global/qoperatingsystemversion.h
@@ -80,6 +80,7 @@ public:
static const QOperatingSystemVersion AndroidMarshmallow;
static const QOperatingSystemVersion AndroidNougat;
static const QOperatingSystemVersion AndroidNougat_MR1;
+ static const QOperatingSystemVersion AndroidOreo;
Q_DECL_CONSTEXPR QOperatingSystemVersion(OSType osType,
int vmajor, int vminor = -1, int vmicro = -1)
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index fb20f459b5..395bf0b0cb 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -918,15 +918,16 @@ void QRandomGenerator::fillRange_helper(void *buffer, void *bufferEnd)
fill(buffer, bufferEnd);
}
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
+Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
+
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
using SeedStorageType = QtPrivate::FunctionPointer<decltype(&srand)>::Arguments::Car;
typedef QThreadStorage<SeedStorageType *> SeedStorage;
Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
-#elif defined(Q_OS_ANDROID)
-typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
-Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
#endif
/*!
@@ -946,21 +947,7 @@ Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (!pseed)
- seedStorage->setLocalData(pseed = new SeedStorageType);
- *pseed = seed;
- } else {
- //global static seed storage should always exist,
- //except after being deleted by QGlobalStaticDeleter.
- //But since it still can be called from destructor of another
- //global static object, fallback to srand(seed)
- srand(seed);
- }
-#elif defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
if (randomTLS->hasLocalData()) {
randomTLS->localData().callMethod<void>("setSeed", "(J)V", jlong(seed));
return;
@@ -975,6 +962,20 @@ void qsrand(uint seed)
}
randomTLS->setLocalData(random);
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ SeedStorage *seedStorage = randTLS();
+ if (seedStorage) {
+ SeedStorageType *pseed = seedStorage->localData();
+ if (!pseed)
+ seedStorage->setLocalData(pseed = new SeedStorageType);
+ *pseed = seed;
+ } else {
+ //global static seed storage should always exist,
+ //except after being deleted by QGlobalStaticDeleter.
+ //But since it still can be called from destructor of another
+ //global static object, fallback to srand(seed)
+ srand(seed);
+ }
#else
// On Windows srand() and rand() already use Thread-Local-Storage
// to store the seed between calls
@@ -1002,23 +1003,7 @@ void qsrand(uint seed)
*/
int qrand()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (!pseed) {
- seedStorage->setLocalData(pseed = new SeedStorageType);
- *pseed = 1;
- }
- return rand_r(pseed);
- } else {
- //global static seed storage should always exist,
- //except after being deleted by QGlobalStaticDeleter.
- //But since it still can be called from destructor of another
- //global static object, fallback to rand()
- return rand();
- }
-#elif defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
AndroidRandomStorage *randomStorage = randomTLS();
if (!randomStorage)
return rand();
@@ -1038,6 +1023,22 @@ int qrand()
randomStorage->setLocalData(random);
return random.callMethod<jint>("nextInt", "(I)I", RAND_MAX);
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ SeedStorage *seedStorage = randTLS();
+ if (seedStorage) {
+ SeedStorageType *pseed = seedStorage->localData();
+ if (!pseed) {
+ seedStorage->setLocalData(pseed = new SeedStorageType);
+ *pseed = 1;
+ }
+ return rand_r(pseed);
+ } else {
+ //global static seed storage should always exist,
+ //except after being deleted by QGlobalStaticDeleter.
+ //But since it still can be called from destructor of another
+ //global static object, fallback to rand()
+ return rand();
+ }
#else
// On Windows srand() and rand() already use Thread-Local-Storage
// to store the seed between calls
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 235e391aa0..26078a6c71 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -870,12 +870,12 @@ QString QFileInfo::suffix() const
\b{Note:} The QDir returned always corresponds to the object's
parent directory, even if the QFileInfo represents a directory.
- For each of the following, dir() returns a QDir for
+ For each of the following, dir() returns the QDir
\c{"~/examples/191697"}.
\snippet fileinfo/main.cpp 0
- For each of the following, dir() returns a QDir for
+ For each of the following, dir() returns the QDir
\c{"."}.
\snippet fileinfo/main.cpp 1
@@ -1034,12 +1034,16 @@ bool QFileInfo::isBundle() const
}
/*!
- Returns \c true if this object points to a symbolic link (or to a
- shortcut on Windows); otherwise returns \c false.
+ Returns \c true if this object points to a symbolic link;
+ otherwise returns \c false.
- On Unix (including \macos and iOS), opening a symlink effectively opens
- the \l{symLinkTarget()}{link's target}. On Windows, it opens the \c
- .lnk file itself.
+ Symbolic links exist on Unix (including \macos and iOS) and Windows
+ and are typically created by the \c{ln -s} or \c{mklink} commands,
+ respectively. Opening a symbolic link effectively opens
+ the \l{symLinkTarget()}{link's target}.
+
+ In addition, true will be returned for shortcuts (\c *.lnk files) on
+ Windows. Opening those will open the \c .lnk file itself.
Example:
@@ -1090,8 +1094,8 @@ bool QFileInfo::isRoot() const
\fn QString QFileInfo::symLinkTarget() const
\since 4.2
- Returns the absolute path to the file or directory a symlink (or shortcut
- on Windows) points to, or a an empty string if the object isn't a symbolic
+ Returns the absolute path to the file or directory a symbolic link
+ points to, or an empty string if the object isn't a symbolic
link.
This name may not represent an existing file; it is only a string.
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 3f2bc04b9c..2828c85048 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -635,13 +635,11 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
ret += QFile::decodeName(s);
if (!ret.startsWith(QLatin1Char('/'))) {
- const QString linkFilePath = link.filePath();
- if (linkFilePath.startsWith(QLatin1Char('/'))) {
- ret.prepend(linkFilePath.leftRef(linkFilePath.lastIndexOf(QLatin1Char('/')))
- + QLatin1Char('/'));
- } else {
- ret.prepend(QDir::currentPath() + QLatin1Char('/'));
- }
+ const QString linkPath = link.path();
+ if (linkPath.startsWith(QLatin1Char('/')))
+ ret.prepend(linkPath + QLatin1Char('/'));
+ else
+ ret.prepend(QDir::currentPath() + QLatin1Char('/') + linkPath + QLatin1Char('/'));
}
ret = QDir::cleanPath(ret);
if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
@@ -853,7 +851,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
#if !defined(Q_OS_INTEGRITY)
struct group *gr = 0;
-#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS)
+#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
if (size_max == -1)
size_max = 1024;
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
index 3cfc6a254f..048669b92f 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
@@ -222,6 +222,14 @@ QT_END_NAMESPACE
#include <sys/inotify.h>
+// see https://github.com/android-ndk/ndk/issues/394
+# if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+static inline int inotify_init1(int flags)
+{
+ return syscall(__NR_inotify_init1, flags);
+}
+# endif
+
#endif
QT_BEGIN_NAMESPACE
@@ -229,7 +237,7 @@ QT_BEGIN_NAMESPACE
QInotifyFileSystemWatcherEngine *QInotifyFileSystemWatcherEngine::create(QObject *parent)
{
int fd = -1;
-#ifdef IN_CLOEXEC
+#if defined(IN_CLOEXEC)
fd = inotify_init1(IN_CLOEXEC);
#endif
if (fd == -1) {
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 1bb3362d5e..7ed319f5f1 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1024,7 +1024,8 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
if (readBytes == -1) {
setErrorAndEmit(QProcess::ReadError);
#if defined QPROCESS_DEBUG
- qDebug("QProcessPrivate::tryReadFromChannel(%d), failed to read from the process", channel - &stdinChannel);
+ qDebug("QProcessPrivate::tryReadFromChannel(%d), failed to read from the process",
+ int(channel - &stdinChannel));
#endif
return false;
}
@@ -1034,13 +1035,14 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
channel->notifier->setEnabled(false);
closeChannel(channel);
#if defined QPROCESS_DEBUG
- qDebug("QProcessPrivate::tryReadFromChannel(%d), 0 bytes available", channel - &stdinChannel);
+ qDebug("QProcessPrivate::tryReadFromChannel(%d), 0 bytes available",
+ int(channel - &stdinChannel));
#endif
return false;
}
#if defined QPROCESS_DEBUG
- qDebug("QProcessPrivate::tryReadFromChannel(%d), read %d bytes from the process' output", channel - &stdinChannel
- int(readBytes));
+ qDebug("QProcessPrivate::tryReadFromChannel(%d), read %d bytes from the process' output",
+ int(channel - &stdinChannel), int(readBytes));
#endif
if (channel->closed) {
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index cf9d38097a..15752f84b2 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -762,6 +762,10 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
if (qt_pollfd_check(poller.stdinPipe(), POLLOUT))
_q_canWrite();
+ // Signals triggered by I/O may have stopped this process:
+ if (processState == QProcess::NotRunning)
+ return false;
+
if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
if (_q_processDied())
return false;
@@ -808,6 +812,10 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
if (qt_pollfd_check(poller.stderrPipe(), POLLIN))
_q_canReadStandardError();
+ // Signals triggered by I/O may have stopped this process:
+ if (processState == QProcess::NotRunning)
+ return false;
+
if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
if (_q_processDied())
return false;
@@ -853,6 +861,10 @@ bool QProcessPrivate::waitForFinished(int msecs)
if (qt_pollfd_check(poller.stderrPipe(), POLLIN))
_q_canReadStandardError();
+ // Signals triggered by I/O may have stopped this process:
+ if (processState == QProcess::NotRunning)
+ return true;
+
if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
if (_q_processDied())
return true;
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 5be8df1a48..5522a617b3 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -129,7 +129,8 @@ public:
template <typename X> X as() const { return reinterpret_cast<X>(this->value); }
static QCFType constructFromGet(const T &t)
{
- CFRetain(t);
+ if (t)
+ CFRetain(t);
return QCFType<T>(t);
}
};
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index cddc4053b1..6540f02f34 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -105,7 +105,7 @@
# define SCHED_IDLE 5
#endif
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_ANDROID) && !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
#define QT_HAS_THREAD_PRIORITY_SCHEDULING
#endif
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 9d8c276cff..e336b7e618 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -140,7 +140,9 @@ static inline bool hasFastCrc32()
}
template <typename Char>
+#if defined(Q_PROCESSOR_ARM_64)
QT_FUNCTION_TARGET(CRC32)
+#endif
static uint crc32(const Char *ptr, size_t len, uint h)
{
// The crc32[whbd] instructions on Aarch64/Aarch32 calculate a 32-bit CRC32 checksum
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 3ef29f4823..181da4f7de 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -326,7 +326,10 @@
#endif
// AArch64/ARM64
#if defined(Q_PROCESSOR_ARM_V8) && defined(__ARM_FEATURE_CRC32)
+#if defined(Q_PROCESSOR_ARM_64)
+// only available on aarch64
#define QT_FUNCTION_TARGET_STRING_CRC32 "+crc"
+#endif
# include <arm_acle.h>
#endif
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index a3e100c568..16472ff6b9 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -56,7 +56,7 @@
#include <string>
#include <iterator>
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && !defined(ANDROID_HAS_WSTRING)
// std::wstring is disabled on android's glibc, as bionic lacks certain features
// that libstdc++ checks for (like mbcslen).
namespace std