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 1, 2021
1 parent aeb312e commit 8e0f3a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 1 addition & 14 deletions otherlibs/win32unix/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
#include "unixsupport.h"

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

int socket_type_table[] = {
Expand All @@ -33,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
Original file line number Diff line number Diff line change
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 8e0f3a8

Please sign in to comment.