Fixes to allow building for Windows.
This commit is contained in:
parent
4d6f691f48
commit
987a926a19
|
@ -38,6 +38,9 @@
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
/* On some systems this is a macro and causes problems */
|
||||||
|
#undef errno
|
||||||
|
|
||||||
static char cortexm_driver_str[] = "ARM Cortex-M";
|
static char cortexm_driver_str[] = "ARM Cortex-M";
|
||||||
|
|
||||||
static bool cortexm_vector_catch(target *t, int argc, char *argv[]);
|
static bool cortexm_vector_catch(target *t, int argc, char *argv[]);
|
||||||
|
@ -819,6 +822,10 @@ static bool cortexm_vector_catch(target *t, int argc, char *argv[])
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Windows defines this with some other meaning... */
|
||||||
|
#ifdef SYS_OPEN
|
||||||
|
# undef SYS_OPEN
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Semihosting support */
|
/* Semihosting support */
|
||||||
/* ARM Semihosting syscall numbers, from ARM doc DUI0471C, Chapter 8 */
|
/* ARM Semihosting syscall numbers, from ARM doc DUI0471C, Chapter 8 */
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
# include <sys/select.h>
|
# include <sys/select.h>
|
||||||
#else
|
#else
|
||||||
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -55,7 +56,7 @@ int gdb_if_init(void)
|
||||||
|
|
||||||
assert((gdb_if_serv = socket(PF_INET, SOCK_STREAM, 0)) != -1);
|
assert((gdb_if_serv = socket(PF_INET, SOCK_STREAM, 0)) != -1);
|
||||||
opt = 1;
|
opt = 1;
|
||||||
assert(setsockopt(gdb_if_serv, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) != -1);
|
assert(setsockopt(gdb_if_serv, SOL_SOCKET, SO_REUSEADDR, (void*)&opt, sizeof(opt)) != -1);
|
||||||
|
|
||||||
assert(bind(gdb_if_serv, (void*)&addr, sizeof(addr)) != -1);
|
assert(bind(gdb_if_serv, (void*)&addr, sizeof(addr)) != -1);
|
||||||
assert(listen(gdb_if_serv, 1) != -1);
|
assert(listen(gdb_if_serv, 1) != -1);
|
||||||
|
@ -76,7 +77,7 @@ unsigned char gdb_if_getchar(void)
|
||||||
gdb_if_conn = accept(gdb_if_serv, NULL, NULL);
|
gdb_if_conn = accept(gdb_if_serv, NULL, NULL);
|
||||||
DEBUG("Got connection\n");
|
DEBUG("Got connection\n");
|
||||||
}
|
}
|
||||||
i = recv(gdb_if_conn, &ret, 1, 0);
|
i = recv(gdb_if_conn, (void*)&ret, 1, 0);
|
||||||
if(i <= 0) {
|
if(i <= 0) {
|
||||||
gdb_if_conn = -1;
|
gdb_if_conn = -1;
|
||||||
DEBUG("Dropped broken connection\n");
|
DEBUG("Dropped broken connection\n");
|
||||||
|
@ -111,6 +112,6 @@ void gdb_if_putchar(unsigned char c, int flush)
|
||||||
(void)flush;
|
(void)flush;
|
||||||
|
|
||||||
if (gdb_if_conn > 0)
|
if (gdb_if_conn > 0)
|
||||||
send(gdb_if_conn, &c, 1, 0);
|
send(gdb_if_conn, (void*)&c, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
struct ftdi_context *ftdic;
|
struct ftdi_context *ftdic;
|
||||||
|
|
|
@ -26,7 +26,9 @@
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
#else
|
#else
|
||||||
|
# ifndef alloca
|
||||||
# define alloca __builtin_alloca
|
# define alloca __builtin_alloca
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FT2232_VID 0x0403
|
#define FT2232_VID 0x0403
|
||||||
|
|
Loading…
Reference in New Issue