summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-11-17 21:01:53 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-10-23 00:17:59 +0000
commit746fbbe03926b8741fefab846638c09603424063 (patch)
treee4805212bec3e8da79255ed25c32a336f7afca6f /src/corelib/global
parent45fe3f1cde1e516d1ddccddb5e33ea4316497c36 (diff)
Define QTypeInfo for char16_t, char32_t and wchar_t in Qt 5
Commits 0b700fb6f92662adaf632c6e83c12a3751c3174b and 0e4d94edd0caac9d2378a00a0aa961a0be3ad796 defined QTypeInfo for those three only for Qt 6 (and forced C++11 support). Define them in Qt 5, keeping compatibility with QList storage. That is, these types are defined to be primitive and static at the same time, for the benefit of QList. Change-Id: I9cac3a70af156971022c1e6084cb5538c050f826 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qtypeinfo.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index b42e5998fc..cd0a83ae80 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -276,13 +276,25 @@ Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
#endif
+
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
-// We can't do it now because it would break BC on QList<char32_t>
+// ### Qt 6: remove the other branch
+// This was required so that QList<T> for these types allocates out of the array storage
+# ifdef Q_COMPILER_UNICODE_STRINGS
Q_DECLARE_TYPEINFO(char16_t, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(char32_t, Q_PRIMITIVE_TYPE);
+# endif
# if !defined(Q_CC_MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
Q_DECLARE_TYPEINFO(wchar_t, Q_PRIMITIVE_TYPE);
# endif
+#else
+# ifdef Q_COMPILER_UNICODE_STRINGS
+Q_DECLARE_TYPEINFO(char16_t, Q_RELOCATABLE_TYPE);
+Q_DECLARE_TYPEINFO(char32_t, Q_RELOCATABLE_TYPE);
+# endif
+# if !defined(Q_CC_MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
+Q_DECLARE_TYPEINFO(wchar_t, Q_RELOCATABLE_TYPE);
+# endif
#endif // Qt 6
QT_END_NAMESPACE