diff options
author | Eli Zaretskii <eliz@gnu.org> | 2019-03-02 15:13:54 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2019-03-02 15:13:54 +0200 |
commit | 41fa577fbc326402be49b3f03bc828e52dba8b88 (patch) | |
tree | a3fd0037cc7b54e522697d9694ec2a1c8a541360 /gdb/gdbserver | |
parent | ca5a17b09eabb24301c8591440670613385a9026 (diff) | |
download | gdb-41fa577fbc326402be49b3f03bc828e52dba8b88.zip gdb-41fa577fbc326402be49b3f03bc828e52dba8b88.tar.gz gdb-41fa577fbc326402be49b3f03bc828e52dba8b88.tar.bz2 |
Fix GDB compilation on MinGW (PR gdb/24292)
gdb/ChangeLog:
2019-03-02 Eli Zaretskii <eliz@gnu.org>
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.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/gdbreplay.c | 7 | ||||
-rw-r--r-- | gdb/gdbserver/remote-utils.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index bda8095..63303ee 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -45,8 +45,11 @@ #endif #if USE_WIN32API -#include <winsock2.h> -#include <wspiapi.h> +#if _WIN32_WINNT < 0x0501 +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +#endif +#include <ws2tcpip.h> #endif #include "common/netstuff.h" diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index ad0228d..4e6f9c6 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -63,8 +63,11 @@ #include <sys/stat.h> #if USE_WIN32API -#include <winsock2.h> -#include <wspiapi.h> +#if _WIN32_WINNT < 0x0501 +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +#endif +#include <ws2tcpip.h> #endif #if __QNX__ |