diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-02 12:37:06 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-02 13:08:51 -0700 |
commit | 34f9618d31532c7872bef4529eaa138527a320c9 (patch) | |
tree | 252e1423262638175727e5fe49e5c2312fea116e /platform/default | |
parent | fd0f9d1319408c2d33ba8571bcf66dc62f876159 (diff) | |
download | qtlocation-mapboxgl-34f9618d31532c7872bef4529eaa138527a320c9.tar.gz |
[core] Replace boost::lexical_cast with std::to_string
This removes the only boost dependency from public headers.
Diffstat (limited to 'platform/default')
-rw-r--r-- | platform/default/image.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/platform/default/image.cpp b/platform/default/image.cpp index 2195a999c9..988d2f4a4e 100644 --- a/platform/default/image.cpp +++ b/platform/default/image.cpp @@ -4,10 +4,17 @@ #include <png.h> +template<size_t max, typename... Args> +inline static std::string sprintf(const char *msg, Args... args) { + char res[max]; + int len = snprintf(res, sizeof(res), msg, args...); + return std::string(res, len); +} + const static bool png_version_check __attribute__((unused)) = []() { const png_uint_32 version = png_access_version_number(); if (version != PNG_LIBPNG_VER) { - throw std::runtime_error(mbgl::util::sprintf<96>( + throw std::runtime_error(sprintf<96>( "libpng version mismatch: headers report %d.%d.%d, but library reports %d.%d.%d", PNG_LIBPNG_VER / 10000, (PNG_LIBPNG_VER / 100) % 100, PNG_LIBPNG_VER % 100, version / 10000, (version / 100) % 100, version % 100)); |