5.13.2: qcocoahelpers.h from 5.15.2 to enable arm64 on mac

This commit is contained in:
kleuter 2020-11-22 13:08:30 +01:00
parent a599890848
commit 0c5db4585d
2 changed files with 7 additions and 12 deletions

View File

@ -188,14 +188,6 @@ struct backwards_t {
template<class R> template<class R>
constexpr backwards_t<R> backwards(R&& r) { return {std::forward<R>(r)}; } constexpr backwards_t<R> backwards(R&& r) { return {std::forward<R>(r)}; }
// -------------------------------------------------------------------------
#if !defined(Q_PROCESSOR_X86_64)
#error "32-bit builds are not supported"
#endif
// -------------------------------------------------------------------------
QT_END_NAMESPACE QT_END_NAMESPACE
// @compatibility_alias doesn't work with protocols // @compatibility_alias doesn't work with protocols
@ -246,12 +238,15 @@ template <typename T>
struct objc_msgsend_requires_stret struct objc_msgsend_requires_stret
{ static const bool value = { static const bool value =
#if defined(Q_PROCESSOR_X86) #if defined(Q_PROCESSOR_X86)
#define PLATFORM_USES_SEND_SUPER_STRET 1
// Any return value larger than two registers on i386/x86_64 // Any return value larger than two registers on i386/x86_64
sizeof(T) > sizeof(void*) * 2; sizeof(T) > sizeof(void*) * 2;
#elif defined(Q_PROCESSOR_ARM_32) #elif defined(Q_PROCESSOR_ARM_32)
#define PLATFORM_USES_SEND_SUPER_STRET 1
// Any return value larger than a single register on arm // Any return value larger than a single register on arm
sizeof(T) > sizeof(void*); sizeof(T) > sizeof(void*);
#elif defined(Q_PROCESSOR_ARM_64) #elif defined(Q_PROCESSOR_ARM_64)
#define PLATFORM_USES_SEND_SUPER_STRET 0
// Stret not used on arm64 // Stret not used on arm64
false; false;
#endif #endif
@ -273,6 +268,7 @@ ReturnType qt_msgSendSuper(id receiver, SEL selector, Args... args)
return superFn(&sup, selector, args...); return superFn(&sup, selector, args...);
} }
#if PLATFORM_USES_SEND_SUPER_STRET
template <typename ReturnType, typename... Args> template <typename ReturnType, typename... Args>
ReturnType qt_msgSendSuper_stret(id receiver, SEL selector, Args... args) 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...); superStretFn(&ret, &sup, selector, args...);
return ret; return ret;
} }
#endif
template<typename... Args> template<typename... Args>
class QSendSuperHelper { class QSendSuperHelper {
@ -327,11 +324,13 @@ private:
return qt_msgSendSuper<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...); return qt_msgSendSuper<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...);
} }
#if PLATFORM_USES_SEND_SUPER_STRET
template <typename ReturnType, int... Is> template <typename ReturnType, int... Is>
if_requires_stret<ReturnType, true> msgSendSuper(std::tuple<Args...>& args, QtPrivate::IndexesList<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)...); return qt_msgSendSuper_stret<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...);
} }
#endif
template <typename ReturnType> template <typename ReturnType>
ReturnType msgSendSuper(std::tuple<Args...>& args) ReturnType msgSendSuper(std::tuple<Args...>& args)

View File

@ -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 QT_END_NAMESPACE
/*! \internal /*! \internal