Refactor isagain()

This commit is contained in:
twinaphex 2015-01-24 01:10:44 +01:00
parent d18dd94ad3
commit 71848c69dd

View File

@ -72,10 +72,14 @@
static INLINE bool isagain(int bytes)
{
#if defined(_WIN32) && !defined(_XBOX)
return (bytes == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK);
#elif defined(_XBOX)
return (bytes == SOCKET_ERROR);
#if defined(_WIN32)
if (bytes != SOCKET_ERROR)
return false;
#ifndef _XBOX
if (WSAGetLastError() != WSAEWOULDBLOCK)
return false;
#endif
return true;
#else
return (bytes < 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
#endif