From 126c4eae84fee0e5bc4e9c6db167d92e87b7f612 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 30 Mar 2017 19:49:32 +0200 Subject: Split Q_COMPILER_UNICODE_STRINGS: add Q_STDLIB_UNICODE_STRINGS Since commit bf2160e72cd8840a8e604438cbdc807483ac980a, we can rely on charNN_t support in all compilers except MSVC 2013, and since that commit, we use (in 5.10, not 5.9, yet) !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS) when we only need charNN_t, the type, as opposed to its library support (u16string, char_traits, ...). This patch splits the Q_C_UNICODE_STRINGS macro into two, adding Q_STDLIB_UNICODE_STRINGS for when we need std::uNNstring, leaving Q_C_UNICODE_STRINGS for when we need just charNN_t support. In QDebug, when constructing a QChar out of a char16_t, cast to ushort first, since QChar(char16_t) was only officially introduced in Qt 5.10. [ChangeLog][Potentially Source-Incompatible Changes] The internal Q_COMPILER_UNICODE_STRINGS macro is now defined if the compiler supports charNN_t, even if the standard library does not. To check for availability of std::uNNstring, use the new Q_STDLIB_UNICODE_STRINGS macro. Change-Id: I8f210fd7f1799fe21faf54506475a759b1f76a59 Reviewed-by: Thiago Macieira --- doc/global/qt-cpp-defines.qdocconf | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/global/qt-cpp-defines.qdocconf') diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf index 5068ae8be8..957bf1cc4f 100644 --- a/doc/global/qt-cpp-defines.qdocconf +++ b/doc/global/qt-cpp-defines.qdocconf @@ -14,6 +14,7 @@ defines += Q_QDOC \ QT_DEPRECATED_* \ Q_NO_USING_KEYWORD \ __cplusplus \ + Q_STDLIB_UNICODE_STRINGS \ Q_COMPILER_INITIALIZER_LISTS \ Q_COMPILER_UNICODE_STRINGS \ Q_COMPILER_UNIFORM_INIT \ @@ -57,6 +58,7 @@ clangdefines += __cplusplus \ Q_COMPILER_UNICODE_STRINGS \ Q_COMPILER_VARIADIC_MACROS \ Q_COMPILER_VARIADIC_TEMPLATES \ + Q_STDLIB_UNICODE_STRINGS \ Q_ATOMIC_INT16_IS_SUPPORTED \ Q_ATOMIC_INT64_IS_SUPPORTED \ Q_ATOMIC_INT8_IS_SUPPORTED \ -- cgit v1.2.3