medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ddab3970cdaf0016b23e4f3ec907b27774f09542
parent a59b0e5edf6c4d67d2b375a10b874e76c789179e
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Wed Dec 28 12:32:41 +0200

MSVC compile errors

Diffstat:
platform_network.h | 4++--
win32_network.h | 8+-------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/platform_network.h b/platform_network.h @@ -62,9 +62,9 @@ inline void sock_send_udp( Socket sock, const WriteStream & ws, const sockaddr_i } inline void sock_destroy( Socket * sock ) { - int ok = close( sock->fd ); + int ok = closesocket( sock->fd ); if( ok == -1 ) { - FATAL( "close" ); + FATAL( "closesocket" ); } sock->fd = -1; } diff --git a/win32_network.h b/win32_network.h @@ -3,12 +3,6 @@ #include <winsock2.h> #include <ws2tcpip.h> -struct Socket { - SOCKET fd; - TransportProtocol transport; - IPvX ipvx; -}; - inline void net_init() { WSADATA wsa_data; if( WSAStartup( MAKEWORD( 2, 2 ), &wsa_data ) == SOCKET_ERROR ) { @@ -33,7 +27,7 @@ inline void sock_fd_nonblocking( int fd ) { inline bool sock_tryrecv_udp( Socket sock, char * buf, size_t len, sockaddr_storage * addr, socklen_t * addr_len, size_t * bytes_received ) { ASSERT( sock.transport == NET_UDP ); - ssize_t received = recvfrom( sock.fd, buf, len, 0, ( sockaddr * ) addr, addr_len ); + int received = recvfrom( sock.fd, buf, len, 0, ( sockaddr * ) addr, addr_len ); if( received == SOCKET_ERROR ) { int error = WSAGetLastError(); if( error == WSAEWOULDBLOCK || error == WSAECONNRESET ) {