Preprocessor: Report #error configuration when -D is used. Ticket: #2042

This commit is contained in:
Robert Reif 2010-09-14 07:21:19 +02:00 committed by Daniel Marjamäki
parent 0153dccb66
commit f2a3267ac7
1 changed files with 2 additions and 1 deletions

View File

@ -231,7 +231,8 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
writeError(filename, lineno, _errorLogger, "syntaxError", errmsg.str());
}
if (str.compare(i, 6, "#error") == 0 || str.compare(i, 8, "#warning") == 0)
if ((str.compare(i, 6, "#error") == 0 && (!_settings || _settings->userDefines.empty())) ||
str.compare(i, 8, "#warning") == 0)
{
if (str.compare(i, 6, "#error") == 0)
code << "#error";