From 06a5d6461590a49c5cc014c279279bc63a432a2a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 12 Aug 2016 10:50:22 +0100 Subject: Attempts to fix Windows build. --- src/compose.hpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/compose.hpp') diff --git a/src/compose.hpp b/src/compose.hpp index b78a8b9e..4ce60e33 100644 --- a/src/compose.hpp +++ b/src/compose.hpp @@ -124,31 +124,39 @@ namespace StringPrivate inline void write(std::string& s, const int64_t& obj) { char buffer[64]; +#ifdef LIBDCP_WINDOWS + __mingw_snprintf(buffer, 64, "%" PRId64, obj); +#else snprintf(buffer, 64, "%" PRId64, obj); +#endif s += buffer; } template <> - inline void write(std::string& s, const int& obj) + inline void write(std::string& s, const uint64_t& obj) { char buffer[64]; - snprintf(buffer, 64, "%d", obj); +#ifdef LIBDCP_WINDOWS + __mingw_snprintf(buffer, 64, "%" PRIu64, obj); +#else + snprintf(buffer, 64, "%" PRIu64, obj); +#endif s += buffer; } template <> - inline void write(std::string& s, const unsigned int& obj) + inline void write(std::string& s, const int& obj) { char buffer[64]; - snprintf(buffer, 64, "%ud", obj); + snprintf(buffer, 64, "%d", obj); s += buffer; } template <> - inline void write(std::string& s, const long unsigned int& obj) + inline void write(std::string& s, const unsigned int& obj) { char buffer[64]; - snprintf(buffer, 64, "%lu", obj); + snprintf(buffer, 64, "%ud", obj); s += buffer; } -- cgit v1.2.3