浏览代码

Support for GCC 5.X Compilers

This will hopefully correct Issue #252 which appears to only affect
users with ArchLinux.
Peter Robinson 10 年之前
父节点
当前提交
23568a6916
共有 1 个文件被更改,包括 5 次插入0 次删除
  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