Changeset - r22291:d98698187c0d
[Not reviewed]
master
0 1 0
michi_cc - 8 years ago 2015-12-28 13:16:41
michi_cc@openttd.org
(svn r27481) -Fix: [Win32] Stdin/out/err need to be re-assigned differently if the runtime lib of MSVC2015 is used.
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/os/windows/win32.cpp
Show inline comments
 
@@ -338,9 +338,16 @@ void CreateConsole()
 
		return;
 
	}
 

	
 
#if defined(_MSC_VER) && _MSC_VER >= 1900
 
	freopen("CONOUT$", "a", stdout);
 
	freopen("CONIN$", "r", stdin);
 
	freopen("CONOUT$", "a", stderr);
 
#else
 
	*stdout = *_fdopen(fd, "w");
 
	*stdin = *_fdopen(_open_osfhandle((intptr_t)GetStdHandle(STD_INPUT_HANDLE), _O_TEXT), "r" );
 
	*stderr = *_fdopen(_open_osfhandle((intptr_t)GetStdHandle(STD_ERROR_HANDLE), _O_TEXT), "w" );
 
#endif
 

	
 
#else
 
	/* open_osfhandle is not in cygwin */
 
	*stdout = *fdopen(1, "w" );
0 comments (0 inline, 0 general)