diff options
author | Jonathan Protzenko <Jonathan.Protzenko@ens-lyon.org> | 2012-07-13 12:15:57 +0000 |
---|---|---|
committer | Jonathan Protzenko <Jonathan.Protzenko@ens-lyon.org> | 2012-07-13 12:15:57 +0000 |
commit | 7bb9ab2e0cbdc2d07d12952703bba3a9de66952d (patch) | |
tree | 0cc280ab30afe6a88dc4dc091e9bfbb19285082b /otherlibs/win32unix/socket.c | |
parent | 776c46fce82af1c7d8ac0ce490c42bc5106a5cf6 (diff) |
PR#5676: add ipv6 support on Windows.
Patch by Jérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12710 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/socket.c')
-rw-r--r-- | otherlibs/win32unix/socket.c | 9 |
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)], |