summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-12 10:50:22 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-12 10:50:22 +0100
commit06a5d6461590a49c5cc014c279279bc63a432a2a (patch)
tree453f4438dbc9a2546eaf715481f6849438cfdfc3 /src
parent8ba922f93370862e0947e4d59cb7ae11fd0ace80 (diff)
Attempts to fix Windows build.
Diffstat (limited to 'src')
-rw-r--r--src/compose.hpp20
-rw-r--r--src/decrypted_kdm.cc4
2 files changed, 18 insertions, 6 deletions
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;
}
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc
index ef6a6208..05ea73a3 100644
--- a/src/decrypted_kdm.cc
+++ b/src/decrypted_kdm.cc
@@ -78,7 +78,11 @@ DecryptedKDM::put_uuid (uint8_t ** d, string id)
{
/* 32 hex digits plus some hyphens */
DCP_ASSERT (id.length() == 36);
+#ifdef LIBDCP_WINDOWS
+ __mingw_sscanf (
+#else
sscanf (
+#endif
id.c_str(),
"%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
*d + 0, *d + 1, *d + 2, *d + 3, *d + 4, *d + 5, *d + 6, *d + 7,