summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorLeith Bade <leith@leithalweapon.geek.nz>2014-11-12 23:16:56 +1100
committerLeith Bade <leith@leithalweapon.geek.nz>2014-11-12 23:16:56 +1100
commit0dd54c037997dd4fabb09f57bf7f85f31b9c67c2 (patch)
tree422aacb69b0604f1025c41a78e1447bfd98b5b4f /platform
parent82908c99f779c4d5771b4eb315b2283db4c1f046 (diff)
parent27cf24171a014b63e139e7fc77422753beac44e1 (diff)
downloadqtlocation-mapboxgl-0dd54c037997dd4fabb09f57bf7f85f31b9c67c2.tar.gz
Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts: platform/default/image.cpp
Diffstat (limited to 'platform')
-rw-r--r--platform/default/headless_display.cpp2
-rw-r--r--platform/default/headless_view.cpp4
-rw-r--r--platform/default/http_request_baton_curl.cpp15
-rw-r--r--platform/default/image.cpp14
4 files changed, 32 insertions, 3 deletions
diff --git a/platform/default/headless_display.cpp b/platform/default/headless_display.cpp
index 409fcbf057..ada48b8648 100644
--- a/platform/default/headless_display.cpp
+++ b/platform/default/headless_display.cpp
@@ -48,7 +48,7 @@ HeadlessDisplay::HeadlessDisplay() {
// We're creating a dummy pbuffer anyway that we're not using.
static int pixelFormat[] = {
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
- None
+ 0
};
int configs = 0;
diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp
index 687f3ecf7d..1f5a0ec987 100644
--- a/platform/default/headless_view.cpp
+++ b/platform/default/headless_view.cpp
@@ -107,7 +107,7 @@ GLXContext createCoreProfile(Display *dpy, GLXFBConfig fbconfig) {
const int context_flags[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, core_profile_versions[i].major,
GLX_CONTEXT_MINOR_VERSION_ARB, core_profile_versions[i].minor,
- None
+ 0
};
ctx = glXCreateContextAttribsARB(dpy, fbconfig, 0, True, context_flags);
if (context_creation_failed) {
@@ -172,7 +172,7 @@ void HeadlessView::createContext() {
int pbuffer_attributes[] = {
GLX_PBUFFER_WIDTH, 8,
GLX_PBUFFER_HEIGHT, 8,
- None
+ 0
};
glx_pbuffer = glXCreatePbuffer(x_display, fb_configs[0], pbuffer_attributes);
#endif
diff --git a/platform/default/http_request_baton_curl.cpp b/platform/default/http_request_baton_curl.cpp
index a88b949e01..fb66215c0e 100644
--- a/platform/default/http_request_baton_curl.cpp
+++ b/platform/default/http_request_baton_curl.cpp
@@ -2,6 +2,7 @@
#include <mbgl/storage/http_request_baton.hpp>
#include <mbgl/util/uv-messenger.h>
#include <mbgl/util/time.hpp>
+#include <mbgl/util/string.hpp>
#ifdef __ANDROID__
#include <mbgl/android/jni.hpp>
@@ -14,6 +15,20 @@
#include <cassert>
#include <cstring>
+
+// Check curl library version.
+const static bool curl_version_check = []() {
+ const auto version = curl_version_info(CURLVERSION_NOW);
+ if (version->version_num != LIBCURL_VERSION_NUM) {
+ throw std::runtime_error(mbgl::util::sprintf<96>(
+ "libcurl version mismatch: headers report %d.%d.%d, but library reports %d.%d.%d",
+ (LIBCURL_VERSION_NUM >> 16) & 0xFF, (LIBCURL_VERSION_NUM >> 8) & 0xFF, LIBCURL_VERSION_NUM & 0xFF,
+ (version->version_num >> 16) & 0xFF, (version->version_num >> 8) & 0xFF, version->version_num & 0xFF));
+ }
+ return true;
+}();
+
+
// This file contains code from http://curl.haxx.se/libcurl/c/multi-uv.html:
/***************************************************************************
diff --git a/platform/default/image.cpp b/platform/default/image.cpp
index 933d98894e..69662bc902 100644
--- a/platform/default/image.cpp
+++ b/platform/default/image.cpp
@@ -1,5 +1,6 @@
#include <mbgl/util/image.hpp>
#include <mbgl/platform/log.hpp>
+#include <mbgl/util/string.hpp>
#include <png.h>
@@ -9,6 +10,19 @@
#include <cstring>
+// Check png library version.
+const static bool png_version_check = []() {
+ const png_uint_32 version = png_access_version_number();
+ if (version != PNG_LIBPNG_VER) {
+ throw std::runtime_error(mbgl::util::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));
+ }
+ return true;
+}();
+
+
namespace mbgl {
namespace util {