(WiiU) fix netplay.

This commit is contained in:
aliaspider 2017-05-26 12:32:45 +01:00
parent e18a5716e3
commit 5a92ec15cf
4 changed files with 12 additions and 2 deletions

View File

@ -158,6 +158,8 @@ static INLINE bool isagain(int bytes)
return true;
#elif defined(VITA)
return (bytes<0 && (bytes == SCE_NET_ERROR_EAGAIN || bytes == SCE_NET_ERROR_EWOULDBLOCK));
#elif defined(WIIU)
return (bytes == -1) && ((socketlasterr() == SO_SUCCESS) || (socketlasterr() == SO_EWOULDBLOCK));
#else
return (bytes < 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
#endif

View File

@ -5,7 +5,7 @@
extern "C" {
#endif
#define TCP_NODELAY 0x2004
#ifdef __cplusplus
}

View File

@ -7,7 +7,7 @@
extern "C" {
#endif
#define SOL_SOCKET 0xFFFF
#define SOL_SOCKET -1
#define INADDR_ANY 0
@ -24,6 +24,11 @@ extern "C" {
#define SO_NBIO 0x1014
// return codes
#define SO_SUCCESS 0
#define SO_EWOULDBLOCK 6
typedef uint32_t socklen_t;
typedef uint16_t sa_family_t;
@ -63,6 +68,8 @@ int shutdown(int sockfd, int how);
int socket(int domain, int type, int protocol);
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
int socketlasterr(void);
#ifdef __cplusplus
}
#endif

View File

@ -127,6 +127,7 @@ IMPORT(setsockopt);
IMPORT(shutdown);
IMPORT(socket);
IMPORT(select);
IMPORT(socketlasterr);
IMPORT_END();