Use prefix to avoid ERROR enum.
[libdcp.git] / src / locale_convert.cc
index 89c797599a4374eb60286f8d0a630ce6f9e88d48..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;
 }
 
@@ -198,7 +202,11 @@ long long
 dcp::locale_convert (string x, int, bool)
 {
        long long y = 0;
+#ifdef LIBDCP_WINDOWS
+       __mingw_sscanf (x.c_str(), "%lld", &y);
+#else
        sscanf (x.c_str(), "%lld", &y);
+#endif
        return y;
 }