/* */ #include "Platform.h" #ifdef HAVE_WINSOCK2_H #ifndef _WIN32_WINNT # define _WIN32_WINNT 0x501 #endif // _WIN32_WINNT #include #undef ERROR #ifdef HAVE_WS2TCPIP_H # include #endif // HAVE_WS2TCPIP_H #include "DlAbortEx.h" #include "message.h" #include /* _fmode */ #include /* _O_BINARY */ namespace aria2 { Platform::Platform() { unsigned int _CRT_fmode = _O_BINARY; WSADATA wsaData; memset((char*)&wsaData, 0, sizeof(wsaData)); if (WSAStartup(MAKEWORD(1, 1), &wsaData)) { throw DlAbortEx(MSG_WINSOCK_INIT_FAILD); } } Platform::~Platform() { WSACleanup(); } } // namespace aria2 #endif // HAVE_WINSOCK2_H