diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/getopt.c | 12 | ||||
-rw-r--r-- | src/lexer.cc | 1 | ||||
-rw-r--r-- | src/lexer.h | 5 | ||||
-rw-r--r-- | src/lexer.in.cc | 1 |
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. |