From 56723c6e913498b96c0c814611c46bfcbd262e67 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 21 Feb 2017 16:03:34 +0000 Subject: [PATCH] QTypeInfo: make long double primitive in Qt 6 on Darwin I don't know the historical reasons for that, but C++11 mandates long double as a type. On Darwin this means that long double was a complex type, so the best for now is to mark it relocatable. Change-Id: Ic933947a282ad963d5d0168c2768cc98fdd456bc Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/corelib/global/qtypeinfo.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 53f6b3fff6..d197c8d384 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -304,14 +304,11 @@ Q_DECLARE_TYPEINFO(qint64, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(quint64, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE); -#ifndef Q_OS_DARWIN -Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); -#endif - #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) // ### Qt 6: remove the other branch // This was required so that QList for these types allocates out of the array storage +Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); # ifdef Q_COMPILER_UNICODE_STRINGS Q_DECLARE_TYPEINFO(char16_t, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(char32_t, Q_PRIMITIVE_TYPE); @@ -320,6 +317,11 @@ Q_DECLARE_TYPEINFO(char32_t, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(wchar_t, Q_PRIMITIVE_TYPE); # endif #else +# ifndef Q_OS_DARWIN +Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); +# else +Q_DECLARE_TYPEINFO(long double, Q_RELOCATABLE_TYPE); +# endif # ifdef Q_COMPILER_UNICODE_STRINGS Q_DECLARE_TYPEINFO(char16_t, Q_RELOCATABLE_TYPE); Q_DECLARE_TYPEINFO(char32_t, Q_RELOCATABLE_TYPE);