More Windows hacks.
authorCarl Hetherington <cth@carlh.net>
Fri, 12 Aug 2016 21:53:17 +0000 (22:53 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 Aug 2016 21:53:17 +0000 (22:53 +0100)
src/lib/compose.hpp
src/lib/dcpomatic_time.cc

index 8ccd12b503556c834760e1afcf636fb989cbb4f2..eb0291e424753df3e9d0875a3b7050b04a341a30 100644 (file)
@@ -203,7 +203,7 @@ namespace StringPrivate
   }
 
   template <>
-  inline void write(std::string& s, wchar_t const & obj)
+  inline void write(std::string& s, wchar_t[] const & obj)
   {
     std::wstring ws (&obj);
     std::string w (ws.begin(), ws.end());
index 6563c6e5f9a2835082082a0116ebe489e16a3e72..4f6c9b664e3c0ad28a7068f7cb5b03654ed77676 100644 (file)
@@ -81,7 +81,11 @@ string
 to_string (ContentTime t)
 {
        char buffer[64];
+#ifdef DCPOMATIC_WINDOWS
+       __mingw_snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds());
+#else
        snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds());
+#endif
        return buffer;
 }
 
@@ -89,7 +93,11 @@ string
 to_string (DCPTime t)
 {
        char buffer[64];
+#ifdef DCPOMATIC_WINDOWS
+       __mingw_snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds());
+#else
        snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds());
+#endif
        return buffer;
 }
 
@@ -97,6 +105,10 @@ string
 to_string (DCPTimePeriod p)
 {
        char buffer[64];
+#ifdef DCPOMATIC_WINDOWS
+       __mingw_snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds());
+#else
        snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds());
+#endif
        return buffer;
 }