Added /WX compiler switch (treat warnings as errors)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6520 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-07-11 21:57:00 +00:00
parent 9ed46ac829
commit 89a2cbb770
4 changed files with 26 additions and 3 deletions

View file

@ -3409,11 +3409,24 @@ void CEXEBuild::warning_fl(const TCHAR *s, ...)
_stprintf(&buf[cchMsg],_T(" (%") NPRIs _T(":%u)"),curfilename,linecnt);
m_warnings.add(buf,0);
notify(MakensisAPI::NOTIFY_WARNING,buf.GetPtr());
MakensisAPI::notify_e hostcode = MakensisAPI::NOTIFY_WARNING;
extern bool g_warnaserror;
if (g_warnaserror)
hostcode = MakensisAPI::NOTIFY_ERROR, display_warnings = display_errors;
notify(hostcode,buf.GetPtr());
if (display_warnings)
{
PrintColorFmtMsg_WARN(_T("warning: %") NPRIs _T("\n"),buf.GetPtr());
}
if (g_warnaserror)
{
ERROR_MSG(_T("Error: warning treated as error\n"));
extern int g_display_errors;
if (!has_called_write_output) g_display_errors = false; // This is a hack to avoid the "stale file in %temp%" warning.
extern void quit(); quit();
}
}
void CEXEBuild::ERROR_MSG(const TCHAR *s, ...) const