summaryrefslogtreecommitdiff
path: root/gdb_remote.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2020-04-30 23:15:50 -0700
committerMichael Pavone <pavone@retrodev.com>2020-04-30 23:15:50 -0700
commit2b6dcd8e9058ceb6ea32a04aa1e1d4a13d682529 (patch)
treebb4eb3b1bac6f9debed1f26c4d5a5270167d5632 /gdb_remote.c
parent083332cf627f720317d97c5956565834e70e28c9 (diff)
Get WIP net play code compiling on Windows and cleanup some unistd.h includes
Diffstat (limited to 'gdb_remote.c')
-rw-r--r--gdb_remote.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb_remote.c b/gdb_remote.c
index 001fe47..6cf1d67 100644
--- a/gdb_remote.c
+++ b/gdb_remote.c
@@ -18,13 +18,13 @@ int gdb_sock;
#define GDB_OUT_FD STDOUT_FILENO
#define GDB_READ read
#define GDB_WRITE write
+#include <unistd.h>
#endif
#include "gdb_remote.h"
#include "68kinst.h"
#include "debug.h"
#include "util.h"
-#include <unistd.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
@@ -558,21 +558,13 @@ void gdb_debug_enter(m68k_context * context, uint32_t pc)
}
}
-#ifdef _WIN32
-void gdb_cleanup(void)
-{
- WSACleanup();
-}
-WSADATA wsa_data;
-#endif
-
void gdb_remote_init(void)
{
buf = malloc(INITIAL_BUFFER_SIZE);
curbuf = NULL;
bufsize = INITIAL_BUFFER_SIZE;
#ifdef _WIN32
- WSAStartup(MAKEWORD(2,2), &wsa_data);
+ socket_init();
struct addrinfo request, *result;
memset(&request, 0, sizeof(request));
@@ -596,7 +588,7 @@ void gdb_remote_init(void)
if (gdb_sock < 0) {
fatal_error("accept returned an error while listening on GDB remote debugging socket");
}
- closesocket(listen_sock);
+ socket_close(listen_sock);
#else
disable_stdout_messages();
#endif