Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Commit

Permalink
test: fix missing unistd.h on windows
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#3532
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
Junliang Yan authored and richardlau committed Oct 29, 2015
1 parent be6512b commit 8162579
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/addons/async-hello-world/binding.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#include <unistd.h>
#include <node.h>
#include <v8.h>
#include <uv.h>

#if defined _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif


struct async_req {
uv_work_t req;
int input;
Expand All @@ -13,7 +19,12 @@ struct async_req {

void DoAsync(uv_work_t* r) {
async_req* req = reinterpret_cast<async_req*>(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;
}

Expand Down

0 comments on commit 8162579

Please sign in to comment.