mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-26 17:36:05 -05:00
whoops turns out union cast is required to make it work
This commit is contained in:
parent
e65f1184e7
commit
9e52089a01
1 changed files with 3 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <cstdlib>
|
||||
#include <stddef.h>
|
||||
#include <type_traits>
|
||||
#include "../utils/casts.hpp"
|
||||
|
||||
namespace geode::addresser {
|
||||
|
||||
|
@ -201,7 +202,7 @@ namespace geode::addresser {
|
|||
// do NOT delete the line below.
|
||||
// doing so breaks thunk adjusting on windows.
|
||||
// why? bruh idk
|
||||
auto _ = *(ptrdiff_t*)(&func);
|
||||
auto _ = *geode::cast::template union_cast<ptrdiff_t*>(&func);
|
||||
return (F)((intptr_t)self + Addresser::thunkOf(func));
|
||||
}
|
||||
|
||||
|
@ -210,7 +211,7 @@ namespace geode::addresser {
|
|||
// do NOT delete the line below.
|
||||
// doing so breaks thunk adjusting on windows.
|
||||
// why? bruh idk
|
||||
auto _ = *(ptrdiff_t*)(&func);
|
||||
auto _ = *geode::cast::template union_cast<ptrdiff_t*>(&func);
|
||||
return (F)((intptr_t)self - Addresser::thunkOf(func));
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue