Use new Q_STDLIB_UNICODE_STRINGS and Q_COMPILER_UNICODE_STRINGS
... instead of the combination with Q_OS_WIN we used so far. This patch adapts ocurrences that are new in 5.10. Change-Id: If392df481713e56c776c2326e0e02324a3a80c89 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
dc8bfab82e
commit
5311eb0d8e
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))> {};
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue