From acd95c325afaf09976400d86733d26b83f28542f Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 24 Jul 2017 15:36:02 +0300 Subject: [core] Fix issues with the std:: namespace and old compilers Specifically when building Android with GCC 4.9 (which Qt still does :-/) --- include/mbgl/util/string.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index de061647b5..82d317c620 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -1,9 +1,34 @@ #pragma once +#include #include #include +#include #include +// Polyfill needed by Qt when building for Android with GCC +#if defined(__ANDROID__) && defined(__GLIBCXX__) + +namespace std { + +template +std::string to_string(T value) +{ + std::ostringstream oss; + oss << value; + + return oss.str(); +} + +inline int stoi(const std::string &str) +{ + return atoi(str.c_str()); +} + +} // namespace std + +#endif + namespace mbgl { namespace util { -- cgit v1.2.1