Browse Source

libuv: Backport MinGW-w64 compilation fix to CMake 3.22 branch

Backport libuv commit `3e90bc76` (build: fix build failures with MinGW
new headers, 2021-11-03).

Fixes: #22916
Brad King 4 years ago
parent
commit
acc14edd70
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Utilities/cmlibuv/include/uv/win.h

+ 7 - 0
Utilities/cmlibuv/include/uv/win.h

@@ -45,7 +45,14 @@ typedef struct pollfd {
 #endif
 #endif
 
 
 #include <mswsock.h>
 #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>
 #include <ws2tcpip.h>
+#undef _TCP_INITIAL_RTO_PARAMETERS
+#undef TCP_INITIAL_RTO_PARAMETERS
+#undef PTCP_INITIAL_RTO_PARAMETERS
 #include <windows.h>
 #include <windows.h>
 
 
 #include <process.h>
 #include <process.h>