Skip to content

Commit 5f17307

Browse files
committed
Add support for IPv6 on Windows
Properly support IPv6 on Windows. It only needs an extra include in network.c. Fixes #46. Signed-off-by: Paul Cercueil <[email protected]> Suggested-by: Gisle Vanem <[email protected]>
1 parent 5c65262 commit 5f17307

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ check_symbol_exists(newlocale "locale.h" HAS_NEWLOCALE)
135135

136136
option(ENABLE_IPV6 "Define if you want to enable IPv6 support" ON)
137137
if (ENABLE_IPV6)
138-
check_symbol_exists(in6addr_any "netinet/in.h" HAVE_IPV6)
138+
if (WIN32)
139+
set(HAVE_IPV6 ON)
140+
else()
141+
check_symbol_exists(in6addr_any "netinet/in.h" HAVE_IPV6)
142+
endif()
139143
if (NOT HAVE_IPV6)
140144
message(SEND_ERROR "IPv6 is not available in your system.")
141145
endif()

network.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <sys/types.h>
2121

2222
#ifdef _WIN32
23+
#include <netioapi.h>
2324
#include <winsock2.h>
2425
#include <ws2tcpip.h>
2526
#else

0 commit comments

Comments
 (0)