Unverified Commit f2473e03 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #641

Fix build on msvc
parents 9dbcc11d d3457bf7
...@@ -683,7 +683,7 @@ bool read_datagram(size_t& result, native_socket fd, void* buf, size_t buf_len, ...@@ -683,7 +683,7 @@ bool read_datagram(size_t& result, native_socket fd, void* buf, size_t buf_len,
CAF_LOG_TRACE(CAF_ARG(fd)); CAF_LOG_TRACE(CAF_ARG(fd));
memset(ep.address(), 0, sizeof(sockaddr_storage)); memset(ep.address(), 0, sizeof(sockaddr_storage));
socklen_t len = sizeof(sockaddr_storage); socklen_t len = sizeof(sockaddr_storage);
auto sres = ::recvfrom(fd, buf, buf_len, 0, ep.address(), &len); auto sres = ::recvfrom(fd, static_cast<socket_recv_ptr>(buf), buf_len, 0, ep.address(), &len);
if (is_error(sres, true)) { if (is_error(sres, true)) {
CAF_LOG_ERROR("recvfrom returned" << CAF_ARG(sres)); CAF_LOG_ERROR("recvfrom returned" << CAF_ARG(sres));
return false; return false;
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#include "caf/logger.hpp" #include "caf/logger.hpp"
#ifdef CAF_WINDOWS #ifdef CAF_WINDOWS
# include <windows.h>
# include <winsock2.h> # include <winsock2.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
# include <ws2ipdef.h> # include <ws2ipdef.h>
# include <windows.h>
#else #else
# include <unistd.h> # include <unistd.h>
# include <cerrno> # include <cerrno>
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
# include <netinet/ip.h> # include <netinet/ip.h>
#endif #endif
#ifdef CAF_WINDOWS
using sa_family_t = short;
#endif
namespace { namespace {
template <class SizeType = size_t> template <class SizeType = size_t>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment