1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

Disable built_function on __APPLE__

Workaround for #11287
This commit is contained in:
Nekotekina 2021-12-24 17:37:28 +03:00
parent 599e00d6da
commit d36a715b24

View File

@ -198,6 +198,35 @@ inline FT build_function_asm(F&& builder)
return result;
}
#ifdef __APPLE__
template <typename FT, usz = 4096>
class built_function
{
FT m_func;
public:
built_function(const built_function&) = delete;
built_function& operator=(const built_function&) = delete;
template <typename F>
built_function(F&& builder)
: m_func(ensure(build_function_asm<FT>(std::forward<F>(builder))))
{
}
operator FT() const noexcept
{
return m_func;
}
template <typename... Args>
auto operator()(Args&&... args) const noexcept
{
return m_func(std::forward<Args>(args)...);
}
};
#else
template <typename FT, usz Size = 4096>
class built_function
{
@ -254,6 +283,7 @@ public:
return FT(+m_data)(std::forward<Args>(args)...);
}
};
#endif
#ifdef LLVM_AVAILABLE