From 294f0f6cdee3dc9cdb896c4d14c0af6a9e955e3c Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 5 Mar 2026 16:19:29 +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 ae69ca1444..175c04d2f3 100644 --- a/configure.ac +++ b/configure.ac @@ -1229,7 +1229,16 @@ AC_CHECK_DECLS(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_CHECK_FUNCS(getifaddrs)