Change: Make _tick_counter 64bit to avoid wrapping (#10035)

This commit is contained in:
dP
2022-09-21 13:42:29 +03:00
committed by GitHub
parent 164ec3ac07
commit 548f0496a9
12 changed files with 25 additions and 14 deletions

View File

@@ -303,13 +303,21 @@
#define PACK(type_dec) PACK_N(type_dec, 1)
/* MSVCRT of course has to have a different syntax for long long *sigh* */
#if defined(_MSC_VER) || defined(__MINGW32__)
#if defined(_MSC_VER)
# define OTTD_PRINTF64 "%I64d"
# define OTTD_PRINTF64U "%I64u"
# define OTTD_PRINTFHEX64 "%I64x"
# define PRINTF_SIZE "%Iu"
# define PRINTF_SIZEX "%IX"
#elif defined(__MINGW32__)
# define OTTD_PRINTF64 "%I64d"
# define OTTD_PRINTF64U "%I64llu"
# define OTTD_PRINTFHEX64 "%I64x"
# define PRINTF_SIZE "%Iu"
# define PRINTF_SIZEX "%IX"
#else
# define OTTD_PRINTF64 "%lld"
# define OTTD_PRINTF64U "%llu"
# define OTTD_PRINTFHEX64 "%llx"
# define PRINTF_SIZE "%zu"
# define PRINTF_SIZEX "%zX"