Skip to content

ENT-13766: Fix inet_ntop/inet_pton declaration check for MinGW#6051

Open
larsewi wants to merge 1 commit intocfengine:masterfrom
larsewi:ENT-13766
Open

ENT-13766: Fix inet_ntop/inet_pton declaration check for MinGW#6051
larsewi wants to merge 1 commit intocfengine:masterfrom
larsewi:ENT-13766

Conversation

@larsewi
Copy link
Contributor

@larsewi larsewi commented Mar 5, 2026

Summary

  • The AC_CHECK_DECLS for inet_ntop and inet_pton only checked <arpa/inet.h>, which does not exist on MinGW. On MinGW these functions are declared in <ws2tcpip.h>.
  • This caused HAVE_DECL_INET_NTOP=0, making platform.h re-declare inet_ntop with socklen_t. With mingw-w64 >= v11 (Ubuntu 24.04), ws2tcpip.h declares it with size_t, causing a conflicting types compilation error.
  • Include the correct Winsock headers in the check, matching the pattern already used by the getaddrinfo check above.

Ticket: ENT-13766

🤖 Generated with Claude Code

The AC_CHECK_DECLS for inet_ntop and inet_pton only checked
<arpa/inet.h>, which does not exist on MinGW. On MinGW, these
functions are declared in <ws2tcpip.h>. 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 <lars.erik.wik@northern.tech>
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants