[cmake] refactor: SDL2 CI and CPMUtil::AddCIPackage #284
3 changed files with 5 additions and 5 deletions
|
@ -12,7 +12,7 @@
|
|||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#elif defined(__unix__)
|
||||
#elif defined(__unix__) || defined(__APPLE__)
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -162,7 +162,7 @@ Errno TranslateNativeError(int e, CallType call_type = CallType::Other) {
|
|||
}
|
||||
}
|
||||
|
||||
#elif defined(__unix__) // ^ _WIN32 v __unix__
|
||||
#elif defined(__unix__) || defined(__APPLE__) // ^ _WIN32 v __unix__
|
||||
|
||||
using SOCKET = int;
|
||||
using WSAPOLLFD = pollfd;
|
||||
|
|
|
@ -104,7 +104,7 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) {
|
|||
auto& bytes = addr.S_un.S_un_b;
|
||||
return IPv4Address{bytes.s_b1, bytes.s_b2, bytes.s_b3, bytes.s_b4};
|
||||
}
|
||||
#elif defined(__unix__)
|
||||
#elif defined(__unix__) || defined(__APPLE__)
|
||||
constexpr IPv4Address TranslateIPv4(in_addr addr) {
|
||||
const u32 bytes = addr.s_addr;
|
||||
return IPv4Address{static_cast<u8>(bytes), static_cast<u8>(bytes >> 8),
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#if defined(_WIN32)
|
||||
// windows
|
||||
#elif defined(__unix__)
|
||||
#elif defined(__unix__) || defined(__APPLE__)
|
||||
// unix
|
||||
#else
|
||||
// haiku
|
||||
|
@ -28,7 +28,7 @@ struct ProxyPacket;
|
|||
|
||||
class SocketBase {
|
||||
public:
|
||||
#ifdef __unix__
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
using SOCKET = int;
|
||||
static constexpr SOCKET INVALID_SOCKET = -1;
|
||||
static constexpr SOCKET SOCKET_ERROR = -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue