diff --git a/windows/winhsock.c b/windows/winhsock.c index e5f0fa4f..c8cb46f6 100644 --- a/windows/winhsock.c +++ b/windows/winhsock.c @@ -282,9 +282,10 @@ static char *sk_handle_peer_info(Socket s) if (!kernel32_module) { kernel32_module = load_system32_dll("kernel32.dll"); -#if defined _MSC_VER && _MSC_VER < 1900 - /* For older Visual Studio, this function isn't available in - * the header files to type-check */ +#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__ + /* For older Visual Studio, and MinGW too (at least as of + * Ubuntu 16.04), this function isn't available in the header + * files to type-check */ GET_WINDOWS_FUNCTION_NO_TYPECHECK( kernel32_module, GetNamedPipeClientProcessId); #else diff --git a/windows/winnet.c b/windows/winnet.c index 7ceca486..fc26c3e5 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -314,9 +314,9 @@ void sk_init(void) GET_WINDOWS_FUNCTION(winsock_module, getservbyname); GET_WINDOWS_FUNCTION(winsock_module, inet_addr); GET_WINDOWS_FUNCTION(winsock_module, inet_ntoa); -#if defined _MSC_VER && _MSC_VER < 1900 - /* Older Visual Studio doesn't know about this function at all, so - * can't type-check it */ +#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__ + /* Older Visual Studio, and MinGW as of Ubuntu 16.04, don't know + * about this function at all, so can't type-check it */ GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, inet_ntop); #else GET_WINDOWS_FUNCTION(winsock_module, inet_ntop);