mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
fix reinterpret_cast problem of member function pointers on msvc compiler everyone hates msvc compiler
This commit is contained in:
parent
b8014bd898
commit
465348ae4c
1 changed files with 9 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "Types.hpp"
|
||||
#include <vector>
|
||||
#include <variant>
|
||||
#include <utils/convert.hpp>
|
||||
#include <utils/Result.hpp>
|
||||
#include "Log.hpp"
|
||||
#include "Mod.hpp"
|
||||
|
@ -125,7 +126,14 @@ namespace geode {
|
|||
template <typename T>
|
||||
inline void exportAPIFunction(std::string const& selector, T ptr) {
|
||||
if constexpr (std::is_member_function_pointer_v<decltype(ptr)>) {
|
||||
exportAPIFunctionInternal(selector, reinterpret_cast<unknownmemfn_t>(ptr));
|
||||
// why does this need reference cast
|
||||
// aaaaaaaa i hate you msvc
|
||||
// why did you need to make member function
|
||||
// pointers all different sizes everyone
|
||||
// hates you stop with this quirkiness
|
||||
// please i beg you im a cute girl
|
||||
// listen to me
|
||||
exportAPIFunctionInternal(selector, utils::reference_cast<unknownmemfn_t>(ptr));
|
||||
}
|
||||
else {
|
||||
exportAPIFunctionInternal(selector, reinterpret_cast<unknownfn_t>(ptr));
|
||||
|
|
Loading…
Reference in a new issue