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:
Nico Rieck
2013-09-11 00:36:48 +00:00
parent f495a26792
commit 44a61bde15
4 changed files with 41 additions and 19 deletions

View File

@@ -216,6 +216,12 @@ public:
/// terminal, this function returns false.
static bool StandardErrHasColors();
/// Enables or disables whether ANSI escape sequences are used to output
/// colors. This only has an effect on Windows.
/// Note: Setting this option is not thread-safe and should only be done
/// during initialization.
static void UseANSIEscapeCodes(bool enable);
/// Whether changing colors requires the output to be flushed.
/// This is needed on systems that don't support escape sequences for
/// changing colors.