aboutsummaryrefslogtreecommitdiff
path: root/libwinmain
diff options
context:
space:
mode:
Diffstat (limited to 'libwinmain')
-rw-r--r--libwinmain/winmain.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libwinmain/winmain.c b/libwinmain/winmain.c
index a91ad26ab..65c6e7919 100644
--- a/libwinmain/winmain.c
+++ b/libwinmain/winmain.c
@@ -43,24 +43,24 @@ static void CreateConsole(void)
// redirect unbuffered STDOUT to the console
lStdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
- hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
+ hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT);
if (hConHandle==-1) // error occured, so return
return;
- fp = fdopen( hConHandle, "w" );
+ fp = _fdopen( hConHandle, "w" );
*stdout = *fp;
setvbuf( stdout, NULL, _IONBF, 0 );
// redirect unbuffered STDIN to the console
lStdHandle = GetStdHandle(STD_INPUT_HANDLE);
- hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = fdopen( hConHandle, "r" );
+ hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT);
+ fp = _fdopen( hConHandle, "r" );
*stdin = *fp;
setvbuf( stdin, NULL, _IONBF, 0 );
// redirect unbuffered STDERR to the console
lStdHandle = GetStdHandle(STD_ERROR_HANDLE);
- hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = fdopen( hConHandle, "w" );
+ hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT);
+ fp = _fdopen( hConHandle, "w" );
*stderr = *fp;
setvbuf( stderr, NULL, _IONBF, 0 );
}