summaryrefslogtreecommitdiff
path: root/src/mbgl/util/uv_detail.hpp
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-10-13 14:27:09 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2015-10-14 11:36:28 -0400
commit62595a9b394547bffb8c2965b103bd87dd397e15 (patch)
treed97215f2b66d01d6dffa4252b1aa26e76b90f08d /src/mbgl/util/uv_detail.hpp
parent5b9deae95709ea557f28e4a5dcbe3ac8fd47023e (diff)
downloadqtlocation-mapboxgl-62595a9b394547bffb8c2965b103bd87dd397e15.tar.gz
[core] bump libuv to 1.7.5 across all platforms
UV_ASYNC_PARAMS and UV_TIMER_PARAMS for libuv <= 0.10 compatibility use st_mtim.tv_sec in libuv > 0.10.x
Diffstat (limited to 'src/mbgl/util/uv_detail.hpp')
-rw-r--r--src/mbgl/util/uv_detail.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mbgl/util/uv_detail.hpp b/src/mbgl/util/uv_detail.hpp
index f502ee1066..86a64d33f2 100644
--- a/src/mbgl/util/uv_detail.hpp
+++ b/src/mbgl/util/uv_detail.hpp
@@ -13,6 +13,14 @@
#undef B0
#endif
+#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
+#define UV_ASYNC_PARAMS(handle) uv_async_t *handle, int
+#define UV_TIMER_PARAMS(timer) uv_timer_t *timer, int
+#else
+#define UV_ASYNC_PARAMS(handle) uv_async_t *handle
+#define UV_TIMER_PARAMS(timer) uv_timer_t *timer
+#endif
+
#include <functional>
#include <cassert>
#include <memory>
@@ -119,12 +127,8 @@ public:
}
private:
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
- static void async_cb(uv_async_t* a, int) {
-#else
- static void async_cb(uv_async_t* a) {
-#endif
- reinterpret_cast<async*>(a->data)->fn();
+ static void async_cb(UV_ASYNC_PARAMS(handle)) {
+ reinterpret_cast<async*>(handle->data)->fn();
}
std::function<void ()> fn;
@@ -153,11 +157,7 @@ public:
}
private:
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
- static void timer_cb(uv_timer_t* t, int) {
-#else
- static void timer_cb(uv_timer_t* t) {
-#endif
+ static void timer_cb(UV_TIMER_PARAMS(t)) {
reinterpret_cast<timer*>(t->data)->fn();
}