Skip to content

Commit

Permalink
Add support for IPv6 on Windows
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pcercuei committed Apr 6, 2022
1 parent 5c65262 commit 5f17307
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ check_symbol_exists(newlocale "locale.h" HAS_NEWLOCALE)

option(ENABLE_IPV6 "Define if you want to enable IPv6 support" ON)
if (ENABLE_IPV6)
check_symbol_exists(in6addr_any "netinet/in.h" HAVE_IPV6)
if (WIN32)
set(HAVE_IPV6 ON)
else()
check_symbol_exists(in6addr_any "netinet/in.h" HAVE_IPV6)
endif()
if (NOT HAVE_IPV6)
message(SEND_ERROR "IPv6 is not available in your system.")
endif()
Expand Down
1 change: 1 addition & 0 deletions network.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sys/types.h>

#ifdef _WIN32
#include <netioapi.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#else
Expand Down

0 comments on commit 5f17307

Please sign in to comment.