summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/unixsupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/unixsupport.c')
-rw-r--r--otherlibs/win32unix/unixsupport.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/otherlibs/win32unix/unixsupport.c b/otherlibs/win32unix/unixsupport.c
index b5aad5700..8a2bb0fc2 100644
--- a/otherlibs/win32unix/unixsupport.c
+++ b/otherlibs/win32unix/unixsupport.c
@@ -21,6 +21,15 @@
#include <errno.h>
#include <winsock.h>
+/* Heap-allocation of Windows file handles */
+
+value win_alloc_handle(HANDLE h)
+{
+ value res = alloc(sizeof(HANDLE) / sizeof(value), Abstract_tag);
+ Handle_val(res) = h;
+ return res;
+}
+
/* Windows socket errors */
#define EWOULDBLOCK WSAEWOULDBLOCK