From cbba9205ada30ff191b4fad2936986f9b293d3ce Mon Sep 17 00:00:00 2001 From: Kazuhiro Inaoka Date: Wed, 19 Apr 2006 06:36:37 +0000 Subject: [PATCH] 2006-04-19 Masaki Muranaka * m32r-rom.c: On MinGW, include winsock.h instead of sys/types.h, netdb.h, netinet/in.h. (m32r_upload_command); Add calls WSAStartup(). * remote-m32r-sdi.c: On MinGW, include winsock.h instead of netinet/in.h. --- gdb/ChangeLog | 8 ++++++++ gdb/m32r-rom.c | 11 +++++++++++ gdb/remote-m32r-sdi.c | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b2f1e91f018..3597bc0e155 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2006-04-19 Masaki Muranaka + + * m32r-rom.c: On MinGW, include winsock.h instead of sys/types.h, + netdb.h, netinet/in.h. + (m32r_upload_command); Add calls WSAStartup(). + * remote-m32r-sdi.c: On MinGW, include winsock.h instead of + netinet/in.h. + 2006-04-18 Daniel Jacobowitz * breakpoint.c (deprecated_read_memory_nobpt): Update to use diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index ca8b29e1c00..a31e0d288c0 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -46,12 +46,16 @@ /* * All this stuff just to get my host computer's IP address! */ +#ifdef __MINGW32__ +#include +#else #include #include /* for hostent */ #include /* for struct in_addr */ #if 1 #include /* for inet_ntoa */ #endif +#endif static char *board_addr; /* user-settable IP address for M32R-EVA */ static char *server_addr; /* user-settable IP address for gdb host */ @@ -435,6 +439,13 @@ m32r_upload_command (char *args, int from_tty) } if (server_addr == 0) { +#ifdef __MINGW32__ + WSADATA wd; + /* Winsock initialization. */ + if (WSAStartup (MAKEWORD (1, 1), &wd)) + error (_("Couldn't initialize WINSOCK.")); +#endif + buf[0] = 0; gethostname (buf, sizeof (buf)); if (buf[0] != 0) diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 8da4fd3023a..b2033166de3 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -31,7 +31,11 @@ #include "gdb_string.h" #include #include +#ifdef __MINGW32__ +#include +#else #include +#endif #include #include #include -- 2.30.2