diff --git a/BasiliskII/src/slirp/misc.c b/BasiliskII/src/slirp/misc.c index 8af63a18..233c965f 100644 --- a/BasiliskII/src/slirp/misc.c +++ b/BasiliskII/src/slirp/misc.c @@ -822,7 +822,7 @@ fd_nonblock(fd) int fd; { #if defined USE_FIONBIO && defined FIONBIO - int opt = 1; + ioctlsockopt_t opt = 1; ioctlsocket(fd, FIONBIO, &opt); #else @@ -839,7 +839,7 @@ fd_block(fd) int fd; { #if defined USE_FIONBIO && defined FIONBIO - int opt = 0; + ioctlsockopt_t opt = 0; ioctlsocket(fd, FIONBIO, &opt); #else diff --git a/BasiliskII/src/slirp/slirp.h b/BasiliskII/src/slirp/slirp.h index 698a2b3f..5a48c87f 100644 --- a/BasiliskII/src/slirp/slirp.h +++ b/BasiliskII/src/slirp/slirp.h @@ -19,19 +19,29 @@ typedef uint16_t u_int16_t; typedef uint32_t u_int32_t; typedef uint64_t u_int64_t; typedef char *caddr_t; +typedef int socklen_t; +typedef unsigned long ioctlsockopt_t; # include # include # include # include +# define USE_FIONBIO 1 # define EWOULDBLOCK WSAEWOULDBLOCK # define EINPROGRESS WSAEINPROGRESS # define ENOTCONN WSAENOTCONN # define EHOSTUNREACH WSAEHOSTUNREACH # define ENETUNREACH WSAENETUNREACH # define ECONNREFUSED WSAECONNREFUSED + +/* Basilisk II Router defines those */ +# define udp_read_completion slirp_udp_read_completion +# define write_udp slirp_write_udp +# define init_udp slirp_init_udp +# define final_udp slirp_final_udp #else +typedef int ioctlsockopt_t; # define ioctlsocket ioctl # define closesocket(s) close(s) # define O_BINARY 0 diff --git a/BasiliskII/src/slirp/socket.c b/BasiliskII/src/slirp/socket.c index ce874e0f..f2afd068 100644 --- a/BasiliskII/src/slirp/socket.c +++ b/BasiliskII/src/slirp/socket.c @@ -415,7 +415,8 @@ sorecvfrom(so) udp_detach(so); } else { /* A "normal" UDP packet */ struct mbuf *m; - int len, n; + int len; + ioctlsockopt_t n; if (!(m = m_get())) return; m->m_data += if_maxlinkhdr;