From 7f071c9171a90bfdde6468177c1ce2007f697ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Sun, 26 Jan 2020 10:32:06 +0100 Subject: [PATCH] use correct printf format spec for UIntPtr --- Foundation/src/NumberFormatter.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Foundation/src/NumberFormatter.cpp b/Foundation/src/NumberFormatter.cpp index d72b4c111..a95dd5888 100644 --- a/Foundation/src/NumberFormatter.cpp +++ b/Foundation/src/NumberFormatter.cpp @@ -19,6 +19,7 @@ #include #endif #include +#include #if defined(_MSC_VER) || defined(__MINGW32__) @@ -475,13 +476,9 @@ void NumberFormatter::append(std::string& str, const void* ptr) { char buffer[24]; #if defined(POCO_PTR_IS_64_BIT) - #if defined(POCO_LONG_IS_64_BIT) - std::sprintf(buffer, "%016lX", (UIntPtr) ptr); - #else - std::sprintf(buffer, "%016" I64_FMT "X", (UIntPtr) ptr); - #endif + std::sprintf(buffer, "%016" PRIXPTR, (UIntPtr) ptr); #else - std::sprintf(buffer, "%08lX", (UIntPtr) ptr); + std::sprintf(buffer, "%08" PRIXPTR, (UIntPtr) ptr); #endif str.append(buffer); }