mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-16 07:50:28 +02:00
Centralize socket-related includes, introduce socket_errno
This resolves some weird inconsistentes and include order problems related to errno. Needed for the next steps.
This commit is contained in:
1 parent
3b81cb9f2a
commit
c3aa0f7452
17 files changed
+131
-327
No files matched your search
@@ -1,19 +1,8 @@
|
||||
#include "ppsspp_config.h"
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#undef min
|
||||
#undef max
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
#ifndef MSG_NOSIGNAL
|
||||
// Default value to 0x00 (do nothing) in systems where it's not supported.
|
||||
#define MSG_NOSIGNAL 0x00
|
||||
#endif
|
||||
#include "Common/Net/SocketCompat.h"
|
||||
|
||||
#if _MSC_VER
|
||||
#pragma warning(disable:4267)
|
||||
@@ -98,11 +87,7 @@ bool Buffer::ReadAllWithProgress(int fd, int knownSize, RequestProgress *progres
|
||||
if (retval == 0) {
|
||||
return true;
|
||||
} else if (retval < 0) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK) {
|
||||
#else
|
||||
if (errno != EWOULDBLOCK) {
|
||||
#endif
|
||||
if (socket_errno != EWOULDBLOCK) {
|
||||
ERROR_LOG(Log::IO, "Error reading from buffer: %i", retval);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user