aboutsummaryrefslogtreecommitdiff
path: root/libwinmain/winmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'libwinmain/winmain.c')
-rw-r--r--libwinmain/winmain.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libwinmain/winmain.c b/libwinmain/winmain.c
index a4ffc1102..a91ad26ab 100644
--- a/libwinmain/winmain.c
+++ b/libwinmain/winmain.c
@@ -22,7 +22,7 @@ static void CreateConsole(void)
if (!ConsoleCreated)
{
int hConHandle;
- long lStdHandle;
+ HANDLE lStdHandle;
CONSOLE_SCREEN_BUFFER_INFO coninfo;
FILE *fp;
@@ -42,25 +42,25 @@ static void CreateConsole(void)
}
// redirect unbuffered STDOUT to the console
- lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
+ lStdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
hConHandle = _open_osfhandle(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 = (long)GetStdHandle(STD_INPUT_HANDLE);
+ lStdHandle = GetStdHandle(STD_INPUT_HANDLE);
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = _fdopen( hConHandle, "r" );
+ fp = fdopen( hConHandle, "r" );
*stdin = *fp;
setvbuf( stdin, NULL, _IONBF, 0 );
// redirect unbuffered STDERR to the console
- lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
+ lStdHandle = GetStdHandle(STD_ERROR_HANDLE);
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = _fdopen( hConHandle, "w" );
+ fp = fdopen( hConHandle, "w" );
*stderr = *fp;
setvbuf( stderr, NULL, _IONBF, 0 );
}