From 6ff46a795fc26d47f6f374dd52c2916ae4619e79 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 1 Oct 2021 10:13:22 +1000 Subject: [PATCH] Common/StringHelpers: Fix printing of 64-bit pointers --- common/StringHelpers.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/StringHelpers.h b/common/StringHelpers.h index 2dccfacbb5..769c34e643 100644 --- a/common/StringHelpers.h +++ b/common/StringHelpers.h @@ -15,6 +15,7 @@ #pragma once +#include #include #include "common/Dependencies.h" #include "common/SafeArray.h" @@ -225,7 +226,11 @@ extern bool pxParseAssignmentString(const wxString& src, wxString& ldest, wxStri #define pxsFmt FastFormatUnicode().Write #define pxsFmtV FastFormatUnicode().WriteV -#define pxsPtr(ptr) pxsFmt("0x%08X", (ptr)).c_str() +#ifdef _M_X86_64 +#define pxsPtr(ptr) pxsFmt("0x%016" PRIXPTR, (ptr)).c_str() +#else +#define pxsPtr(ptr) pxsFmt("0x%08" PRIXPTR, (ptr)).c_str() +#endif extern wxString& operator+=(wxString& str1, const FastFormatUnicode& str2); extern wxString operator+(const wxString& str1, const FastFormatUnicode& str2);