summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/getopt.h4
-rw-r--r--src/ninja.cc2
-rw-r--r--src/subprocess-win32.cc3
3 files changed, 4 insertions, 5 deletions
diff --git a/src/getopt.h b/src/getopt.h
index 20a7dc7..ead9878 100644
--- a/src/getopt.h
+++ b/src/getopt.h
@@ -41,9 +41,9 @@ extern "C"
/* function prototypes */
int getopt (int argc, char **argv, char *optstring);
int getopt_long (int argc, char **argv, const char *shortopts,
- GETOPT_LONG_OPTION_T * longopts, int *longind);
+ const GETOPT_LONG_OPTION_T * longopts, int *longind);
int getopt_long_only (int argc, char **argv, const char *shortopts,
- GETOPT_LONG_OPTION_T * longopts, int *longind);
+ const GETOPT_LONG_OPTION_T * longopts, int *longind);
#ifdef __cplusplus
};
diff --git a/src/ninja.cc b/src/ninja.cc
index b2c8da0..9c0a90f 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -412,7 +412,7 @@ int CmdClean(State* state, int argc, char* argv[], const BuildConfig& config) {
optind = 1;
int opt;
- while ((opt = getopt(argc, argv, "gr")) != -1) {
+ while ((opt = getopt(argc, argv, const_cast<char*>("gr"))) != -1) {
switch (opt) {
case 'g':
generator = true;
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,