Attempted buildfix for net_socket

This commit is contained in:
libretroadmin 2022-05-31 05:43:09 +02:00
parent 4c3482faab
commit 17d31e6dff
2 changed files with 12 additions and 6 deletions

View File

@ -69,8 +69,8 @@ bool socket_set_block(int fd, bool block);
/* TODO: all callers should be converted to socket_set_block() */
bool socket_nonblock(int fd);
int socket_select(int nfds, fd_set *readfs, fd_set *writefds,
fd_set *errorfds, struct timeval *timeout);
int socket_select(int nfds, void *readfs, void *writefds,
void *errorfds, struct timeval *timeout);
bool socket_send_all_blocking(int fd, const void *data_, size_t size, bool no_signal);

View File

@ -216,17 +216,20 @@ int socket_close(int fd)
#endif
}
int socket_select(int nfds, fd_set *readfs, fd_set *writefds,
fd_set *errorfds, struct timeval *timeout)
int socket_select(int nfds, void *_readfs, void *_writefds,
void *_errorfds, struct timeval *timeout)
{
#if !defined(__PSL1GHT__) && defined(__PS3__)
fd_set *readfs = (fd_set*)_readfs;
fd_set *writefds = (fd_set*)_writefds;
fd_set *errorfds = (fd_set*)_errorfds;
return socketselect(nfds, readfs, writefds, errorfds, timeout);
#elif defined(VITA)
extern int retro_epoll_fd;
SceNetEpollEvent ev = {0};
ev.events = SCE_NET_EPOLLIN | SCE_NET_EPOLLHUP;
ev.data.fd = nfds;
ev.events = SCE_NET_EPOLLIN | SCE_NET_EPOLLHUP;
ev.data.fd = nfds;
if((sceNetEpollControl(retro_epoll_fd, SCE_NET_EPOLL_CTL_ADD, nfds, &ev)))
{
@ -236,6 +239,9 @@ int socket_select(int nfds, fd_set *readfs, fd_set *writefds,
}
return 0;
#else
fd_set *readfs = (fd_set*)_readfs;
fd_set *writefds = (fd_set*)_writefds;
fd_set *errorfds = (fd_set*)_errorfds;
return select(nfds, readfs, writefds, errorfds, timeout);
#endif
}