X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flocale_convert.cc;h=133c8a3a2e0b00af9b8e24ea768b3afe897c0d11;hb=28ab65a9d625e03753cd40e22d9f991d59460a16;hp=fc156244929d2c29f7e39f42b671b98aae221a14;hpb=5f61c01c7759e1420adbf201a8ccf01beac1536d;p=libdcp.git diff --git a/src/locale_convert.cc b/src/locale_convert.cc index fc156244..133c8a3a 100644 --- a/src/locale_convert.cc +++ b/src/locale_convert.cc @@ -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; }