diff --git a/loader/include/Geode/platform/platform.hpp b/loader/include/Geode/platform/platform.hpp index afca28da..b4c5bf71 100644 --- a/loader/include/Geode/platform/platform.hpp +++ b/loader/include/Geode/platform/platform.hpp @@ -242,3 +242,13 @@ namespace std { #elif defined(GEODE_IS_ANDROID64) #define GEODE_PLATFORM_TARGET PlatformID::Android64 #endif + +// this is cross-platform so not duplicating it across the typeinfo_cast definitions +namespace geode::cast { + template + std::shared_ptr typeinfo_pointer_cast(std::shared_ptr const& r) noexcept { + // https://en.cppreference.com/w/cpp/memory/shared_ptr/pointer_cast + auto p = typeinfo_cast::element_type*>(r.get()); + return std::shared_ptr(r, p); + } +} diff --git a/loader/include/Geode/platform/windows.hpp b/loader/include/Geode/platform/windows.hpp index 374e0e1e..ee22e0d3 100644 --- a/loader/include/Geode/platform/windows.hpp +++ b/loader/include/Geode/platform/windows.hpp @@ -130,11 +130,4 @@ namespace geode::cast { return nullptr; } - - template - std::shared_ptr typeinfo_pointer_cast(std::shared_ptr const& r) noexcept { - // https://en.cppreference.com/w/cpp/memory/shared_ptr/pointer_cast - auto p = typeinfo_cast::element_type*>(r.get()); - return std::shared_ptr(r, p); - } }