mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Support ANSI escape code on Windows
In some cases (e.g. when a build system pipes stderr) the Windows console API cannot be used to color output. For these, provide a way to switch to ANSI escape codes. This is required for Clang's -fansi-escape-codes option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -80,6 +80,24 @@ TimeValue self_process::get_wall_time() const {
|
||||
#endif
|
||||
|
||||
|
||||
#define COLOR(FGBG, CODE, BOLD) "\033[0;" BOLD FGBG CODE "m"
|
||||
|
||||
#define ALLCOLORS(FGBG,BOLD) {\
|
||||
COLOR(FGBG, "0", BOLD),\
|
||||
COLOR(FGBG, "1", BOLD),\
|
||||
COLOR(FGBG, "2", BOLD),\
|
||||
COLOR(FGBG, "3", BOLD),\
|
||||
COLOR(FGBG, "4", BOLD),\
|
||||
COLOR(FGBG, "5", BOLD),\
|
||||
COLOR(FGBG, "6", BOLD),\
|
||||
COLOR(FGBG, "7", BOLD)\
|
||||
}
|
||||
|
||||
static const char colorcodes[2][2][8][10] = {
|
||||
{ ALLCOLORS("3",""), ALLCOLORS("3","1;") },
|
||||
{ ALLCOLORS("4",""), ALLCOLORS("4","1;") }
|
||||
};
|
||||
|
||||
// Include the platform-specific parts of this class.
|
||||
#ifdef LLVM_ON_UNIX
|
||||
#include "Unix/Process.inc"
|
||||
|
Reference in New Issue
Block a user