mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-27 16:15:40 +00:00
28 lines
488 B
C++
28 lines
488 B
C++
#include "WinSockWrap.h"
|
|
#include <winsock2.h>
|
|
#include <windows.h>
|
|
|
|
#pragma comment(lib, "ws2_32.lib")
|
|
|
|
WinSockWrap::WinSockWrap()
|
|
{
|
|
//==============
|
|
WSADATA wsaData;
|
|
int err;
|
|
//==============
|
|
|
|
m_count = 0;
|
|
|
|
err = WSAStartup(MAKEWORD(2, 2), &wsaData); // don't really need to care for checking supported version, we should be good from win95 onwards
|
|
|
|
if (err == 0) {
|
|
m_count++;
|
|
}
|
|
}
|
|
|
|
WinSockWrap::~WinSockWrap()
|
|
{
|
|
if (m_count) {
|
|
WSACleanup();
|
|
}
|
|
} |