summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/socket.c')
-rw-r--r--otherlibs/win32unix/socket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/otherlibs/win32unix/socket.c b/otherlibs/win32unix/socket.c
index dc7a157c0..4aabe5e45 100644
--- a/otherlibs/win32unix/socket.c
+++ b/otherlibs/win32unix/socket.c
@@ -17,7 +17,12 @@
#include "unixsupport.h"
int socket_domain_table[] = {
- PF_UNIX, PF_INET /*, PF_INET6 */
+ PF_UNIX, PF_INET,
+#if defined(HAS_IPV6)
+ PF_INET6
+#else
+ 0
+#endif
};
int socket_type_table[] = {
@@ -29,11 +34,13 @@ CAMLprim value unix_socket(domain, type, proto)
{
SOCKET s;
+ #ifndef HAS_IPV6
/* IPv6 requires WinSock2, we must raise an error on PF_INET6 */
if (Int_val(domain) >= sizeof(socket_domain_table)/sizeof(int)) {
win32_maperr(WSAEPFNOSUPPORT);
uerror("socket", Nothing);
}
+ #endif
s = socket(socket_domain_table[Int_val(domain)],
socket_type_table[Int_val(type)],