BeamMP-Launcher/include/winmain-inl.h
2021-03-29 16:43:17 +03:00

25 lines
383 B
C++

#pragma once
namespace {
struct OnApp {
OnApp() {
#ifdef WIN32
// Initialize Winsock 2.2
WSADATA wsaData;
int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (err) {
std::cout << "WSAStartup() failed with error: %d" << err;
}
#endif
}
~OnApp() {
#ifdef WIN32
WSACleanup();
#endif
}
} __s_onexit_pause;
}