summaryrefslogtreecommitdiff
path: root/gdb/m32r-rom.c
diff options
context:
space:
mode:
authorKazuhiro Inaoka <inaoka.kazuhiro@renesas.com>2006-04-19 06:36:37 +0000
committerKazuhiro Inaoka <inaoka.kazuhiro@renesas.com>2006-04-19 06:36:37 +0000
commitd690a201638043fbcce29ee715032895f9901036 (patch)
tree647407eb462a287c71f0f698e1e168e421426f34 /gdb/m32r-rom.c
parent7d56cad7460d43f26cc249f4154abeb18aa447f7 (diff)
downloadgdb-d690a201638043fbcce29ee715032895f9901036.tar.gz
2006-04-19 Masaki Muranaka <monaka@monami-software.com>
* 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.
Diffstat (limited to 'gdb/m32r-rom.c')
-rw-r--r--gdb/m32r-rom.c11
1 files changed, 11 insertions, 0 deletions
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 <winsock.h>
+#else
#include <sys/types.h>
#include <netdb.h> /* for hostent */
#include <netinet/in.h> /* for struct in_addr */
#if 1
#include <arpa/inet.h> /* 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)