From 0ed154eeff8e62d4ec07eb3bc828f6d70a3eb0e1 Mon Sep 17 00:00:00 2001 From: Kiritow-Tablet <1362050620@qq.com> Date: Fri, 4 May 2018 07:15:30 +0800 Subject: [PATCH] Fix compile error on Linux (clang and gcc) --- gsock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsock.cpp b/gsock.cpp index 03a343c..824e045 100644 --- a/gsock.cpp +++ b/gsock.cpp @@ -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 \ No newline at end of file