From 26f8862cac14180d0d09ddd507dfebcece0a35ae Mon Sep 17 00:00:00 2001 From: HappyDOGE <28511119+HappyDOGE@users.noreply.github.com> Date: Thu, 28 Jul 2022 15:39:35 +0300 Subject: [PATCH] copy correct check --- game/server/baseentity.h | 48 ++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/game/server/baseentity.h b/game/server/baseentity.h index e0815922..70502fbc 100644 --- a/game/server/baseentity.h +++ b/game/server/baseentity.h @@ -1108,10 +1108,20 @@ public: ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name ) { -#if defined(GNUC) || defined(PLATFORM_WINDOWS_PC64) - COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#ifdef _DEBUG +#ifdef PLATFORM_64BITS +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 16 ); +#else + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#endif +#else +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); #else - COMPILE_TIME_ASSERT( sizeof(func) == 4 ); + COMPILE_TIME_ASSERT( sizeof(func) == 4 ); +#endif +#endif #endif m_pfnTouch = func; FunctionCheck( *(reinterpret_cast(&m_pfnTouch)), name ); @@ -1119,10 +1129,20 @@ public: } USEPTR UseSet( USEPTR func, char *name ) { -#if defined(GNUC) || defined(PLATFORM_WINDOWS_PC64) - COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#ifdef _DEBUG +#ifdef PLATFORM_64BITS +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 16 ); #else - COMPILE_TIME_ASSERT( sizeof(func) == 4 ); + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#endif +#else +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#else + COMPILE_TIME_ASSERT( sizeof(func) == 4 ); +#endif +#endif #endif m_pfnUse = func; FunctionCheck( *(reinterpret_cast(&m_pfnUse)), name ); @@ -1130,10 +1150,20 @@ public: } ENTITYFUNCPTR BlockedSet( ENTITYFUNCPTR func, char *name ) { -#if defined(GNUC) || defined(PLATFORM_WINDOWS_PC64) - COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#ifdef _DEBUG +#ifdef PLATFORM_64BITS +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 16 ); #else - COMPILE_TIME_ASSERT( sizeof(func) == 4 ); + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#endif +#else +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#else + COMPILE_TIME_ASSERT( sizeof(func) == 4 ); +#endif +#endif #endif m_pfnBlocked = func; FunctionCheck( *(reinterpret_cast(&m_pfnBlocked)), name );