From 5f17307b018644246e3c50ed51f881354239d107 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Mon, 4 Apr 2022 15:23:30 +0100 Subject: [PATCH] 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 Suggested-by: Gisle Vanem --- CMakeLists.txt | 6 +++++- network.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84cd629b7..e65c945e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/network.c b/network.c index 20f3be1e6..cdedf5e9b 100644 --- a/network.c +++ b/network.c @@ -20,6 +20,7 @@ #include #ifdef _WIN32 +#include #include #include #else