m32r-elf target on MinGW.

Masaki MURANAKA monaka@monami-software.com
Sun Apr 16 01:39:00 GMT 2006


Hello,

On 2006/04/16, at 8:46, Masaki MURANAKA wrote:
> Anyway, I'll test HEAD soon.

Here is a diff from HEAD.


----
2006-04-16  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.
----
Index: m32r-rom.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-rom.c,v
retrieving revision 1.26
diff -u -r1.26 m32r-rom.c
--- m32r-rom.c  17 Dec 2005 22:34:01 -0000      1.26
+++ m32r-rom.c  16 Apr 2006 01:31:29 -0000
@@ -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 @@
      }
    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)
Index: remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.17
diff -u -r1.17 remote-m32r-sdi.c
--- remote-m32r-sdi.c   24 Jan 2006 22:09:28 -0000      1.17
+++ remote-m32r-sdi.c   16 Apr 2006 01:31:30 -0000
@@ -31,7 +31,11 @@
#include "gdb_string.h"
#include <ctype.h>
#include <signal.h>
+#ifdef __MINGW32__
+#include <winsock.h>
+#else
#include <netinet/in.h>
+#endif
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>

--
Masaki Muranaka
Monami software




More information about the Gdb-patches mailing list