From 26d6eb4a8ab4052d7f873ca0cc2c6b68f3d41a44 Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Thu, 16 Jan 2014 11:25:52 +0100 Subject: io/win32: move mp_attach_console to terminal-win.c Why didn't I put it there from the start? --- osdep/io.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'osdep/io.c') diff --git a/osdep/io.c b/osdep/io.c index b348890533..2e2603eb7f 100644 --- a/osdep/io.c +++ b/osdep/io.c @@ -327,26 +327,4 @@ char *mp_getenv(const char *name) return NULL; } -void mp_attach_console(void) -{ - if (AttachConsole(ATTACH_PARENT_PROCESS)) { - // We have been started by something with a console window. - // Redirect output streams to that console's low-level handles, - // so we can actually use WriteConsole later on. - - int hConHandle; - intptr_t hStdio; - - hStdio = (intptr_t)GetStdHandle(STD_OUTPUT_HANDLE); - hConHandle = _open_osfhandle(hStdio, _O_TEXT); - *stdout = *_fdopen(hConHandle, "w"); - setvbuf(stdout, NULL, _IONBF, 0); - - hStdio = (intptr_t)GetStdHandle(STD_ERROR_HANDLE); - hConHandle = _open_osfhandle(hStdio, _O_TEXT); - *stderr = *_fdopen(hConHandle, "w"); - setvbuf(stderr, NULL, _IONBF, 0); - } -} - #endif // __MINGW32__ -- cgit v1.2.3