From ffcfcb5baf323bb811fd3be6c5b664256d5a5371 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Wed, 9 May 2018 21:30:34 +0800 Subject: [PATCH] Fix compile error with VS --- gsock.cpp | 2 +- gsock.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gsock.cpp b/gsock.cpp index 79dec50..324d662 100644 --- a/gsock.cpp +++ b/gsock.cpp @@ -217,7 +217,7 @@ int sock::setrecvtime(int Second) } //forgive me, but writing code in hospital is really not a good experience. -typedef int (*_sock_getname_callback_t)(int,sockaddr*,socklen_t*); +using _sock_getname_callback_t = decltype(getsockname); static int _sock_getname_call(int sfd,std::string& ip,int& port,_sock_getname_callback_t fn) { diff --git a/gsock.h b/gsock.h index 6b8586a..bbcfa83 100644 --- a/gsock.h +++ b/gsock.h @@ -15,11 +15,11 @@ protected: vsock(); vsock(const vsock&)=delete; vsock& operator = (const vsock&)=delete; - vsock(vsock&&); - vsock& operator = (vsock&&); + vsock(vsock&& v); + vsock& operator = (vsock&& v); ~vsock(); - vsock(int); + //vsock(int); struct _impl; _impl* _vp;