diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-08-03 15:01:35 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-08-04 14:08:19 +0200 |
commit | 78ec33320ff5837f23e85e336716692f63fd0254 (patch) | |
tree | de48fe425d31e2378cc02544d97e981600c4dc61 /platform | |
parent | ab7456075c7744c8528c2b86cfa77f80d6a04ef1 (diff) | |
download | qtlocation-mapboxgl-78ec33320ff5837f23e85e336716692f63fd0254.tar.gz |
don't use certain STL functions
some functions defined in <cmath>, as well as std::to_string aren't available on GNU's STL for some platforms, e.g. Android
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/asset_request_fs.cpp | 3 | ||||
-rw-r--r-- | platform/default/glfw_view.cpp | 3 | ||||
-rw-r--r-- | platform/default/http_request_curl.cpp | 6 | ||||
-rw-r--r-- | platform/default/sqlite3.cpp | 1 |
4 files changed, 9 insertions, 4 deletions
diff --git a/platform/default/asset_request_fs.cpp b/platform/default/asset_request_fs.cpp index 4511cf882a..733e240fb9 100644 --- a/platform/default/asset_request_fs.cpp +++ b/platform/default/asset_request_fs.cpp @@ -4,6 +4,7 @@ #include <mbgl/util/util.hpp> #include <mbgl/util/url.hpp> #include <mbgl/util/uv.hpp> +#include <mbgl/util/string.hpp> #include <uv.h> @@ -131,7 +132,7 @@ void AssetRequest::fileStated(uv_fs_t *req) { #else self->response->modified = stat->st_mtime; #endif - self->response->etag = std::to_string(stat->st_ino); + self->response->etag = util::toString(stat->st_ino); const auto size = (unsigned int)(stat->st_size); self->response->data.resize(size); self->buffer = uv_buf_init(const_cast<char *>(self->response->data.data()), size); diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 49ae8c4f68..fb08b92344 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -5,6 +5,7 @@ #include <mbgl/platform/gl.hpp> #include <mbgl/platform/log.hpp> #include <mbgl/util/gl_helper.hpp> +#include <mbgl/util/string.hpp> #include <cassert> #include <cstdlib> @@ -188,7 +189,7 @@ void GLFWView::addRandomCustomPointAnnotations(int count) { for (int i = 0; i < count; i++) { static int spriteID = 1; - const auto name = std::string{ "marker-" } + std::to_string(spriteID++); + const auto name = std::string{ "marker-" } + mbgl::util::toString(spriteID++); map->setSprite(name, makeSpriteImage(22, 22, 1)); spriteIDs.push_back(name); points.emplace_back(makeRandomPoint(), name); diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp index 6b2c38e77b..22cb1df6f3 100644 --- a/platform/default/http_request_curl.cpp +++ b/platform/default/http_request_curl.cpp @@ -7,6 +7,7 @@ #include <mbgl/util/time.hpp> #include <mbgl/util/util.hpp> +#include <mbgl/util/string.hpp> #include <curl/curl.h> @@ -20,6 +21,7 @@ #include <map> #include <cassert> #include <cstring> +#include <cstdio> void handleError(CURLMcode code) { if (code != CURLM_OK) { @@ -700,12 +702,12 @@ void HTTPCURLRequest::handleResult(CURLcode code) { } else if (responseCode >= 500 && responseCode < 600) { // Server errors may be temporary, so back off exponentially. response->status = Response::Error; - response->message = "HTTP status code " + std::to_string(responseCode); + response->message = "HTTP status code " + util::toString(responseCode); return finish(ResponseStatus::TemporaryError); } else { // We don't know how to handle any other errors, so declare them as permanently failing. response->status = Response::Error; - response->message = "HTTP status code " + std::to_string(responseCode); + response->message = "HTTP status code " + util::toString(responseCode); return finish(ResponseStatus::PermanentError); } } diff --git a/platform/default/sqlite3.cpp b/platform/default/sqlite3.cpp index b2ae4e65bc..ca525cd20b 100644 --- a/platform/default/sqlite3.cpp +++ b/platform/default/sqlite3.cpp @@ -3,6 +3,7 @@ #include <cassert> #include <cstring> +#include <cstdio> // Check sqlite3 library version. const static bool sqliteVersionCheck = []() { |