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. Task-number: QTBUG-85279 Change-Id: Iac94f59a863c7be1860b51def0fc2de2d8812cf8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit b10f8ba3506c6c8c941826aee0225192aa4cd1af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d6bda220f7
commit
1184b79381
@ -254,14 +254,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
|
||||
};
|
||||
|
||||
@ -281,6 +283,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)
|
||||
{
|
||||
@ -295,6 +298,7 @@ ReturnType qt_msgSendSuper_stret(id receiver, SEL selector, Args... args)
|
||||
superStretFn(&ret, &sup, selector, args...);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename... Args>
|
||||
class QSendSuperHelper {
|
||||
@ -335,11 +339,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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user