From 41fa577fbc326402be49b3f03bc828e52dba8b88 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Mar 2019 15:13:54 +0200 Subject: Fix GDB compilation on MinGW (PR gdb/24292) gdb/ChangeLog: 2019-03-02 Eli Zaretskii PR gdb/24292 * common/netstuff.c: * gdbserver/gdbreplay.c * gdbserver/remote-utils.c: * ser-tcp.c: * unittests/parse-connection-spec-selftests.c [USE_WIN32API]: Include ws2tcpip.h instead of wsiapi.h and winsock2.h. Redefine _WIN32_WINNT to 0x0501 if defined to a smaller value, as 'getaddrinfo' and 'freeaddrinfo' were not available before Windows XP, and mingw.org's MinGW headers by default define _WIN32_WINNT to 0x500. --- gdb/unittests/parse-connection-spec-selftests.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gdb/unittests') diff --git a/gdb/unittests/parse-connection-spec-selftests.c b/gdb/unittests/parse-connection-spec-selftests.c index ac7cd41e212..969c51e4e88 100644 --- a/gdb/unittests/parse-connection-spec-selftests.c +++ b/gdb/unittests/parse-connection-spec-selftests.c @@ -22,8 +22,11 @@ #include "common/netstuff.h" #include "diagnostics.h" #ifdef USE_WIN32API -#include -#include +#if _WIN32_WINNT < 0x0501 +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +#endif +#include #else #include #include -- cgit v1.2.1