diff --git a/src/stdafx.h b/src/stdafx.h --- a/src/stdafx.h +++ b/src/stdafx.h @@ -298,21 +298,6 @@ #endif #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) -# define OTTD_PRINTF64 "%I64d" -# define OTTD_PRINTF64U "%I64u" -# define OTTD_PRINTFHEX64 "%I64x" -#elif defined(__MINGW32__) -# define OTTD_PRINTF64 "%I64d" -# define OTTD_PRINTF64U "%I64llu" -# define OTTD_PRINTFHEX64 "%I64x" -#else -# define OTTD_PRINTF64 "%lld" -# define OTTD_PRINTF64U "%llu" -# define OTTD_PRINTFHEX64 "%llx" -#endif - /* * When making a (pure) debug build, the compiler will by default disable * inlining of functions. This has a detremental effect on the performance of diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -39,6 +39,7 @@ #include "newgrf_engine.h" #include "core/backup_type.hpp" #include +#include #include "table/strings.h" #include "table/control_codes.h" @@ -382,7 +383,7 @@ static char *FormatZerofillNumber(char * static char *FormatHexNumber(char *buff, uint64 number, const char *last) { - return buff + seprintf(buff, last, "0x" OTTD_PRINTFHEX64, number); + return strecpy(buff, fmt::format("0x{:X}", number).c_str(), last); } /**