Skip to content

Commit

Permalink
Remove tests for HAS_IPV6 in win32unix
Browse files Browse the repository at this point in the history
IPv6 is always enabled on Windows.
  • Loading branch information
MisterDA committed Feb 9, 2021
1 parent 6cb1044 commit b9b7b12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -62,6 +62,9 @@ Working version
directory.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)

- #10185: Consider that IPv6 is always enabled on Windows.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)

### Tools:

- #10139: Remove confusing navigation bar from stdlib documentation.
Expand Down
17 changes: 1 addition & 16 deletions otherlibs/win32unix/socket.c
Expand Up @@ -17,14 +17,7 @@
#include "unixsupport.h"

int socket_domain_table[] = {
PF_UNIX, PF_INET,
#if defined(HAS_IPV6)
PF_INET6
#elif defined(PF_UNSPEC)
PF_UNSPEC
#else
0
#endif
PF_UNIX, PF_INET, PF_INET6
};

int socket_type_table[] = {
Expand All @@ -35,14 +28,6 @@ CAMLprim value unix_socket(value cloexec, value domain, value type, value 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)],
Int_val(proto));
Expand Down
2 changes: 0 additions & 2 deletions otherlibs/win32unix/unixsupport.h
Expand Up @@ -24,10 +24,8 @@
#include <process.h>
#include <sys/types.h>
#include <winsock2.h>
#ifdef HAS_IPV6
#include <ws2tcpip.h>
#include <wspiapi.h>
#endif

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit b9b7b12

Please sign in to comment.