mrustc
mrustc copied to clipboard
Compatibility with macOS 10.7
Let assume that ::std::istream marks itself as reached EOF after reading the last character from file which is ':' in case of minicargo's build.cpp.
This leads to missing ':' because the next call of get_token_int() returns "" because ifp.eof() is true, instead of returning ":" as it should.
This missed ':' leads to assert that dependency file aren't well formatted on some wired system.
The same happened with Lexer::getc_byte when m_istream.get() returns not EOF but marks stream as reached EOF that means the next read returns EOF.
Thus, this fixes: https://github.com/thepowersgang/mrustc/issues/284