summaryrefslogtreecommitdiff
path: root/Source/Core/Common/SocketContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/SocketContext.cpp')
-rw-r--r--Source/Core/Common/SocketContext.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Core/Common/SocketContext.cpp b/Source/Core/Common/SocketContext.cpp
new file mode 100644
index 0000000000..e9174bc0d9
--- /dev/null
+++ b/Source/Core/Common/SocketContext.cpp
@@ -0,0 +1,22 @@
+// Copyright 2021 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "Common/SocketContext.h"
+
+namespace Common
+{
+#ifdef _WIN32
+SocketContext::SocketContext()
+{
+ static_cast<void>(WSAStartup(MAKEWORD(2, 2), &m_data));
+}
+SocketContext::~SocketContext()
+{
+ WSACleanup();
+}
+#else
+SocketContext::SocketContext() = default;
+SocketContext::~SocketContext() = default;
+#endif
+} // namespace Common