summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/startup.c')
-rw-r--r--otherlibs/win32unix/startup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/otherlibs/win32unix/startup.c b/otherlibs/win32unix/startup.c
index af8919f18..c5eec18e2 100644
--- a/otherlibs/win32unix/startup.c
+++ b/otherlibs/win32unix/startup.c
@@ -40,7 +40,11 @@ value win_cleanup(unit) /* ML */
return Val_unit;
}
+static int std_handles[3] = {
+ STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE
+};
+
value win_stdhandle(value nhandle) /* ML */
{
- return win_alloc_handle(GetStdHandle(Int_val(nhandle)));
+ return win_alloc_handle(GetStdHandle(std_handles[Int_val(nhandle)]));
}