# HG changeset patch # User Matti Hamalainen # Date 1634508286 -10800 # Node ID 10f2eba7c59b4573eb640528c2541a8b1e369100 # Parent 4ca6a3b30fe860b1157bec257e7d3681a678f591 Perhaps improve type definitions for MinGW v8+ diff -r 4ca6a3b30fe8 -r 10f2eba7c59b th_types.h --- a/th_types.h Sat Jan 02 11:35:54 2021 +0200 +++ b/th_types.h Mon Oct 18 01:04:46 2021 +0300 @@ -14,6 +14,13 @@ #define TH_TYPES_H 1 +// Meh, this is a hack due to the crap non-portability of 64bit +// printf PRI* type specifiers/modifiers +#if !defined(TH_USE_BONK_TYPES) && (defined(__MINGW32__) || defined(__MINGW64__)) +# define __USE_MINGW_ANSI_STDIO 1 +#endif + + // Check for system type #if defined(__WIN64) || defined(_WIN64) || defined(__WIN32) || defined(_WIN32) # define TH_PLAT_WINDOWS 1 @@ -102,7 +109,7 @@ # define PRId_SSIZE_T PRId32 # define PRIx_SIZE_T PRIx32 # define PRIX_SIZE_T PRIX32 -# ifdef TH_PLAT_WINDOWS +# ifdef TH_USE_BONK_TYPES # define PRId_OFF_T "ld" # define PRIx_OFF_T "lx" # define PRIX_OFF_T "lX" @@ -120,7 +127,7 @@ # define UINTPTR_MAX ( 0xffffffffUL) # endif #elif TH_ARCH == 64 -# ifdef TH_PLAT_WINDOWS // Unsure if this is MinGW64 only thing? +# ifdef TH_USE_BONK_TYPES # define PRIu_SIZE_T "I64u" # define PRId_SSIZE_T "I64d" # define PRIx_SIZE_T "I64x"