2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-01 23:33:33 +00:00

Proper CRLF-handling for #define

This commit is contained in:
Jack Andersen 2018-11-01 14:32:28 -10:00
parent 344148e3b3
commit b2586432c7

View File

@ -714,6 +714,8 @@ bool Compiler::compileFile(SystemStringView file, std::string_view baseName, std
else else
extraLine = std::string(begin, includesPass.cbegin() + findPos); extraLine = std::string(begin, includesPass.cbegin() + findPos);
*defineContinue += extraLine; *defineContinue += extraLine;
if (!defineContinue->empty() && defineContinue->back() == '\r')
defineContinue->pop_back();
if (!defineContinue->empty() && defineContinue->back() == '\\') if (!defineContinue->empty() && defineContinue->back() == '\\')
defineContinue->pop_back(); defineContinue->pop_back();
else else
@ -723,6 +725,8 @@ bool Compiler::compileFile(SystemStringView file, std::string_view baseName, std
{ {
std::string& defOut = m_defines[subMatch[1].str()]; std::string& defOut = m_defines[subMatch[1].str()];
defOut = subMatch[2].str(); defOut = subMatch[2].str();
if (!defOut.empty() && defOut.back() == '\r')
defOut.pop_back();
if (!defOut.empty() && defOut.back() == '\\') if (!defOut.empty() && defOut.back() == '\\')
{ {
defOut.pop_back(); defOut.pop_back();