From 2dada9e472ad2b35513ab0d5f1cbac4bfa5363f7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 24 Jul 2025 16:01:45 +0200 Subject: [PATCH] build: include wincrypt.h for if_nametoindex detection --- CMakeLists.txt | 3 ++- configure.ac | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 334b5c3865..10d171bcc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1785,7 +1785,8 @@ check_function_exists("setlocale" HAVE_SETLOCALE) check_function_exists("setrlimit" HAVE_SETRLIMIT) if(WIN32) - check_symbol_exists("if_nametoindex" "winsock2.h;iphlpapi.h" HAVE_IF_NAMETOINDEX) # Windows Vista+ non-UWP + # include wincrypt.h for mingw-w64 __MINGW64_VERSION_MAJOR <= 5 */ + check_symbol_exists("if_nametoindex" "winsock2.h;wincrypt.h;iphlpapi.h" HAVE_IF_NAMETOINDEX) # Windows Vista+ non-UWP */ else() check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h check_function_exists("realpath" HAVE_REALPATH) diff --git a/configure.ac b/configure.ac index acf253eadc..2fafff1fdf 100644 --- a/configure.ac +++ b/configure.ac @@ -4275,6 +4275,7 @@ if test "$curl_cv_native_windows" = 'yes'; then #define WIN32_LEAN_AND_MEAN #endif #include + #include /* for mingw-w64 __MINGW64_VERSION_MAJOR <= 5 */ #include ]],[[ if_nametoindex("");