From 0c5db4585da8977676d7f5f89e7f4377cb7303fd Mon Sep 17 00:00:00 2001 From: kleuter Date: Sun, 22 Nov 2020 13:08:30 +0100 Subject: [PATCH] 5.13.2: qcocoahelpers.h from 5.15.2 to enable arm64 on mac --- .../src/plugins/platforms/cocoa/qcocoahelpers.h | 15 +++++++-------- .../src/plugins/platforms/cocoa/qcocoahelpers.mm | 4 ---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h index 8dc642b..e74c7c6 100644 --- a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -188,14 +188,6 @@ struct backwards_t { template constexpr backwards_t backwards(R&& r) { return {std::forward(r)}; } -// ------------------------------------------------------------------------- - -#if !defined(Q_PROCESSOR_X86_64) -#error "32-bit builds are not supported" -#endif - -// ------------------------------------------------------------------------- - QT_END_NAMESPACE // @compatibility_alias doesn't work with protocols @@ -246,12 +238,15 @@ template struct objc_msgsend_requires_stret { static const bool value = #if defined(Q_PROCESSOR_X86) + #define PLATFORM_USES_SEND_SUPER_STRET 1 // Any return value larger than two registers on i386/x86_64 sizeof(T) > sizeof(void*) * 2; #elif defined(Q_PROCESSOR_ARM_32) + #define PLATFORM_USES_SEND_SUPER_STRET 1 // Any return value larger than a single register on arm sizeof(T) > sizeof(void*); #elif defined(Q_PROCESSOR_ARM_64) + #define PLATFORM_USES_SEND_SUPER_STRET 0 // Stret not used on arm64 false; #endif @@ -273,6 +268,7 @@ ReturnType qt_msgSendSuper(id receiver, SEL selector, Args... args) return superFn(&sup, selector, args...); } +#if PLATFORM_USES_SEND_SUPER_STRET template ReturnType qt_msgSendSuper_stret(id receiver, SEL selector, Args... args) { @@ -287,6 +283,7 @@ ReturnType qt_msgSendSuper_stret(id receiver, SEL selector, Args... args) superStretFn(&ret, &sup, selector, args...); return ret; } +#endif template class QSendSuperHelper { @@ -327,11 +324,13 @@ private: return qt_msgSendSuper(m_receiver, m_selector, std::get(args)...); } +#if PLATFORM_USES_SEND_SUPER_STRET template if_requires_stret msgSendSuper(std::tuple& args, QtPrivate::IndexesList) { return qt_msgSendSuper_stret(m_receiver, m_selector, std::get(args)...); } +#endif template ReturnType msgSendSuper(std::tuple& args) diff --git a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm index 53ea8bc..dfffe96 100644 --- a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -369,10 +369,6 @@ QString qt_mac_removeAmpersandEscapes(QString s) // ------------------------------------------------------------------------- -#if !defined(Q_PROCESSOR_X86_64) -#error "32-bit builds are not supported" -#endif - QT_END_NAMESPACE /*! \internal