summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorScott Graham <sgraham@gmail.com>2012-01-04 22:18:17 (GMT)
committerEvan Martin <martine@danga.com>2012-01-04 22:18:39 (GMT)
commitf4df3f731a732a11861145b310cbd252c52e8cfe (patch)
treea05863addb5f30c7f78104c4f3c78339b81df30b /src
parent4a09acf125285fd773f2df0f00b2783aaa9f2f6f (diff)
downloadNinja-f4df3f731a732a11861145b310cbd252c52e8cfe.zip
Ninja-f4df3f731a732a11861145b310cbd252c52e8cfe.tar.gz
Ninja-f4df3f731a732a11861145b310cbd252c52e8cfe.tar.bz2
windows: more build fixes
Diffstat (limited to 'src')
-rw-r--r--src/getopt.c12
-rw-r--r--src/lexer.cc1
-rw-r--r--src/lexer.h5
-rw-r--r--src/lexer.in.cc1
4 files changed, 13 insertions, 6 deletions
diff --git a/src/getopt.c b/src/getopt.c
index 0dbe6a5..1e3c09d 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -396,17 +396,17 @@ getopt (int argc, char **argv, char *optstring)
}
int
-getopt_long (int argc, char **argv, char *shortopts,
- GETOPT_LONG_OPTION_T * longopts, int *longind)
+getopt_long (int argc, char **argv, const char *shortopts,
+ const GETOPT_LONG_OPTION_T * longopts, int *longind)
{
- return getopt_internal (argc, argv, shortopts, longopts, longind, 0);
+ return getopt_internal (argc, argv, (char*)shortopts, (GETOPT_LONG_OPTION_T*)longopts, longind, 0);
}
int
-getopt_long_only (int argc, char **argv, char *shortopts,
- GETOPT_LONG_OPTION_T * longopts, int *longind)
+getopt_long_only (int argc, char **argv, const char *shortopts,
+ const GETOPT_LONG_OPTION_T * longopts, int *longind)
{
- return getopt_internal (argc, argv, shortopts, longopts, longind, 1);
+ return getopt_internal (argc, argv, (char*)shortopts, (GETOPT_LONG_OPTION_T*)longopts, longind, 1);
}
/* end of file GETOPT.C */
diff --git a/src/lexer.cc b/src/lexer.cc
index d3ef43f..75b91e7 100644
--- a/src/lexer.cc
+++ b/src/lexer.cc
@@ -18,6 +18,7 @@
#include <stdio.h>
#include "eval_env.h"
+#include "util.h"
bool Lexer::Error(const string& message, string* err) {
// Compute line/column.
diff --git a/src/lexer.h b/src/lexer.h
index 40e602a..c872b98 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -14,6 +14,11 @@
#include "string_piece.h"
+// Windows may #define ERROR.
+#ifdef ERROR
+#undef ERROR
+#endif
+
struct EvalString;
struct Lexer {
diff --git a/src/lexer.in.cc b/src/lexer.in.cc
index 4d6d132..c0c197b 100644
--- a/src/lexer.in.cc
+++ b/src/lexer.in.cc
@@ -17,6 +17,7 @@
#include <stdio.h>
#include "eval_env.h"
+#include "util.h"
bool Lexer::Error(const string& message, string* err) {
// Compute line/column.