mirror of
https://github.com/pret/pokeemerald.git
synced 2026-09-26 13:23:14 -04:00
preproc: Parse cpp linemarkers
The line numbers in preproc's errors involving strings or INCBINs were incorrect before this change because all the lines from '#include'd files incremented the line number that would be reported.
This commit is contained in:
@@ -204,8 +204,9 @@ void StringParser::RaiseError(const char* format, ...)
|
||||
|
||||
std::va_list args;
|
||||
va_start(args, format);
|
||||
std::vsnprintf(buffer, bufferSize, format, args);
|
||||
int n = std::vsnprintf(buffer, bufferSize, format, args);
|
||||
va_end(args);
|
||||
std::snprintf(buffer + n, bufferSize - n, " before '%.10s'", &m_buffer[m_pos]);
|
||||
|
||||
throw std::runtime_error(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user