1
0
forked from fsfw/fsfw

platform header file

This commit is contained in:
2021-05-12 16:47:53 +02:00
parent d27f49c968
commit 1626b266d7
10 changed files with 42 additions and 48 deletions

View File

@ -1,10 +1,9 @@
#include "TcpIpBase.h"
#include "../../platform.h"
#ifdef __unix__
#ifdef PLATFORM_UNIX
#include <errno.h>
#include <unistd.h>
#endif
TcpIpBase::TcpIpBase() {
@ -37,17 +36,17 @@ TcpIpBase::~TcpIpBase() {
}
int TcpIpBase::closeSocket(socket_t socket) {
#ifdef _WIN32
#ifdef PLATFORM_WIN
return closesocket(socket);
#elif defined(__unix__)
#elif defined(PLATFORM_UNIX)
return close(socket);
#endif
}
int TcpIpBase::getLastSocketError() {
#ifdef _WIN32
#ifdef PLATFORM_WIN
return WSAGetLastError();
#elif defined(__unix__)
#elif defined(PLATFORM_UNIX)
return errno;
#endif
}