build: fix build failures with MinGW new headers

A structure definition was added to mstcpip.h in
mingw-w64-x86_64-headers-git 9.0.0.6327.f29c1101f,
which causes a conflict and the build fails. Fix this by
changing the name in the definition in mstcpip.h.

PR-URL: https://github.com/libuv/libuv/pull/3345
This commit is contained in:
erw7 2021-11-03 00:28:42 +09:00 committed by GitHub
parent 26b2e5dbb6
commit 3e90bc76b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,14 @@ typedef struct pollfd {
#endif
#include <mswsock.h>
// Disable the typedef in mstcpip.h of MinGW.
#define _TCP_INITIAL_RTO_PARAMETERS _TCP_INITIAL_RTO_PARAMETERS__AVOID
#define TCP_INITIAL_RTO_PARAMETERS TCP_INITIAL_RTO_PARAMETERS__AVOID
#define PTCP_INITIAL_RTO_PARAMETERS PTCP_INITIAL_RTO_PARAMETERS__AVOID
#include <ws2tcpip.h>
#undef _TCP_INITIAL_RTO_PARAMETERS
#undef TCP_INITIAL_RTO_PARAMETERS
#undef PTCP_INITIAL_RTO_PARAMETERS
#include <windows.h>
#include <process.h>