diff --git a/core/sourcehook/generate/sourcehook.hxx b/core/sourcehook/generate/sourcehook.hxx index e708f12b..29db9fc8 100755 --- a/core/sourcehook/generate/sourcehook.hxx +++ b/core/sourcehook/generate/sourcehook.hxx @@ -907,7 +907,10 @@ SourceHook::CallClass *SH_GET_CALLCLASS(T *p) /* patch mfp */ \ *reinterpret_cast(&mfp) = *reinterpret_cast(vfnptr); \ if (sizeof(mfp) == 2*sizeof(void*)) /* gcc */ \ - *(reinterpret_cast(&mfp) + 1) = 0; \ + { \ + void** pleaseShutUpMsvc = reinterpret_cast(&mfp); \ + pleaseShutUpMsvc[1] = 0; \ + } \ return SH_MFHCls(hookname)::CallEC(reinterpret_cast< ::SourceHook::EmptyClass* >(ptr), mfp, vfnptr, SH_GLOB_SHPTR); \ } \ void __SourceHook_FHM_Reconfigure##hookname(int p_vtblindex, int p_vtbloffs, int p_thisptroffs) \ diff --git a/core/sourcehook/sourcehook.h b/core/sourcehook/sourcehook.h index f562bc23..faf5b24c 100644 --- a/core/sourcehook/sourcehook.h +++ b/core/sourcehook/sourcehook.h @@ -907,7 +907,10 @@ SourceHook::CallClass *SH_GET_CALLCLASS(T *p) /* patch mfp */ \ *reinterpret_cast(&mfp) = *reinterpret_cast(vfnptr); \ if (sizeof(mfp) == 2*sizeof(void*)) /* gcc */ \ - *(reinterpret_cast(&mfp) + 1) = 0; \ + { \ + void** pleaseShutUpMsvc = reinterpret_cast(&mfp); \ + pleaseShutUpMsvc[1] = 0; \ + } \ return SH_MFHCls(hookname)::CallEC(reinterpret_cast< ::SourceHook::EmptyClass* >(ptr), mfp, vfnptr, SH_GLOB_SHPTR); \ } \ void __SourceHook_FHM_Reconfigure##hookname(int p_vtblindex, int p_vtbloffs, int p_thisptroffs) \