Fix compile error on Linux (clang and gcc)

This commit is contained in:
Kirigaya Kazuto 2018-05-04 07:15:30 +08:00
parent 8290d01644
commit 0ed154eeff

View File

@ -425,7 +425,7 @@ int udpsock::sendto(const std::string& IPStr, int Port, const void* buffer, int
int udpsock::recvfrom(std::string& fromIP, void* buffer, int bufferLength)
{
sockaddr_in saddr;
int saddrlen = sizeof(saddr);
socklen_t saddrlen = sizeof(saddr);
int ret = ::recvfrom(_pp->sfd, (char*)buffer, bufferLength, 0, (sockaddr*)&saddr, &saddrlen);
if (ret < 0)
@ -481,4 +481,4 @@ int DNSResolve(const std::string& HostName, std::string& _out_IPStr)
/// Undefine marcos
#undef myliblog
#undef myliblog