diff options
author | Anton Malinskiy <anton.malinskiy@agoda.com> | 2016-01-07 18:14:08 +0700 |
---|---|---|
committer | Anton Malinskiy <anton.malinskiy@agoda.com> | 2016-01-07 18:32:17 +0700 |
commit | a6a3b8a80a94ae8e5bdfea1ecb33ee0ecfa8dd0c (patch) | |
tree | 72435e5c88be786dbef79b4af3e2eab5220060b6 | |
parent | 42b13c69fe16c67f8b635b9e7017cd8f8d0ce18e (diff) | |
download | qtlocation-mapboxgl-a6a3b8a80a94ae8e5bdfea1ecb33ee0ecfa8dd0c.tar.gz |
[android] Fixed x86_64 crash on startup: no implementation previously for cache's get/bind by chrono's seconds for x86_64. Explicitly cast to int64_t
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | platform/default/sqlite_cache.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
@@ -91,7 +91,7 @@ android: android-lib # Builds all android architectures for distribution. apackage: android-lib-arm-v5 android-lib-arm-v7 -apackage: android-lib-x86 +apackage: android-lib-x86 android-lib-x86-64 apackage: android-lib-mips cd platform/android && ./gradlew --parallel-threads=$(JOBS) assemble$(BUILDTYPE) diff --git a/platform/default/sqlite_cache.cpp b/platform/default/sqlite_cache.cpp index 74aecc4e8d..e346cb0f87 100644 --- a/platform/default/sqlite_cache.cpp +++ b/platform/default/sqlite_cache.cpp @@ -329,9 +329,9 @@ void SQLiteCache::Impl::get(const Resource &resource, Callback callback) { // Status codes > 1 indicate an error response->error = std::make_unique<Response::Error>(Response::Error::Reason(status)); } - response->modified = Seconds(getStmt->get<Seconds::rep>(1)); + response->modified = Seconds(getStmt->get<int64_t>(1)); response->etag = getStmt->get<std::string>(2); - response->expires = Seconds(getStmt->get<Seconds::rep>(3)); + response->expires = Seconds(getStmt->get<int64_t>(3)); response->data = std::make_shared<std::string>(getStmt->get<std::string>(4)); if (getStmt->get<int>(5)) { // == compressed response->data = std::make_shared<std::string>(util::decompress(*response->data)); @@ -354,7 +354,7 @@ void SQLiteCache::Impl::get(const Resource &resource, Callback callback) { accessedStmt->reset(); } - accessedStmt->bind(1, toSeconds(SystemClock::now()).count()); + accessedStmt->bind(1, int64_t(toSeconds(SystemClock::now()).count())); accessedStmt->bind(2, canonicalURL.c_str()); accessedStmt->run(); } @@ -414,10 +414,10 @@ void SQLiteCache::Impl::put(const Resource& resource, std::shared_ptr<const Resp putStmt->bind(2 /* status */, 1 /* success */); } putStmt->bind(3 /* kind */, int(resource.kind)); - putStmt->bind(4 /* modified */, response->modified.count()); + putStmt->bind(4 /* modified */, int64_t(response->modified.count())); putStmt->bind(5 /* etag */, response->etag.c_str()); - putStmt->bind(6 /* expires */, response->expires.count()); - putStmt->bind(7 /* accessed */, toSeconds(SystemClock::now()).count()); + putStmt->bind(6 /* expires */, int64_t(response->expires.count())); + putStmt->bind(7 /* accessed */, int64_t(toSeconds(SystemClock::now()).count())); std::string data; if (resource.kind != Resource::SpriteImage && response->data) { @@ -461,8 +461,8 @@ void SQLiteCache::Impl::refresh(const Resource& resource, Seconds expires) { } const auto canonicalURL = util::mapbox::canonicalURL(resource.url); - refreshStmt->bind(1, toSeconds(SystemClock::now()).count()); - refreshStmt->bind(2, expires.count()); + refreshStmt->bind(1, int64_t(toSeconds(SystemClock::now()).count())); + refreshStmt->bind(2, int64_t(expires.count())); refreshStmt->bind(3, canonicalURL.c_str()); refreshStmt->run(); } catch (mapbox::sqlite::Exception& ex) { |