Cemu/src/Common/socket.h
Exzap a5ae41fdbe build: Remove unnecessary includes to improve compile times
Also revert PCH reuse for everything but MSVC. Other compilers/platforms have limitations that make reused PCH a bit too fragile. I got it to work but only after forcing certain flags globally (like -pthread) and I dont think its a good idea to do that
2026-03-24 04:15:28 +01:00

35 lines
640 B
C

#pragma once
#if BOOST_OS_WINDOWS
#include <WinSock2.h>
#include <ws2tcpip.h>
typedef int socklen_t;
#define GETLASTERR WSAGetLastError()
#elif BOOST_OS_UNIX
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#define WSAEWOULDBLOCK EWOULDBLOCK
#define WSAEINPROGRESS EINPROGRESS
#define WSAESHUTDOWN ESHUTDOWN
#define WSAECONNABORTED ECONNABORTED
#define WSAHOST_NOT_FOUND EAI_NONAME
#define WSAENOTCONN ENOTCONN
#define GETLASTERR errno
#define SOCKET int
#define closesocket close
#define SOCKET_ERROR -1
#define INVALID_SOCKET -1
#endif // BOOST_OS_UNIX