From 5a87fb337dc034c6d96ff74d20c5c257c0a65b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Mon, 20 Oct 2014 17:55:49 +0200 Subject: first attempt at using mason to install packages [skip ci] --- include/mbgl/map/map.hpp | 7 ++++++- include/mbgl/util/uv_detail.hpp | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index a69943aa74..bea82e6b4c 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -143,10 +143,15 @@ public: private: // uv async callbacks +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + static void render(uv_async_t *async, int status); + static void terminate(uv_async_t *async, int status); + static void cleanup(uv_async_t *async, int status); +#else static void render(uv_async_t *async); static void terminate(uv_async_t *async); static void cleanup(uv_async_t *async); - static void delete_async(uv_handle_t *handle); +#endif // Setup void setup(); diff --git a/include/mbgl/util/uv_detail.hpp b/include/mbgl/util/uv_detail.hpp index e0a57ce65d..f80ca1bff5 100644 --- a/include/mbgl/util/uv_detail.hpp +++ b/include/mbgl/util/uv_detail.hpp @@ -24,17 +24,31 @@ private: class loop { public: inline loop() { +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + l = uv_loop_new(); + if (l == nullptr) { +#else + l = new uv_loop_t; if (uv_loop_init(&l) != 0) { +#endif throw std::runtime_error("failed to initialize loop"); } } - inline ~loop() { uv_loop_close(&l); } + inline ~loop() { +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + uv_loop_delete(l); +#else + uv_loop_close(l); + delete l; +#endif + + } - inline uv_loop_t *operator*() { return &l; } + inline uv_loop_t *operator*() { return l; } private: - uv_loop_t l; + uv_loop_t *l = nullptr; }; class mutex { -- cgit v1.2.1 From 3a39d69504c3a8d87015908424e4ee199ef0c215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 21 Oct 2014 17:02:07 +0200 Subject: link boost when the boost variable is set --- include/mbgl/text/collision.hpp | 1 + include/mbgl/util/uv-worker.h | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mbgl/text/collision.hpp b/include/mbgl/text/collision.hpp index 8eec30f216..b7ee6b4520 100644 --- a/include/mbgl/text/collision.hpp +++ b/include/mbgl/text/collision.hpp @@ -5,6 +5,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" #ifdef __clang__ #pragma GCC diagnostic ignored "-Wdeprecated-register" #else diff --git a/include/mbgl/util/uv-worker.h b/include/mbgl/util/uv-worker.h index 451b6fb04d..cb2075d1c3 100644 --- a/include/mbgl/util/uv-worker.h +++ b/include/mbgl/util/uv-worker.h @@ -5,8 +5,7 @@ extern "C" { #endif -typedef struct uv_messenger_s uv_messenger_t; - +#include #include #include -- cgit v1.2.1 From 2f3952b30541d5bbb3579c39a36052c02b47b37a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 22 Oct 2014 10:45:42 +0200 Subject: fix compile warnings --- include/mbgl/platform/event.hpp | 6 ++++-- include/mbgl/platform/log.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mbgl/platform/event.hpp b/include/mbgl/platform/event.hpp index d2a06618a3..0405cddfad 100644 --- a/include/mbgl/platform/event.hpp +++ b/include/mbgl/platform/event.hpp @@ -57,11 +57,13 @@ struct EventPermutation { } }; -constexpr EventSeverity disabledEventSeverities[] = { #if !DEBUG +constexpr EventSeverity disabledEventSeverities[] = { EventSeverity::Debug, -#endif }; +#else +constexpr EventSeverity *disabledEventSeverities = nullptr; +#endif constexpr Event disabledEvents[] = { diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp index dc000b4d52..bcb6d79224 100644 --- a/include/mbgl/platform/log.hpp +++ b/include/mbgl/platform/log.hpp @@ -21,7 +21,7 @@ class Log { private: template constexpr static bool includes(const T e, T const *l, const size_t i = 0) { - return i >= sizeof l ? false : *(l + i) == e ? true : includes(e, l, i + 1); + return l == nullptr ? false : i >= sizeof l ? false : *(l + i) == e ? true : includes(e, l, i + 1); } public: -- cgit v1.2.1