mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
fix asstaticfunction with nonbase virtuals
This commit is contained in:
parent
fbf33adc6a
commit
c9f41c784c
1 changed files with 7 additions and 4 deletions
|
@ -8,7 +8,7 @@ namespace geode::modifier {
|
|||
* A helper struct that generates a static function that calls the given function.
|
||||
*/
|
||||
#define GEODE_AS_STATIC_FUNCTION(FunctionName_) \
|
||||
template <class Class2, auto Function> \
|
||||
template <class Class2> \
|
||||
struct AsStaticFunction_##FunctionName_ { \
|
||||
template <class FunctionType2> \
|
||||
struct Impl {}; \
|
||||
|
@ -21,15 +21,18 @@ namespace geode::modifier {
|
|||
template <class Return, class Class, class... Params> \
|
||||
struct Impl<Return (Class::*)(Params...)> { \
|
||||
static Return GEODE_CDECL_CALL function(Class* self, Params... params) { \
|
||||
auto self2 = addresser::rthunkAdjust(Function, self); \
|
||||
log::info("adjusted, normal {}, {}", self2, self);\
|
||||
auto self2 = addresser::rthunkAdjust( \
|
||||
Resolve<Params...>::func(&Class2::FunctionName_), self \
|
||||
); \
|
||||
return self2->Class2::FunctionName_(params...); \
|
||||
} \
|
||||
}; \
|
||||
template <class Return, class Class, class... Params> \
|
||||
struct Impl<Return (Class::*)(Params...) const> { \
|
||||
static Return GEODE_CDECL_CALL function(Class const* self, Params... params) { \
|
||||
auto self2 = addresser::rthunkAdjust(Function, self); \
|
||||
auto self2 = addresser::rthunkAdjust( \
|
||||
Resolve<Params...>::func(&Class2::FunctionName_), self \
|
||||
); \
|
||||
return self2->Class2::FunctionName_(params...); \
|
||||
} \
|
||||
}; \
|
||||
|
|
Loading…
Reference in a new issue