ENT-13766: Fix inet_ntop/inet_pton declaration check for MinGW#6051
Open
larsewi wants to merge 1 commit intocfengine:masterfrom
Open
ENT-13766: Fix inet_ntop/inet_pton declaration check for MinGW#6051larsewi wants to merge 1 commit intocfengine:masterfrom
larsewi wants to merge 1 commit intocfengine:masterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AC_CHECK_DECLSforinet_ntopandinet_ptononly checked<arpa/inet.h>, which does not exist on MinGW. On MinGW these functions are declared in<ws2tcpip.h>.HAVE_DECL_INET_NTOP=0, makingplatform.hre-declareinet_ntopwithsocklen_t. With mingw-w64 >= v11 (Ubuntu 24.04),ws2tcpip.hdeclares it withsize_t, causing a conflicting types compilation error.getaddrinfocheck above.Ticket: ENT-13766
🤖 Generated with Claude Code