summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qchar.h2
-rw-r--r--src/corelib/tools/qstringview.h2
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringview/tst_qstringview.cpp8
4 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index a1d31f6a68..53cb8993fb 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -86,7 +86,7 @@ public:
Q_DECL_CONSTEXPR QChar(int rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
Q_DECL_CONSTEXPR QChar(SpecialCharacter s) Q_DECL_NOTHROW : ucs(ushort(s)) {} // implicit
Q_DECL_CONSTEXPR QChar(QLatin1Char ch) Q_DECL_NOTHROW : ucs(ch.unicode()) {} // implicit
-#if !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS)
+#if defined(Q_COMPILER_UNICODE_STRINGS)
Q_DECL_CONSTEXPR QChar(char16_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
#endif
#if defined(Q_OS_WIN)
diff --git a/src/corelib/tools/qstringview.h b/src/corelib/tools/qstringview.h
index 64d3aa2266..169a30ba69 100644
--- a/src/corelib/tools/qstringview.h
+++ b/src/corelib/tools/qstringview.h
@@ -61,7 +61,7 @@ struct IsCompatibleCharTypeHelper
: std::integral_constant<bool,
std::is_same<Char, QChar>::value ||
std::is_same<Char, ushort>::value ||
-#if !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS)
+#if defined(Q_COMPILER_UNICODE_STRINGS)
std::is_same<Char, char16_t>::value ||
#endif
(std::is_same<Char, wchar_t>::value && sizeof(wchar_t) == sizeof(QChar))> {};
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index 76309d914b..cf4f6d21e2 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -79,7 +79,7 @@ QT_WARNING_DISABLE_DEPRECATED
void tst_QChar::fromChar16_t()
{
-#if !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS)
+#if defined(Q_COMPILER_UNICODE_STRINGS)
QChar aUmlaut = u'\u00E4'; // German small letter a-umlaut
QCOMPARE(aUmlaut, QChar(0xE4));
QChar replacementCharacter = u'\uFFFD';
diff --git a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp b/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
index 1ca56406d4..9849bd78da 100644
--- a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
+++ b/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
@@ -87,7 +87,7 @@ Q_STATIC_ASSERT(CanConvert<const ushort*>::value);
// char16_t
//
-#if !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS)
+#if defined(Q_COMPILER_UNICODE_STRINGS)
Q_STATIC_ASSERT(!CanConvert<char16_t>::value);
@@ -96,7 +96,7 @@ Q_STATIC_ASSERT(CanConvert<const char16_t*>::value);
#endif
-#ifdef Q_COMPILER_UNICODE_STRINGS
+#if defined(Q_STDLIB_UNICODE_STRINGS)
Q_STATIC_ASSERT(CanConvert< std::u16string >::value);
Q_STATIC_ASSERT(CanConvert<const std::u16string >::value);
@@ -155,7 +155,7 @@ private Q_SLOTS:
void fromChar16TStar() const
{
-#if !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS)
+#if defined(Q_COMPILER_UNICODE_STRINGS)
fromLiteral(u"Hello, World!");
#else
QSKIP("This test requires C++11 char16_t support enabled in the compiler");
@@ -182,7 +182,7 @@ private Q_SLOTS:
}
void fromStdStringChar16T() const
{
-#ifdef Q_COMPILER_UNICODE_STRINGS
+#ifdef Q_STDLIB_UNICODE_STRINGS
fromStdString<char16_t>();
#else
QSKIP("This test requires C++11 char16_t support enabled in compiler & stdlib");