diff --git a/src/system.h b/src/system.h index d47b48c..3397ad7 100644 --- a/src/system.h +++ b/src/system.h @@ -89,12 +89,13 @@ #define HAVE_GETRLIMIT #endif -/* printf and size_t support */ +/* printf support for size_t and uint64_t */ #if defined(WIN32) -/* Windows uses %Iu for size_t */ #define PRINTF_SIZE_T "%Iu" +#define PRINTF_UINT64_T "%I64u" #else #define PRINTF_SIZE_T "%zu" +#define PRINTF_UINT64_T ("%" PRIu64) #endif #ifdef SSL_SUPPORT diff --git a/src/util/misc.c b/src/util/misc.c index ff5dfc6..592c8b7 100644 --- a/src/util/misc.c +++ b/src/util/misc.c @@ -315,7 +315,7 @@ const char* uhub_ulltoa(uint64_t val) { static char buf[22]; - return snprintf(buf, sizeof(buf), "%"PRIu64, val) < 0 ? NULL : buf; + return snprintf(buf, sizeof(buf), PRINTF_UINT64_T, val) < 0 ? NULL : buf; }