From d494eb619d0a0c34cd21f9574951a312c89dc446 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Wed, 5 Feb 2020 20:29:16 -0600 Subject: [PATCH] fix Windows 64-bit compile for check-structures-sanity fix some sprintf size_t-related warnings --- plugins/devel/check-structures-sanity.cpp | 10 +++++++++- plugins/devel/memview.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/devel/check-structures-sanity.cpp b/plugins/devel/check-structures-sanity.cpp index 021a8c14c..eaeb97e66 100644 --- a/plugins/devel/check-structures-sanity.cpp +++ b/plugins/devel/check-structures-sanity.cpp @@ -4,6 +4,14 @@ #include "DataDefs.h" #include "DataIdentity.h" +#if defined(WIN32) && defined(DFHACK64) +#define _WIN32_WINNT 0x0501 +#define WINVER 0x0501 + +#define WIN32_LEAN_AND_MEAN +#include +#endif + #include #include @@ -108,7 +116,7 @@ Checker::Scope::Scope(Checker *parent, const std::string & name) : } Checker::Scope::Scope(Checker *parent, size_t index) : - Scope(parent, stl_sprintf("[%lu]", index)) + Scope(parent, stl_sprintf("[%zu]", index)) { } diff --git a/plugins/devel/memview.cpp b/plugins/devel/memview.cpp index 5019ac637..429fec409 100644 --- a/plugins/devel/memview.cpp +++ b/plugins/devel/memview.cpp @@ -76,7 +76,7 @@ void outputHex(uint8_t *buf,uint8_t *lbuf,size_t len,size_t start,color_ostream for(size_t i=0;i