aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-05-11 23:03:41 +0200
committerStapleButter <thetotalworm@gmail.com>2017-05-11 23:03:41 +0200
commite9a24b4d06d59a9d8cdcfc9be396c9df105f7408 (patch)
tree509f5ca3c1cffd425084b0f6e0fcda841767bd37
parent9a2e2998e9569d42e99b06f044eec7065233b201 (diff)
forgot Windows needs extra setup for sockets
-rw-r--r--src/wx/Platform.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wx/Platform.cpp b/src/wx/Platform.cpp
index 3beca2f..697ecf3 100644
--- a/src/wx/Platform.cpp
+++ b/src/wx/Platform.cpp
@@ -55,6 +55,14 @@ bool MP_Init()
BOOL opt_true = TRUE;
int res;
+#ifdef __WXMSW__
+ WSADATA wsadata;
+ if (WSAStartup(MAKEWORD(2, 2), &wsadata) != 0)
+ {
+ return false;
+ }
+#endif // __WXMSW__
+
MPSocket = socket(AF_INET, SOCK_DGRAM, 0);
if (MPSocket < 0)
{
@@ -100,6 +108,10 @@ void MP_DeInit()
{
if (MPSocket >= 0)
closesocket(MPSocket);
+
+#ifdef __WXMSW__
+ WSACleanup();
+#endif // __WXMSW__
}