From 729e284e6c2560545ee3a0db6ed405845c30a682 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 19 Dec 2018 18:01:36 +0000 Subject: [PATCH] Fix build on Windows with libuv 1.22 and later On Windows in libuv 1.22 and later the `due` member was renamed to `timeout` for consistency with the other platforms. PR-URL: https://github.com/nodejs/node-report/pull/118 Fixes: https://github.com/nodejs/node-report/issues/113 Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson --- src/utilities.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utilities.cc b/src/utilities.cc index cf686d2..416e646 100644 --- a/src/utilities.cc +++ b/src/utilities.cc @@ -417,7 +417,10 @@ void walkHandle(uv_handle_t* h, void* arg) { // in all current versions of libuv. Once uv_timer_get_timeout is // in a supported level of libuv we should test for it with dlsym // and use it instead, in case timeout moves in the future. -#ifdef _WIN32 + // + // On Windows in libuv 1.22 and later the `due` member was renamed + // to `timeout` for consistency with the other platforms. +#if defined(_WIN32) && (UV_VERSION_HEX < ((1 << 16) | (22 << 8))) uint64_t due = handle->timer.due; #else uint64_t due = handle->timer.timeout;