diff -Nru orig/lightgbm/src/network/socket_wrapper.hpp patched/lightgbm/src/network/socket_wrapper.hpp
--- orig/lightgbm/src/network/socket_wrapper.hpp	2021-04-12 20:27:51.000000000 +0200
+++ patched/lightgbm/src/network/socket_wrapper.hpp	2021-08-05 12:11:21.310968600 +0200
@@ -60,6 +60,9 @@
 #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 @@
 }
 #endif
 #endif
+#endif
 
 #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
 #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
