From cdd65f792c26fa5166a1762d66856f4c29350a81 Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Mon, 3 Jan 2022 07:56:28 +0000 Subject: [PATCH] apply patch for R4.2 on Windows --- src/network/socket_wrapper.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/socket_wrapper.hpp b/src/network/socket_wrapper.hpp index caa12c279133..e4d63c434fc4 100644 --- a/src/network/socket_wrapper.hpp +++ b/src/network/socket_wrapper.hpp @@ -60,6 +60,9 @@ const int INVALID_SOCKET = -1; #endif #ifdef _WIN32 +#ifndef _UCRT +// Recent MinGW has inet_pton, which then causes compiler error in +// combination with this replacement. #ifndef _MSC_VER // not using visual studio in windows inline int inet_pton(int af, const char *src, void *dst) { @@ -86,6 +89,7 @@ inline int inet_pton(int af, const char *src, void *dst) { } #endif #endif +#endif #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))