diff --git a/bin/glfw.gypi b/bin/glfw.gypi index 548c5c2d4..395b94009 100644 --- a/bin/glfw.gypi +++ b/bin/glfw.gypi @@ -28,7 +28,6 @@ 'cflags_cc': [ '<@(glfw_cflags)', '<@(variant_cflags)', - '<@(boost_cflags)', ], 'ldflags': [ '<@(glfw_ldflags)', diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index 51ee848f2..d422a9d8f 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -2,29 +2,23 @@ #define MBGL_UTIL_STRING #include - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunknown-pragmas" -#pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#include -#pragma GCC diagnostic pop +#include +#include namespace mbgl { namespace util { -template -inline std::string toString(Args&&... args) { - return boost::lexical_cast(::std::forward(args)...); +template +inline std::string toString(T t) { + return std::to_string(t); } -// boost::lexical_cast() treats this as a character, but we are using it as number types. inline std::string toString(int8_t num) { - return boost::lexical_cast(int(num)); + return std::to_string(int(num)); } -// boost::lexical_cast() treats this as a character, but we are using it as number types. inline std::string toString(uint8_t num) { - return boost::lexical_cast(unsigned(num)); + return std::to_string(unsigned(num)); } inline std::string toString(std::exception_ptr error) { @@ -43,18 +37,6 @@ inline std::string toString(std::exception_ptr error) { } } -template -inline std::string sprintf(const char *msg, Args... args) { - char res[max]; - int len = snprintf(res, sizeof(res), msg, args...); - return std::string(res, len); -} - -template -inline std::string sprintf(const std::string &msg, Args... args) { - return sprintf(msg.c_str(), args...); -} - } // namespace util } // namespace mbgl diff --git a/platform/default/image.cpp b/platform/default/image.cpp index 2195a999c..988d2f4a4 100644 --- a/platform/default/image.cpp +++ b/platform/default/image.cpp @@ -4,10 +4,17 @@ #include +template +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)); diff --git a/platform/ios/platform.gyp b/platform/ios/platform.gyp index 9fd2b3de8..6458a55f2 100644 --- a/platform/ios/platform.gyp +++ b/platform/ios/platform.gyp @@ -110,7 +110,6 @@ 'variables': { 'cflags_cc': [ - '<@(boost_cflags)', '<@(sqlite_cflags)', '<@(zlib_cflags)', '<@(rapidjson_cflags)', diff --git a/platform/osx/platform.gyp b/platform/osx/platform.gyp index cdea98982..6b9915f5d 100644 --- a/platform/osx/platform.gyp +++ b/platform/osx/platform.gyp @@ -67,7 +67,6 @@ 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ - '<@(boost_cflags)', '<@(sqlite_cflags)', '<@(zlib_cflags)', '<@(rapidjson_cflags)',