From b189df947d2625499cf508fd1fae7e18b03b9247 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 15 Apr 2017 18:13:47 +0100 Subject: [PATCH] Condition out some API type-checks in the MinGW build. A couple of the functions for which I was already turning off the type check for old Visual Studio turn out to also need it turning off for MinGW. --- windows/winhsock.c | 7 ++++--- windows/winnet.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) 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);