build: include wincrypt.h for if_nametoindex detection

This commit is contained in:
Viktor Szakats 2025-07-24 16:01:45 +02:00
parent 9bad7ec86b
commit 2dada9e472
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 3 additions and 1 deletions

View file

@ -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)

View file

@ -4275,6 +4275,7 @@ if test "$curl_cv_native_windows" = 'yes'; then
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#include <wincrypt.h> /* for mingw-w64 __MINGW64_VERSION_MAJOR <= 5 */
#include <iphlpapi.h>
]],[[
if_nametoindex("");