2024-07-14 09:03:18 +00:00
|
|
|
#include "{{ headerPath }}"
|
2024-07-17 07:47:32 +00:00
|
|
|
#include "{{ data }}/function.cpp"
|
2024-07-14 09:03:18 +00:00
|
|
|
|
|
|
|
// Thunks
|
2024-07-17 07:47:32 +00:00
|
|
|
template <typename T>
|
|
|
|
struct __Thunk;
|
2024-07-14 09:03:18 +00:00
|
|
|
template <typename Ret, typename... Args>
|
|
|
|
struct __Thunk<Ret(Args...)> {
|
2024-07-16 17:46:20 +00:00
|
|
|
template <__Function<Ret(Args...)> *const *func>
|
2024-07-14 09:03:18 +00:00
|
|
|
static Ret call(Args... args) {
|
2024-07-16 17:46:20 +00:00
|
|
|
return (*func)->get_thunk_target()(std::forward<Args>(args)...);
|
2024-07-14 09:03:18 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-07-17 07:47:32 +00:00
|
|
|
{{ main }}
|
2024-07-14 09:03:18 +00:00
|
|
|
|
2024-07-17 07:47:32 +00:00
|
|
|
// Enable All Thunks
|
|
|
|
void enable_all_thunks(const thunk_enabler_t &thunk_enabler) {
|
|
|
|
{{ enableThunks }}
|
|
|
|
}
|