diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-11 18:05:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-11 18:05:52 +0000 |
commit | 01746745f1287effa1772ef51b973988afcea699 (patch) | |
tree | a0b36215c048f45698f1ecbef044953e0f3e37cc /lib/System/Win32/Process.inc | |
parent | 5c8274b5e3034c1cfae02426c68f353abfbf506f (diff) | |
download | llvm-01746745f1287effa1772ef51b973988afcea699.tar.gz llvm-01746745f1287effa1772ef51b973988afcea699.tar.bz2 llvm-01746745f1287effa1772ef51b973988afcea699.tar.xz |
Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32/Process.inc')
-rw-r--r-- | lib/System/Win32/Process.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/System/Win32/Process.inc b/lib/System/Win32/Process.inc index 157483a07c..e1d7a9222f 100644 --- a/lib/System/Win32/Process.inc +++ b/lib/System/Win32/Process.inc @@ -131,4 +131,20 @@ bool Process::StandardErrIsDisplayed() { return GetFileType((HANDLE)_get_osfhandle(2)) == FILE_TYPE_CHAR; } +unsigned Process::StandardOutColumns() { + unsigned Columns = 0; + CONSOLE_SCREEN_BUFFER_INFO csbi; + if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) + Columns = csbi.dwSize.X; + return Columns; +} + +unsigned Process::StandardErrColumns() { + unsigned Columns = 0; + CONSOLE_SCREEN_BUFFER_INFO csbi; + if (GetConsoleScreenBufferInfo(GetStdHandle(STD_ERROR_HANDLE), &csbi)) + Columns = csbi.dwSize.X; + return Columns; +} + } |