diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-13 00:38:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-13 21:22:37 +0100 |
| commit | e7cd5e4ee467386ff579a76c5f6a6fee03a78fc4 (patch) | |
| tree | 2d5e0d36b89bbfdc4503102ba89eb6ce902eaeb4 /src/lib/compose.hpp | |
| parent | e1255543b0c280b71db51b47f50e5a3573e45970 (diff) | |
Windows build fixes.
Diffstat (limited to 'src/lib/compose.hpp')
| -rw-r--r-- | src/lib/compose.hpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/lib/compose.hpp b/src/lib/compose.hpp index 8ccd12b50..477000e5d 100644 --- a/src/lib/compose.hpp +++ b/src/lib/compose.hpp @@ -121,6 +121,30 @@ namespace StringPrivate } template <> + inline void write(std::string& s, const int16_t& obj) + { + char buffer[64]; +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf(buffer, 64, "%" PRId16, obj); +#else + snprintf(buffer, 64, "%" PRId16, obj); +#endif + s += buffer; + } + + template <> + inline void write(std::string& s, const uint16_t& obj) + { + char buffer[64]; +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf(buffer, 64, "%" PRIu16, obj); +#else + snprintf(buffer, 64, "%" PRIu16, obj); +#endif + s += buffer; + } + + template <> inline void write(std::string& s, const int32_t& obj) { char buffer[64]; @@ -203,17 +227,16 @@ namespace StringPrivate } template <> - inline void write(std::string& s, wchar_t const & obj) + inline void write(std::string& s, const std::string& obj) { - std::wstring ws (&obj); - std::string w (ws.begin(), ws.end()); - s += w; + s += obj; } - template <> - inline void write(std::string& s, const std::string& obj) + inline void write(std::string& s, wchar_t const * const & obj) { - s += obj; + std::wstring ws (obj); + std::string w (ws.begin(), ws.end()); + s += w; } template <> |
