mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-02-16 08:20:40 +00:00
Add temporary cmake mods to make project compile on macOS, add ifdefs in 'Compat.h' for target darwin
This commit is contained in:
committed by
Lion
parent
a7db41ebaa
commit
08a62261e7
@@ -19,6 +19,23 @@ inline void CloseSocketProper(int TheSocket) {
|
||||
}
|
||||
#endif // unix
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
using SOCKET = int;
|
||||
using DWORD = unsigned long;
|
||||
using PDWORD = unsigned long*;
|
||||
using LPDWORD = unsigned long*;
|
||||
char _getch();
|
||||
inline void CloseSocketProper(int TheSocket) {
|
||||
shutdown(TheSocket, SHUT_RDWR);
|
||||
close(TheSocket);
|
||||
}
|
||||
#endif // unix
|
||||
|
||||
// ======================= WIN32 =======================
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -33,6 +50,6 @@ inline void CloseSocketProper(SOCKET TheSocket) {
|
||||
|
||||
// ======================= OTHER =======================
|
||||
|
||||
#if !defined(WIN32) && !defined(__unix)
|
||||
#if !defined(WIN32) && !defined(__unix) && !defined(__APPLE__)
|
||||
#error "OS not supported"
|
||||
#endif
|
||||
Reference in New Issue
Block a user