Move windows socket init to utility function

This commit is contained in:
Wladimir J. van der Laan
2015-09-02 16:18:16 +02:00
committed by Jack Grigg
parent 91295c4b4d
commit 167b6231c9
4 changed files with 21 additions and 9 deletions

View File

@@ -863,6 +863,18 @@ void SetupEnvironment()
boost::filesystem::path::imbue(loc);
}
bool SetupNetworking()
{
#ifdef WIN32
// Initialize Windows Sockets
WSADATA wsadata;
int ret = WSAStartup(MAKEWORD(2,2), &wsadata);
if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2)
return false;
#endif
return true;
}
void SetThreadPriority(int nPriority)
{
#ifdef WIN32