From 274f17bce03db3b80e094eeb5c5ea63d6d055920 Mon Sep 17 00:00:00 2001 From: Tilka Date: Fri, 11 May 2012 16:45:07 +0200 Subject: [PATCH] use "I64u" instead of PRIu64 on Windows --- src/system.h | 5 +++-- src/util/misc.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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; }