Merge pull request #2072 from Areloch/VS2017_153_offsetof_patch

Hotfix to make VS2017 15.3 play nice.
This commit is contained in:
Areloch 2017-08-19 00:09:07 -05:00 committed by GitHub
commit 7dbae1911b

View file

@ -48,6 +48,13 @@ template<typename T> 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<char const volatile&>((((s*)0)->m)))
#endif
#ifndef Offset
#define Offset(x, cls) offsetof(cls, x)
#endif