sys: Fix sockets compiling on Unix

This commit is contained in:
WerWolv
2021-12-07 23:09:30 +01:00
parent cc5a437573
commit c55146a78c
2 changed files with 26 additions and 11 deletions

View File

@@ -7,10 +7,17 @@
#if defined(OS_WINDOWS)
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#define SOCKET_NONE INVALID_SOCKET
#else
#include <unistd.h>
#include <sys/sock.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#define SOCKET_NONE -1
#endif
namespace hex {
@@ -39,9 +46,9 @@ namespace hex {
private:
bool m_connected = false;
#if defined(OS_WINDOWS)
SOCKET m_socket = INVALID_SOCKET;
SOCKET m_socket = SOCKET_NONE;
#else
int m_socket = -1;
int m_socket = SOCKET_NONE;
#endif
};