mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-17 16:46:50 +00:00
Add functions for determining if the stdin/out/err is connected to a
console or not. llvm-svn: 19236
This commit is contained in:
parent
11901e559d
commit
7466dd37d0
@ -14,6 +14,7 @@
|
||||
#include "Win32.h"
|
||||
#include <psapi.h>
|
||||
#include <malloc.h>
|
||||
#include <io.h>
|
||||
|
||||
#pragma comment(lib, "psapi.lib")
|
||||
|
||||
@ -99,5 +100,17 @@ void Process::PreventCoreFiles() {
|
||||
// dialog box from coming up. Or maybe not...
|
||||
}
|
||||
|
||||
bool Process::StandardInIsUserInput() {
|
||||
return GetFileType((HANDLE)_get_osfhandle(0)) == FILE_TYPE_CHAR;
|
||||
}
|
||||
|
||||
bool Process::StandardOutIsDisplayed() {
|
||||
return GetFileType((HANDLE)_get_osfhandle(1)) == FILE_TYPE_CHAR;
|
||||
}
|
||||
|
||||
bool Process::StandardErrIsDisplayed() {
|
||||
return GetFileType((HANDLE)_get_osfhandle(2)) == FILE_TYPE_CHAR;
|
||||
}
|
||||
|
||||
}
|
||||
// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
|
||||
|
Loading…
Reference in New Issue
Block a user