From d50e0094bf21bf908100d04730677b968bd8b59d Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 5 Mar 2026 16:18:20 +0100 Subject: [PATCH] Fix inet_ntop/inet_pton declaration check for MinGW cross-compilation The AC_CHECK_DECLS for inet_ntop and inet_pton only checked , which does not exist on MinGW. On MinGW, these functions are declared in . This caused the check to fail, leaving HAVE_DECL_INET_NTOP=0, which made platform.h re-declare inet_ntop with socklen_t. With mingw-w64 >= v11 (Ubuntu 24.04), ws2tcpip.h declares inet_ntop with size_t, causing a conflicting types error. Include the correct Winsock headers in the check, matching the pattern already used by the getaddrinfo check above. Ticket: ENT-13766 Signed-off-by: Lars Erik Wik --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6cac4631..329954b9 100644 --- a/configure.ac +++ b/configure.ac @@ -807,7 +807,16 @@ AC_CHECK_DECLS(getaddrinfo, [], [AC_LIBOBJ(getaddrinfo)], [[ #endif ]]) -AC_CHECK_DECLS([[inet_ntop], [inet_pton]], [], [], [[#include ]]) +AC_CHECK_DECLS([[inet_ntop], [inet_pton]], [], [], [[ +#if HAVE_WINSOCK2_H + #include +#endif +#if HAVE_WS2TCPIP_H + #include +#else + #include +#endif +]]) AC_REPLACE_FUNCS(inet_ntop inet_pton) AC_CHECK_FUNCS(getifaddrs)