From 6d8620941f70866a679491013890b747c269b01c Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 10 Apr 2020 21:38:28 +0100 Subject: [PATCH] Use PRIx64 on mingw-w64 instead llx mingw-w64 is able to work with old enough Microsoft C runtimes which don't support %llx. However, all versions of mingw-w64 do have inttypes.h, so use it (PRIx64 is shimmed for other platforms, since inttypes.h is a C99 header). --- src/genkat.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/genkat.c b/src/genkat.c index 8db9036..1e75b0b 100644 --- a/src/genkat.c +++ b/src/genkat.c @@ -20,6 +20,12 @@ #include #include "argon2.h" #include "core.h" +#ifdef __MINGW32__ +#include +#else +/* Don't use (it's not C89) */ +#define PRIx64 "llx" +#endif void initial_kat(const uint8_t *blockhash, const argon2_context *context, argon2_type type) { @@ -115,7 +121,7 @@ void internal_kat(const argon2_instance_t *instance, uint32_t pass) { : ARGON2_QWORDS_IN_BLOCK; for (j = 0; j < how_many_words; ++j) - printf("Block %.4u [%3u]: %016llx\n", i, j, + printf("Block %.4u [%3u]: %016" PRIx64 "\n", i, j, (unsigned long long)instance->memory[i].v[j]); } }