MakeNSIS console warn/err colors on Win32

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6167 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2011-11-09 10:30:11 +00:00
parent ee59b7f723
commit e918dd8a27
10 changed files with 112 additions and 46 deletions

View file

@ -56,6 +56,32 @@ tstring get_string_suffix(const tstring& str, const tstring& separator);
int sane_system(const TCHAR *command);
void PrintColorFmtMsg(unsigned int type, const TCHAR *fmtstr, va_list args);
void FlushOutputAndResetPrintColor();
#ifdef _WIN32
#define ResetPrintColor() FlushOutputAndResetPrintColor() // For reset ONLY use PrintColorFmtMsg(0,NULL ...
#define SetPrintColorWARN() PrintColorFmtMsg(1|0x10, NULL, (va_list)NULL)
#define SetPrintColorERR() PrintColorFmtMsg(2|0x10, NULL, (va_list)NULL)
#else
#define ResetPrintColor()
#define SetPrintColorWARN()
#define SetPrintColorERR()
#endif
inline void PrintColorFmtMsg_WARN(const TCHAR *fmtstr, ...)
{
va_list val;
va_start(val,fmtstr);
PrintColorFmtMsg(1, fmtstr, val);
va_end(val);
}
inline void PrintColorFmtMsg_ERR(const TCHAR *fmtstr, ...)
{
va_list val;
va_start(val,fmtstr);
PrintColorFmtMsg(2, fmtstr, val);
va_end(val);
}
#ifndef _WIN32
TCHAR *CharPrev(const TCHAR *s, const TCHAR *p);
TCHAR *CharNext(const TCHAR *s);