From b10f8ba3506c6c8c941826aee0225192aa4cd1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 8 Jul 2020 13:52:36 +0200 Subject: macOS: Don't assume platform has objc_msgSendSuper_stret It's not used on arm64, and the template magic is not enough to avoid compilation failures due to references to the undefined function. Pick-to: 5.15 Pick-to: 5.12 Task-number: QTBUG-85279 Change-Id: Iac94f59a863c7be1860b51def0fc2de2d8812cf8 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoahelpers.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/cocoa/qcocoahelpers.h') diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index 2e84abd739..bb187c9fa7 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -269,14 +269,16 @@ 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*); + sizeof(T) > sizeof(void*); #elif defined(Q_PROCESSOR_ARM_64) - // Stret not used on arm64 - false; + #define PLATFORM_USES_SEND_SUPER_STRET 0 + false; // Stret not used on arm64 #endif }; @@ -296,6 +298,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) { @@ -310,6 +313,7 @@ ReturnType qt_msgSendSuper_stret(id receiver, SEL selector, Args... args) superStretFn(&ret, &sup, selector, args...); return ret; } +#endif template class QSendSuperHelper { @@ -350,11 +354,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) -- cgit v1.2.3