mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-11 14:19:10 +00:00
core: Introduce host call wrapper. (#2913)
This commit is contained in:
@@ -58,4 +58,16 @@ ReturnType ExecuteGuest(PS4_SYSV_ABI ReturnType (*func)(FuncArgs...), CallArgs&&
|
||||
return func(std::forward<CallArgs>(args)...);
|
||||
}
|
||||
|
||||
template <class F, F f>
|
||||
struct HostCallWrapperImpl;
|
||||
|
||||
template <class ReturnType, class... Args, PS4_SYSV_ABI ReturnType (*func)(Args...)>
|
||||
struct HostCallWrapperImpl<PS4_SYSV_ABI ReturnType (*)(Args...), func> {
|
||||
static ReturnType PS4_SYSV_ABI wrap(Args... args) {
|
||||
return func(args...);
|
||||
}
|
||||
};
|
||||
|
||||
#define HOST_CALL(func) (Core::HostCallWrapperImpl<decltype(&(func)), func>::wrap)
|
||||
|
||||
} // namespace Core
|
||||
|
||||
Reference in New Issue
Block a user