Use PKL types rather than file extensions.
[libdcp.git] / src / locale_convert.cc
index fc156244929d2c29f7e39f42b671b98aae221a14..133c8a3a2e0b00af9b8e24ea768b3afe897c0d11 100644 (file)
@@ -61,7 +61,11 @@ string
 dcp::locale_convert (long int x, int, bool)
 {
        char buffer[64];
+#ifdef LIBDCP_WINDOWS
+       __mingw_snprintf (buffer, sizeof(buffer), "%ld", x);
+#else
        snprintf (buffer, sizeof(buffer), "%ld", x);
+#endif
        return buffer;
 }
 
@@ -185,11 +189,24 @@ dcp::locale_convert (string x, int, bool)
 }
 
 template<>
-int64_t
+long
+dcp::locale_convert (string x, int, bool)
+{
+       long int y = 0;
+       sscanf (x.c_str(), "%ld", &y);
+       return y;
+}
+
+template<>
+long long
 dcp::locale_convert (string x, int, bool)
 {
-       int64_t y = 0;
-       sscanf (x.c_str(), "%" PRId64, &y);
+       long long y = 0;
+#ifdef LIBDCP_WINDOWS
+       __mingw_sscanf (x.c_str(), "%lld", &y);
+#else
+       sscanf (x.c_str(), "%lld", &y);
+#endif
        return y;
 }