mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
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.
This commit is contained in:
parent
21552a06dd
commit
29edbd0cd2
1 changed files with 7 additions and 0 deletions
|
|
@ -48,6 +48,13 @@ template<typename T> inline const T nullAsType(){ return nullptr; }
|
||||||
/// @ingroup console_system Console System
|
/// @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
|
#ifndef Offset
|
||||||
#define Offset(x, cls) offsetof(cls, x)
|
#define Offset(x, cls) offsetof(cls, x)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue