summaryrefslogtreecommitdiff
path: root/src/locale_convert.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-15 10:09:45 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-15 14:08:03 +0100
commit3c93561190ceb883db6b69c1cd37d99cd547fe83 (patch)
tree01524b1ce784fb78424e32dfb7db110d6a4f9686 /src/locale_convert.cc
parent846bb291aa34af6e2c533d2d1402e86361552433 (diff)
Rationalise raw/locale_convert stuff and fix build on OS X.
Diffstat (limited to 'src/locale_convert.cc')
-rw-r--r--src/locale_convert.cc43
1 files changed, 38 insertions, 5 deletions
diff --git a/src/locale_convert.cc b/src/locale_convert.cc
index 3858006e..64b21274 100644
--- a/src/locale_convert.cc
+++ b/src/locale_convert.cc
@@ -51,25 +51,51 @@ string
dcp::locale_convert (unsigned int x, int, bool)
{
char buffer[64];
- snprintf (buffer, sizeof(buffer), "%ud", x);
+ snprintf (buffer, sizeof(buffer), "%u", x);
return buffer;
}
template<>
string
-dcp::locale_convert (int64_t x, int, bool)
+dcp::locale_convert (long int x, int, bool)
{
char buffer[64];
- snprintf (buffer, sizeof(buffer), "%" PRId64, x);
+ snprintf (buffer, sizeof(buffer), "%ld", x);
return buffer;
}
template<>
string
-dcp::locale_convert (uint64_t x, int, bool)
+dcp::locale_convert (unsigned long int x, int, bool)
{
char buffer[64];
- snprintf (buffer, sizeof(buffer), "%" PRIu64, x);
+ snprintf (buffer, sizeof(buffer), "%lu", x);
+ return buffer;
+}
+
+template<>
+string
+dcp::locale_convert (long long int x, int, bool)
+{
+ char buffer[64];
+#ifdef LIBDCP_WINDOWS
+ __mingw_snprintf (buffer, sizeof(buffer), "%lld", x);
+#else
+ snprintf (buffer, sizeof(buffer), "%lld", x);
+#endif
+ return buffer;
+}
+
+template<>
+string
+dcp::locale_convert (unsigned long long int x, int, bool)
+{
+ char buffer[64];
+#ifdef LIBDCP_WINDOWS
+ __mingw_snprintf (buffer, sizeof(buffer), "%llu", x);
+#else
+ snprintf (buffer, sizeof(buffer), "%llu", x);
+#endif
return buffer;
}
@@ -125,6 +151,13 @@ dcp::locale_convert (char const * x, int, bool)
}
template<>
+string
+dcp::locale_convert (boost::filesystem::path x, int, bool)
+{
+ return x.string();
+}
+
+template<>
int
dcp::locale_convert (string x, int, bool)
{