summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-03-10 10:13:13 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-10 15:03:18 -0800
commitb05e19b3890b25e476e46ec2544920687cbe0e2e (patch)
treebfbc06f84aa2a90f25dcffab4537c897895f55f3
parent6fdcbb61a40b3e637f778c31f773e370374b99c5 (diff)
downloadqtlocation-mapboxgl-b05e19b3890b25e476e46ec2544920687cbe0e2e.tar.gz
[node, glfw] Remove libuv 0.10 support
-rw-r--r--platform/default/async_task.cpp8
-rw-r--r--platform/default/run_loop.cpp13
-rw-r--r--platform/default/timer.cpp8
-rw-r--r--platform/node/src/node_map.cpp8
-rw-r--r--platform/node/src/util/async_queue.hpp8
5 files changed, 4 insertions, 41 deletions
diff --git a/platform/default/async_task.cpp b/platform/default/async_task.cpp
index 05cf759863..5fa9db8d33 100644
--- a/platform/default/async_task.cpp
+++ b/platform/default/async_task.cpp
@@ -7,12 +7,6 @@
#include <uv.h>
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
-#define UV_ASYNC_PARAMS(handle) uv_async_t *handle, int
-#else
-#define UV_ASYNC_PARAMS(handle) uv_async_t *handle
-#endif
-
namespace mbgl {
namespace util {
@@ -45,7 +39,7 @@ public:
}
private:
- static void asyncCallback(UV_ASYNC_PARAMS(handle)) {
+ static void asyncCallback(uv_async_t* handle) {
reinterpret_cast<Impl*>(handle->data)->task();
}
diff --git a/platform/default/run_loop.cpp b/platform/default/run_loop.cpp
index 1ebbade7ab..1b9a5cc5d1 100644
--- a/platform/default/run_loop.cpp
+++ b/platform/default/run_loop.cpp
@@ -13,11 +13,7 @@ namespace {
using namespace mbgl::util;
static ThreadLocal<RunLoop>& current = *new ThreadLocal<RunLoop>;
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
-void dummyCallback(uv_async_t*, int) {}
-#else
void dummyCallback(uv_async_t*) {}
-#endif
} // namespace
@@ -84,13 +80,8 @@ public:
RunLoop::RunLoop(Type type) : impl(std::make_unique<Impl>()) {
switch (type) {
case Type::New:
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
- impl->loop = uv_loop_new();
- if (impl->loop == nullptr) {
-#else
impl->loop = new uv_loop_t;
if (uv_loop_init(impl->loop) != 0) {
-#endif
throw std::runtime_error("Failed to initialize loop.");
}
break;
@@ -129,14 +120,10 @@ RunLoop::~RunLoop() {
impl->async.reset();
runOnce();
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
- uv_loop_delete(impl->loop);
-#else
if (uv_loop_close(impl->loop) == UV_EBUSY) {
throw std::runtime_error("Failed to close loop.");
}
delete impl->loop;
-#endif
}
LOOP_HANDLE RunLoop::getLoopHandle() {
diff --git a/platform/default/timer.cpp b/platform/default/timer.cpp
index 473f059133..cd0e6da6aa 100644
--- a/platform/default/timer.cpp
+++ b/platform/default/timer.cpp
@@ -4,12 +4,6 @@
#include <uv.h>
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
-#define UV_TIMER_PARAMS(timer) uv_timer_t *timer, int
-#else
-#define UV_TIMER_PARAMS(timer) uv_timer_t *timer
-#endif
-
namespace mbgl {
namespace util {
@@ -46,7 +40,7 @@ public:
}
private:
- static void timerCallback(UV_TIMER_PARAMS(handle)) {
+ static void timerCallback(uv_timer_t* handle) {
reinterpret_cast<Impl*>(handle->data)->cb();
}
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index f6b672efee..686766ed19 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -14,12 +14,6 @@
#include <unistd.h>
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
-#define UV_ASYNC_PARAMS(handle) uv_async_t *handle, int
-#else
-#define UV_ASYNC_PARAMS(handle) uv_async_t *handle
-#endif
-
namespace node_mbgl {
struct NodeMap::RenderOptions {
@@ -975,7 +969,7 @@ NodeMap::NodeMap(v8::Local<v8::Object> options)
});
async->data = this;
- uv_async_init(uv_default_loop(), async, [](UV_ASYNC_PARAMS(h)) {
+ uv_async_init(uv_default_loop(), async, [](uv_async_t* h) {
reinterpret_cast<NodeMap *>(h->data)->renderFinished();
});
diff --git a/platform/node/src/util/async_queue.hpp b/platform/node/src/util/async_queue.hpp
index 87737437c3..a084b866ae 100644
--- a/platform/node/src/util/async_queue.hpp
+++ b/platform/node/src/util/async_queue.hpp
@@ -8,12 +8,6 @@
#include <queue>
#include <string>
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
-#define UV_ASYNC_PARAMS(handle) uv_async_t *handle, int
-#else
-#define UV_ASYNC_PARAMS(handle) uv_async_t *handle
-#endif
-
namespace node_mbgl {
namespace util {
@@ -23,7 +17,7 @@ public:
AsyncQueue(uv_loop_t *loop, std::function<void(T &)> fn) :
callback(fn) {
async.data = this;
- uv_async_init(loop, &async, [](UV_ASYNC_PARAMS(handle)) {
+ uv_async_init(loop, &async, [](uv_async_t* handle) {
auto q = reinterpret_cast<AsyncQueue *>(handle->data);
q->process();
});