From 2ef99011dbf1b5f92200bedbb6fc6a9eaf7fbf32 Mon Sep 17 00:00:00 2001 From: Junliang Yan Date: Mon, 26 Oct 2015 08:39:13 -0400 Subject: [PATCH] test: fix missing unistd.h on windows --- test/addons/async-hello-world/binding.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/addons/async-hello-world/binding.cc b/test/addons/async-hello-world/binding.cc index b087bf9aa0dca0..e6033fc4fd420c 100644 --- a/test/addons/async-hello-world/binding.cc +++ b/test/addons/async-hello-world/binding.cc @@ -1,8 +1,14 @@ -#include #include #include #include +#if defined _WIN32 +#include +#else +#include +#endif + + struct async_req { uv_work_t req; int input; @@ -13,7 +19,12 @@ struct async_req { void DoAsync(uv_work_t* r) { async_req* req = reinterpret_cast(r->data); - sleep(1); // Simulate CPU intensive process... + // Simulate CPU intensive process... +#if defined _WIN32 + Sleep(1000); +#else + sleep(1); +#endif req->output = req->input * 2; }