From 66f9511745d90b07ebaa5684a47eb526b960d67f Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 4 Jan 2022 18:44:35 +0000 Subject: [PATCH] Fix: 64 bit integer typedefs have different definitions in different compilation units Mac OS Thanks @edo9300 for reporting: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=52795 This is also once more trying to fix bug #433 git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6278 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/irrTypes.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/irrTypes.h b/include/irrTypes.h index 7d32ace2..23475435 100644 --- a/include/irrTypes.h +++ b/include/irrTypes.h @@ -8,7 +8,8 @@ #include "IrrCompileConfig.h" #if defined(__GNUC__) - #include // for __WORDSIZE + // For __WORDSIZE (which we maybe don't even need anymore with LP64 checks now) + #include #endif namespace irr @@ -77,7 +78,7 @@ typedef signed int s32; #if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) typedef unsigned __int64 u64; #elif defined(__GNUC__) -#if defined(__WORDSIZE) && __WORDSIZE == 64 +#if (defined(__LP64__) && __LP64__ == 1) || (defined(_LP64) && _LP64 == 1) || (defined(__WORDSIZE) && __WORDSIZE == 64) typedef unsigned long int u64; #else __extension__ typedef unsigned long long u64; @@ -91,7 +92,7 @@ typedef unsigned long long u64; #if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) typedef __int64 s64; #elif defined(__GNUC__) -#if defined(__WORDSIZE) && __WORDSIZE == 64 +#if (defined(__LP64__) && __LP64__ == 1) || (defined(_LP64) && _LP64 == 1) || (defined(__WORDSIZE) && __WORDSIZE == 64) typedef long int s64; #else __extension__ typedef long long s64;