Skip to content

Commit 458facd

Browse files
cjihrigrvagg
authored andcommitted
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: #4145 PR-URL: #4146 Reviewed-By: Brian White <[email protected]>
1 parent fd5ed68 commit 458facd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/env.cc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#include"env.h"
22
#include"env-inl.h"
33
#include"v8.h"
4+
5+
#if defined(_MSC_VER)
6+
#definegetpid GetCurrentProcessId
7+
#else
8+
#include<unistd.h>
9+
#endif
10+
411
#include<stdio.h>
512

613
namespacenode{

0 commit comments

Comments
(0)