From 755fa8196f6a25cddd5d2f1abc7a4c3ee914025b Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 24 Oct 2020 10:52:57 +0100 Subject: [PATCH] Use PRI macros where available for 64 bit printf format codes --- src/stdafx.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/stdafx.h b/src/stdafx.h index b9d46e0d1e..5c3543bcf2 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -305,10 +305,23 @@ # define PRINTF_SIZE "%Iu" # define PRINTF_SIZEX "%IX" #else +#if defined(PRId64) +# define OTTD_PRINTF64 "%" PRId64 +#else # define OTTD_PRINTF64 "%lld" +#endif +#if defined(PRIu64) +# define OTTD_PRINTF64U "%" PRIu64 +#else # define OTTD_PRINTF64U "%llu" +#endif +#if defined(PRIx64) +# define OTTD_PRINTFHEX64 "%" PRIx64 +# define OTTD_PRINTFHEX64PAD "%016" PRIx64 +#else # define OTTD_PRINTFHEX64 "%llx" # define OTTD_PRINTFHEX64PAD "%016llx" +#endif # define PRINTF_SIZE "%zu" # define PRINTF_SIZEX "%zX" #endif