X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fwindows%2Fsocket.cpp;h=eadc22af3a2de5355c349d16e201f8d1ec01b032;hb=6057616e00a6792e219fab2ce958306e737faa67;hp=5094cc45644f929d9deb436ccdf0efc27daf0be0;hpb=dadb1b2524c26b12c0dff1d720fe2b080885d378;p=libs%2Fnet.git diff --git a/source/net/windows/socket.cpp b/source/net/windows/socket.cpp index 5094cc4..eadc22a 100644 --- a/source/net/windows/socket.cpp +++ b/source/net/windows/socket.cpp @@ -1,11 +1,13 @@ -#include #include "platform_api.h" +#include "socket.h" +#include #include #include #include "sockaddr_private.h" -#include "socket.h" #include "socket_private.h" +using namespace std; + namespace { class WinSockHelper @@ -25,7 +27,7 @@ public: } }; -WinSockHelper wsh; +unique_ptr wsh; } @@ -35,6 +37,8 @@ namespace Net { void Socket::platform_init() { + if(!wsh) + wsh = make_unique(); *priv->event = CreateEvent(0, false, false, 0); } @@ -85,7 +89,7 @@ int Socket::Private::get_option(int level, int optname, void *optval, socklen_t } -unsigned check_sys_error(int ret, const char *func) +size_t check_sys_error(make_signed::type ret, const char *func) { if(ret<0) {