summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2011-11-19 17:40:21 (GMT)
committerNicolas Despres <nicolas.despres@gmail.com>2011-11-19 17:56:00 (GMT)
commit6be76e56b748479f980e3406141088ba4e27fb15 (patch)
tree5381eb2ed74c1909b893bbc4ff5aec89a97f974e /src
parentf54e73ffb3091c2f56b0ed4736dfb88e8063d5ec (diff)
downloadNinja-6be76e56b748479f980e3406141088ba4e27fb15.zip
Ninja-6be76e56b748479f980e3406141088ba4e27fb15.tar.gz
Ninja-6be76e56b748479f980e3406141088ba4e27fb15.tar.bz2
Use more portable way to get the current process ID.
GetProcessId() is available only since Windows XP. Since MinGW define WINVER to 0x0400 which is Windows 2000 I think, we have a compilation error. Using GetCurrentProcessId() instead of GetProcessId(GetCurrentProcess()) fix this issue.
Diffstat (limited to 'src')
-rw-r--r--src/subprocess-win32.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc
index acc789c..6e5ebab 100644
--- a/src/subprocess-win32.cc
+++ b/src/subprocess-win32.cc
@@ -15,7 +15,6 @@
#include "subprocess.h"
#include <stdio.h>
-#include <windows.h>
#include <algorithm>
@@ -55,7 +54,7 @@ Subprocess::~Subprocess() {
HANDLE Subprocess::SetupPipe(HANDLE ioport) {
char pipe_name[100];
snprintf(pipe_name, sizeof(pipe_name),
- "\\\\.\\pipe\\ninja_pid%u_sp%p", GetProcessId(GetCurrentProcess()), this);
+ "\\\\.\\pipe\\ninja_pid%u_sp%p", GetCurrentProcessId(), this);
pipe_ = ::CreateNamedPipeA(pipe_name,
PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,