Add WSA initializer to handle winderp

This commit is contained in:
Phillip Stephens 2015-10-27 08:51:38 -07:00
parent 7c4d0bb6fd
commit a411b1084c
1 changed files with 18 additions and 0 deletions

View File

@ -49,5 +49,23 @@ void Socket::setBlocking(bool blocking)
sock_set_blocking(m_handle, blocking);
}
#if _WIN32
struct WSADerpHandler
{
WSADerpHandler()
{
WSADATA init;
WSAStartup(MAKEWORD(2, 2), &init);
}
~WSADerpHandler()
{
WSACleanup();
}
};
static const WSADerpHandler __wsaderp__;
#endif
}
}