From 3b3d9996181d9c93c81667f610e31212997fd184 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 9 Sep 2012 15:04:25 +0200 Subject: [PATCH] Add format characters for (s)size_t and ptrdiff_t --- src/util.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/util.h b/src/util.h index 4b0814c6..eb8f781c 100644 --- a/src/util.h +++ b/src/util.h @@ -54,6 +54,17 @@ static const int64 CENT = 1000000; #endif #endif +/* Format characters for (s)size_t and ptrdiff_t */ +#if defined(_MSC_VER) || defined(__MSVCRT__) + #define PRIszx "%Ix" + #define PRIszu "%Iu" + #define PRIszd "%Id" +#else + #define PRIszx "%zx" + #define PRIszu "%zu" + #define PRIszd "%zd" +#endif + // This is needed because the foreach macro can't get over the comma in pair #define PAIRTYPE(t1, t2) std::pair