From 29edbd0cd2dd48d8a93796b56e47e37151034b9a Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 18 Aug 2017 23:28:25 -0500 Subject: [PATCH] Hotfix to make VS2017 15.3 play nice. Offsetof behavior - specifically buildin - is unreliable(and broken in debug), so explicitly defining it to use a reliable method for now. --- Engine/source/console/consoleTypes.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Engine/source/console/consoleTypes.h b/Engine/source/console/consoleTypes.h index a5da7661e..df3fc000f 100644 --- a/Engine/source/console/consoleTypes.h +++ b/Engine/source/console/consoleTypes.h @@ -48,6 +48,13 @@ template inline const T nullAsType(){ return nullptr; } /// @ingroup console_system Console System /// @{ +#if _MSC_VER >= 1911 + #ifdef offsetof + #undef offsetof + #endif // offsetof + #define offsetof(s,m) ((size_t)&reinterpret_cast((((s*)0)->m))) +#endif + #ifndef Offset #define Offset(x, cls) offsetof(cls, x) #endif