Преглед на файлове

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.

Areloch преди 8 години
родител
ревизия
29edbd0cd2
променени са 1 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 7 0
      Engine/source/console/consoleTypes.h

+ 7 - 0
Engine/source/console/consoleTypes.h

@@ -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