add check for gd version in DynamicCastFix.cpp

prevents silently breaking macos
This commit is contained in:
mat 2024-11-13 10:41:13 -03:00 committed by GitHub
parent 37fb2a3ddf
commit 1af10eea7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,10 @@ $execute {
// this is needed because the transitions in cocos uses dynamic cast to check // this is needed because the transitions in cocos uses dynamic cast to check
// layers, which fail on user layers due to typeinfo not matching // layers, which fail on user layers due to typeinfo not matching
#if defined(GEODE_IS_MAC) && GEODE_COMP_GD_VERSION != 22074
#error "Unsupported version for macOS dynamic cast fix, please update the addresses"
#endif
#if defined(GEODE_IS_INTEL_MAC) #if defined(GEODE_IS_INTEL_MAC)
void* dynamicCastAddr = reinterpret_cast<void*>(base::get() + 0x7ba1d8); void* dynamicCastAddr = reinterpret_cast<void*>(base::get() + 0x7ba1d8);
(void) Mod::get()->hook(dynamicCastAddr, &cast::typeinfoCastInternal, "__dynamic_cast"); (void) Mod::get()->hook(dynamicCastAddr, &cast::typeinfoCastInternal, "__dynamic_cast");