From a9e86e68bee1a7a8b81e97901cb24c15fe73cb74 Mon Sep 17 00:00:00 2001 From: rogerman Date: Mon, 23 Jun 2025 17:16:45 -0700 Subject: [PATCH] Partially revert commit ecd4c16. types.h has never assumed the presence of cstdint. Let's remove this dependency to ensure compatibility regardless of compiler. --- desmume/src/types.h | 46 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/desmume/src/types.h b/desmume/src/types.h index 6bb598dc0..f1d4791f9 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -19,7 +19,6 @@ #ifndef TYPES_HPP #define TYPES_HPP -#include #include #include #include @@ -230,15 +229,44 @@ #endif #endif -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; +#if defined(__LP64__) +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; -typedef int64_t s64; +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +typedef signed long long s64; +#else +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) +typedef unsigned __int64 u64; +#else +typedef unsigned long long u64; +#endif + +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) +typedef __int64 s64; +#else +typedef signed long long s64; +#endif +#endif + +typedef u8 uint8; +typedef u16 uint16; + +#ifndef OBJ_C +typedef u32 uint32; +#else +#define uint32 u32 //uint32 is defined in Leopard somewhere, avoid conflicts +#endif #ifdef ENABLE_ALTIVEC #ifndef __APPLE_ALTIVEC__