From a893c9e6bf37e69ac7d7ee26f0e52ebf6f25f1c0 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nicolas.pope@utu.fi>
Date: Mon, 9 May 2022 08:51:47 +0100
Subject: [PATCH] Use WSAPoll on windows

---
 src/universe.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/universe.cpp b/src/universe.cpp
index 360599e..b3ade7a 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -18,7 +18,7 @@
 #include "protocol/tcp.hpp"
 
 #ifdef WIN32
-#include <winsock.h>
+#include <winsock2.h>
 #include <Ws2tcpip.h>
 #endif
 
@@ -478,7 +478,11 @@ void Universe::_run() {
 			continue;
 		}
 
+		#ifdef WIN32
+		selres = WSAPoll(impl_->pollfds.data(), impl_->pollfds.size(), 100);
+		#else
 		selres = poll(impl_->pollfds.data(), impl_->pollfds.size(), 100);
+		#endif
 
 		// NOTE Nick: Is it possible that not all the recvs have been called before I
 		// again reach a select call!? What are the consequences of this? A double recv attempt?
-- 
GitLab