mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-24 06:01:02 +00:00
Fix some compilation warnings
This commit is contained in:
@@ -68,10 +68,10 @@ namespace network
|
||||
|
||||
bool socket::send(const address& target, const void* data, const size_t size) const
|
||||
{
|
||||
const int res = sendto(this->socket_, static_cast<const char*>(data), static_cast<int>(size), 0,
|
||||
const auto res = sendto(this->socket_, static_cast<const char*>(data), static_cast<send_size>(size), 0,
|
||||
&target.get_addr(),
|
||||
target.get_size());
|
||||
return res == static_cast<int>(size);
|
||||
static_cast<socklen_t>(target.get_size()));
|
||||
return static_cast<size_t>(res) == size;
|
||||
}
|
||||
|
||||
bool socket::send(const address& target, const std::string& data) const
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
using socklen_t = int;
|
||||
using send_size = int;
|
||||
#define GET_SOCKET_ERROR() (WSAGetLastError())
|
||||
#define poll WSAPoll
|
||||
#define SOCK_WOULDBLOCK WSAEWOULDBLOCK
|
||||
#else
|
||||
using SOCKET = int;
|
||||
using send_size = ssize_t;
|
||||
#define INVALID_SOCKET (SOCKET)(~0)
|
||||
#define SOCKET_ERROR (-1)
|
||||
#define GET_SOCKET_ERROR() (errno)
|
||||
|
||||
Reference in New Issue
Block a user