mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 23:46:59 +00:00
25 lines
383 B
C++
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;
|
|
}
|
|
|
|
|