Explorar o código

Support for GCC 5.X Compilers

This will hopefully correct Issue #252 which appears to only affect
users with ArchLinux.
Peter Robinson %!s(int64=10) %!d(string=hai) anos
pai
achega
23568a6916
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      engine/source/platform/types.h

+ 5 - 0
engine/source/platform/types.h

@@ -170,6 +170,11 @@ inline U32 endianSwap(const U32 in_swap)
 #define Offset(x, cls) _Offset_Normal(x, cls)
 #define OffsetNonConst(x, cls) _Offset_Variant_1(x, cls)
 
+#elif defined(TORQUE_COMPILER_GCC) && (__GNUC__ == 5)
+#include <stddef.h>
+#define Offset(x, cls) offsetof(cls, x)
+#define OffsetNonConst(x, cls) _Offset_Normal(x, cls)
+
 #endif
 #endif