summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-20 17:55:49 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-10-20 17:55:49 +0200
commit5a87fb337dc034c6d96ff74d20c5c257c0a65b77 (patch)
treeae6b75779c2dbd868058fb643413669050ce46f0 /include
parent6bd63c565eee2a41fdd5ccbc248426bd469e1809 (diff)
downloadqtlocation-mapboxgl-5a87fb337dc034c6d96ff74d20c5c257c0a65b77.tar.gz
first attempt at using mason to install packages
[skip ci]
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/map.hpp7
-rw-r--r--include/mbgl/util/uv_detail.hpp20
2 files changed, 23 insertions, 4 deletions
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 {