win32: work around unknown glitch with stdio attachment in visual studio command prompt
This commit is contained in:
parent
7d69942bbb
commit
5e3e6f8676
|
@ -71,6 +71,9 @@ void OpenConsole()
|
||||||
//redirect stdio
|
//redirect stdio
|
||||||
long lStdHandle = (long)hConsole;
|
long lStdHandle = (long)hConsole;
|
||||||
int hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
|
int hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
|
||||||
|
if(hConHandle == -1)
|
||||||
|
return; //this fails from a visual studio command prompt
|
||||||
|
|
||||||
FILE *fp = _fdopen( hConHandle, "w" );
|
FILE *fp = _fdopen( hConHandle, "w" );
|
||||||
*stdout = *fp;
|
*stdout = *fp;
|
||||||
//and stderr
|
//and stderr
|
||||||
|
|
Loading…
Reference in New Issue