summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoahelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoahelpers.h')
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.h12
1 files changed, 9 insertions, 3 deletions
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 <typename T>
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 <typename ReturnType, typename... Args>
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<typename... Args>
class QSendSuperHelper {
@@ -350,11 +354,13 @@ private:
return qt_msgSendSuper<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...);
}
+#if PLATFORM_USES_SEND_SUPER_STRET
template <typename ReturnType, int... Is>
if_requires_stret<ReturnType, true> msgSendSuper(std::tuple<Args...>& args, QtPrivate::IndexesList<Is...>)
{
return qt_msgSendSuper_stret<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...);
}
+#endif
template <typename ReturnType>
ReturnType msgSendSuper(std::tuple<Args...>& args)