diff options
author | John Hodge <tpg@mutabah.net> | 2017-08-24 23:13:52 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-08-31 16:54:58 +0800 |
commit | bb4c5f2b93b4188f8cf574a782303bc05756b230 (patch) | |
tree | 304cb5fe7bd4bc42faa2079c212c202bc81044f0 | |
parent | 18130195d7e6c870d43d8bfdbf8d573534076c01 (diff) | |
download | mrust-bb4c5f2b93b4188f8cf574a782303bc05756b230.tar.gz |
minicargo - Windows compilation fixes
-rw-r--r-- | tools/minicargo/repository.cpp | 1 | ||||
-rw-r--r-- | tools/minicargo/toml.cpp | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/minicargo/repository.cpp b/tools/minicargo/repository.cpp index 515a61b6..300d84ab 100644 --- a/tools/minicargo/repository.cpp +++ b/tools/minicargo/repository.cpp @@ -4,6 +4,7 @@ #include "debug.h" #include <fstream> #if _WIN32 +# include <Windows.h> #else # include <dirent.h> #endif diff --git a/tools/minicargo/toml.cpp b/tools/minicargo/toml.cpp index 2b95a5c9..a33114c6 100644 --- a/tools/minicargo/toml.cpp +++ b/tools/minicargo/toml.cpp @@ -30,6 +30,22 @@ struct Token ::std::string m_data; int64_t m_intval = 0; + Token(Type ty): + m_type(ty) + { + } + Token(Type ty, ::std::string s): + m_type(ty), + m_data(s) + { + } + Token(Type ty, int64_t i): + m_type(ty), + m_intval(i) + { + } + + static Token lex_from(::std::ifstream& is); static Token lex_from_inner(::std::ifstream& is); @@ -387,7 +403,7 @@ Token Token::lex_from_inner(::std::ifstream& is) c = is.get(); } is.putback(c); - return Token { Type::Integer, "", val }; + return Token { Type::Integer, val }; } else { |