From a9c0c65f9eca5593a775b2b7cb03e35806f24683 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 3 Dec 2015 20:07:30 -0500 Subject: [PATCH] src: define getpid() based on OS 94b9948 added unistd.h to src/env.cc in order to use getpid(). However, this doesn't exist on Windows. This commit conditionally defines getpid() based on the OS. Fixes: https://github.com/nodejs/node/issues/4145 PR-URL: https://github.com/nodejs/node/pull/4146 Reviewed-By: Brian White --- src/env.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/env.cc b/src/env.cc index 96ad9a12c30040..fa8cc0d1addfd7 100644 --- a/src/env.cc +++ b/src/env.cc @@ -1,7 +1,13 @@ #include "env.h" #include "env-inl.h" #include "v8.h" -#include "unistd.h" + +#if defined(_MSC_VER) +#define getpid GetCurrentProcessId +#else +#include +#endif + #include namespace node {