From 4e3fa2ebad17594b1667ff7513ea5150110f7bad Mon Sep 17 00:00:00 2001 From: shiyu1994 Date: Wed, 5 Jan 2022 11:05:44 +0800 Subject: [PATCH] apply patch for R4.2 on Windows (#4923) --- 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 caa12c27913..e4d63c434fc 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))