mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -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 <cstdlib>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include "../utils/casts.hpp"
|
||||||
|
|
||||||
namespace geode::addresser {
|
namespace geode::addresser {
|
||||||
|
|
||||||
|
@ -201,7 +202,7 @@ namespace geode::addresser {
|
||||||
// do NOT delete the line below.
|
// do NOT delete the line below.
|
||||||
// doing so breaks thunk adjusting on windows.
|
// doing so breaks thunk adjusting on windows.
|
||||||
// why? bruh idk
|
// why? bruh idk
|
||||||
auto _ = *(ptrdiff_t*)(&func);
|
auto _ = *geode::cast::template union_cast<ptrdiff_t*>(&func);
|
||||||
return (F)((intptr_t)self + Addresser::thunkOf(func));
|
return (F)((intptr_t)self + Addresser::thunkOf(func));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +211,7 @@ namespace geode::addresser {
|
||||||
// do NOT delete the line below.
|
// do NOT delete the line below.
|
||||||
// doing so breaks thunk adjusting on windows.
|
// doing so breaks thunk adjusting on windows.
|
||||||
// why? bruh idk
|
// why? bruh idk
|
||||||
auto _ = *(ptrdiff_t*)(&func);
|
auto _ = *geode::cast::template union_cast<ptrdiff_t*>(&func);
|
||||||
return (F)((intptr_t)self - Addresser::thunkOf(func));
|
return (F)((intptr_t)self - Addresser::thunkOf(func));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue