summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-06-19 13:25:11 +0200
committerLiang Qi <liang.qi@qt.io>2017-06-19 16:12:34 +0200
commitce09ef431373f45d14ce0a6e7de24aee3666093d (patch)
tree7c998b21f02db55e233e7eeb1599663f1c6b51ca /src/corelib/tools
parent7ad55ca65f42351e231f31f7a9253ae6eaf1ebb3 (diff)
parent97eec16e4ff6367c233f8ea6c4a343c286c3a514 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qbytearray.h2
-rw-r--r--src/corelib/tools/qcollator.cpp2
-rw-r--r--src/corelib/tools/qcollator_macx.cpp2
-rw-r--r--src/corelib/tools/qsimd.cpp8
-rw-r--r--src/corelib/tools/qsimd_p.h6
-rw-r--r--src/corelib/tools/qstring.h2
-rw-r--r--src/corelib/tools/qtimezone.cpp8
7 files changed, 22 insertions, 8 deletions
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 144216a6ef..32f4817ce6 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -249,7 +249,7 @@ public:
void chop(int n);
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC)
-# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
+# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !QT_HAS_CPP_ATTRIBUTE(nodiscard)
// required due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941
# pragma push_macro("Q_REQUIRED_RESULT")
# undef Q_REQUIRED_RESULT
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index e34d16079f..f1e3d6652d 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -254,7 +254,7 @@ bool QCollator::numericMode() const
The default is locale dependent.
- \note This method is not currently supported on Apple platforms or if Qt is configured to not use ICU on Linux.
+ \note This method is not currently supported if Qt is configured to not use ICU on Linux.
\sa ignorePunctuation()
*/
diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp
index d468272430..9aa59a81dc 100644
--- a/src/corelib/tools/qcollator_macx.cpp
+++ b/src/corelib/tools/qcollator_macx.cpp
@@ -66,7 +66,7 @@ void QCollatorPrivate::init()
options |= kUCCollateCaseInsensitiveMask;
if (numericMode)
options |= kUCCollateDigitsAsNumberMask | kUCCollateDigitsOverrideMask;
- if (ignorePunctuation)
+ if (!ignorePunctuation)
options |= kUCCollatePunctuationSignificantMask;
OSStatus status = UCCreateCollator(
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index d4edf459de..4c6f08c774 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -721,6 +721,14 @@ void qDumpCPUFeatures()
printf("%s%s", features_string + features_indices[i],
minFeature & (Q_UINT64_C(1) << i) ? "[required]" : "");
}
+ if ((features = (qCompilerCpuFeatures & ~features))) {
+ printf("\n!!!!!!!!!!!!!!!!!!!!\n!!! Missing required features:");
+ for (int i = 0; i < features_count; ++i) {
+ if (features & (Q_UINT64_C(1) << i))
+ printf("%s", features_string + features_indices[i]);
+ }
+ printf("\n!!! Applications will likely crash with \"Invalid Instruction\"\n!!!!!!!!!!!!!!!!!!!!");
+ }
puts("");
}
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 44f6f1cc91..3ef29f4823 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -232,7 +232,7 @@
#if defined(__SSE4_2__) || (defined(QT_COMPILER_SUPPORTS_SSE4_2) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS))
#include <nmmintrin.h>
-# if defined(__SSE4_2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)
+# if defined(__SSE4_2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC))
// POPCNT instructions:
// All processors that support SSE4.2 support POPCNT
// (but neither MSVC nor the Intel compiler define this macro)
@@ -245,7 +245,7 @@
// immintrin.h is the ultimate header, we don't need anything else after this
#include <immintrin.h>
-# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)
+# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC))
// AES, PCLMULQDQ instructions:
// All processors that support AVX support AES, PCLMULQDQ
// (but neither MSVC nor the Intel compiler define these macros)
@@ -253,7 +253,7 @@
# define __PCLMUL__ 1
# endif
-# if defined(__AVX2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)
+# if defined(__AVX2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC))
// F16C & RDRAND instructions:
// All processors that support AVX2 support F16C & RDRAND:
// (but neither MSVC nor the Intel compiler define these macros)
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index d5301a396f..9d87cd1077 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -407,7 +407,7 @@ public:
Q_REQUIRED_RESULT QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const;
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC)
-# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
+# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !QT_HAS_CPP_ATTRIBUTE(nodiscard)
// required due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941
# pragma push_macro("Q_REQUIRED_RESULT")
# undef Q_REQUIRED_RESULT
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index 0b331be503..6a26993549 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -958,7 +958,13 @@ QDataStream &operator>>(QDataStream &ds, QTimeZone &tz)
int country;
QString comment;
ds >> ianaId >> utcOffset >> name >> abbreviation >> country >> comment;
- tz = QTimeZone(ianaId.toUtf8(), utcOffset, name, abbreviation, (QLocale::Country) country, comment);
+ // Try creating as a system timezone, which succeeds (producing a valid
+ // zone) iff ianaId is valid; we can then ignore the other data.
+ tz = QTimeZone(ianaId.toUtf8());
+ // If not, then construct a custom timezone using all the saved values:
+ if (!tz.isValid())
+ tz = QTimeZone(ianaId.toUtf8(), utcOffset, name, abbreviation,
+ QLocale::Country(country), comment);
} else {
tz = QTimeZone(ianaId.toUtf8());
}