diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 72a25a5..87889fd 100755 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -59,6 +59,8 @@ if(USE_SYSTEM_ZLIB) else() message(FATAL_ERROR "Error! USE_SYSTEM_ZLIB is set but neccessary developer files are missing") endif() +else() + include_directories(${CMAKE_SOURCE_DIR}/Engine/zlib) endif() # RAKE! Where to install the binaries. diff --git a/Sources/Engine/Base/Types.h b/Sources/Engine/Base/Types.h index e8dc080..c796675 100755 --- a/Sources/Engine/Base/Types.h +++ b/Sources/Engine/Base/Types.h @@ -56,7 +56,7 @@ typedef uint32_t UINT; #endif // TODO: add more architecture detection routines -#if __POWERPC__ || (defined __ppc64__) || (defined __alpha__) || (defined __sparc__) /* rcg03232004 */ +#if (defined __hppa__) || (defined __m68k__) || (defined __s390x__) || (defined __sparc__) || __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ /* rcg03232004 */ #define PLATFORM_BIGENDIAN 1 #define PLATFORM_LITTLEENDIAN 0 #else @@ -65,7 +65,7 @@ typedef uint32_t UINT; #endif #if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_ARCH_PPC64) \ - || defined(_M_IA64) || defined(__IA64__) || defined(__e2k__) + || defined(_M_IA64) || defined(__IA64__) || defined(__e2k__) || defined(__alpha__) || defined(__loongarch__) || defined(__riscv) || defined(__s390x__) || (defined(__mips__) && _MIPS_SIM == _ABI64) || (defined(__sparc__) && defined(__arch64__)) #define PLATFORM_64BIT 1 @@ -759,6 +759,9 @@ inline __uint64 BYTESWAP64_unsigned(__uint64 x) val = *((SLONG *) &uval); } +/** + * BOOL is int32_t , just like SLONG + * so don't define the same function twice static inline void BYTESWAP(BOOL &val) { // !!! FIXME: reinterpret_cast ? @@ -766,6 +769,7 @@ inline __uint64 BYTESWAP64_unsigned(__uint64 x) BYTESWAP(uval); val = *((BOOL *) &uval); } +*/ static inline void BYTESWAP(FLOAT &val) { diff --git a/Sources/Engine/Base/Unzip.cpp b/Sources/Engine/Base/Unzip.cpp index 042a30f..a76bb57 100644 --- a/Sources/Engine/Base/Unzip.cpp +++ b/Sources/Engine/Base/Unzip.cpp @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., typedef unsigned char Byte; // !!! FIXME: not sure why I suddenly needed this typedef here. #endif -#include +#include extern CTCriticalSection zip_csLock; // critical section for access to zlib functions #pragma pack(1) diff --git a/Sources/Engine/Network/Compression.cpp b/Sources/Engine/Network/Compression.cpp index fe788a3..509744c 100644 --- a/Sources/Engine/Network/Compression.cpp +++ b/Sources/Engine/Network/Compression.cpp @@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include +#include extern CTCriticalSection zip_csLock; // critical section for access to zlib functions diff --git a/Sources/Engine/Templates/BSP_internal.h b/Sources/Engine/Templates/BSP_internal.h index c68eeb2..2527ed0 100755 --- a/Sources/Engine/Templates/BSP_internal.h +++ b/Sources/Engine/Templates/BSP_internal.h @@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., extern FLOAT mth_fCSGEpsilon; -#ifdef __arm__ +#if defined __arm__ && defined __ARM_PCS_VFP #define SPHERE_HACK #endif diff --git a/Sources/GameMP/Game.cpp b/Sources/GameMP/Game.cpp index c78cd7b..f3322b6 100755 --- a/Sources/GameMP/Game.cpp +++ b/Sources/GameMP/Game.cpp @@ -1534,7 +1534,7 @@ void CGame::UnpackHighScoreTable(SLONG slSize) gm_ahseHighScores[i].hse_strPlayer = (const char*)pub; pub += MAX_HIGHSCORENAME+1; memcpy(&gm_ahseHighScores[i].hse_gdDifficulty, pub, sizeof(INDEX)); - BYTESWAP(gm_ahseHighScores[i].hse_gdDifficulty); + BYTESWAP((int&)gm_ahseHighScores[i].hse_gdDifficulty); pub += sizeof(INDEX); memcpy(&gm_ahseHighScores[i].hse_tmTime , pub, sizeof(FLOAT)); BYTESWAP(gm_ahseHighScores[i].hse_tmTime);