summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Win32/Process.inc
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-11 18:05:52 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-11 18:05:52 +0000
commit15436617f4009a1eb6b322ac12cbdb15a31877cf (patch)
treeb95821113944a7d8be8f11ffe1a2c2d9106e8bdc /llvm/lib/System/Win32/Process.inc
parent7ee3a4371fb412ec88b97a9dc53d297fab80bdf8 (diff)
downloadbcm5719-llvm-15436617f4009a1eb6b322ac12cbdb15a31877cf.tar.gz
bcm5719-llvm-15436617f4009a1eb6b322ac12cbdb15a31877cf.zip
Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183. llvm-svn: 71448
Diffstat (limited to 'llvm/lib/System/Win32/Process.inc')
-rw-r--r--llvm/lib/System/Win32/Process.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/System/Win32/Process.inc b/llvm/lib/System/Win32/Process.inc
index 157483a07ca..e1d7a9222f7 100644
--- a/llvm/lib/System/Win32/Process.inc
+++ b/llvm/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;
+}
+
}
OpenPOWER on IntegriCloud