From 3dc7fb0b3e9e9643a3c8a85d576be4d1ad30552e Mon Sep 17 00:00:00 2001
From: Tim Felgentreff <timfelgentreff@gmail.com>
Date: Mon, 30 Nov 2020 09:51:43 +0100
Subject: [PATCH] try again on windows

---
 CMakeLists.txt                   |  3 ++-
 src/include/util.h               |  7 -------
 src/network/net_lowlevel.cpp     |  8 --------
 src/win32/SetupConsole_win32.cpp | 10 ----------
 4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f82b88001..fe5b32373 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -769,7 +769,8 @@ endif()
 # Platform definitions
 
 if(WIN32)
-	add_definitions(-DUSE_WIN32)
+	# define winXP SP2 as minimum for everything
+	add_definitions(-DUSE_WIN32 -DNTDDI_VERSION=0x05010200 -D_WIN32_WINNT=0x0502 -DWINVER=0x0502)
 	set(stratagus_SRCS ${stratagus_SRCS} ${win32_SRCS})
 	set(stratagus_LIBS ${stratagus_LIBS} dsound winmm ws2_32 dbghelp)
 endif()
diff --git a/src/include/util.h b/src/include/util.h
index 8ed29e04d..17d98e6c9 100644
--- a/src/include/util.h
+++ b/src/include/util.h
@@ -32,13 +32,6 @@
 
 //@{
 
-#ifdef USE_WIN32
-// set everything to winxp sp2 compatiblity
-#define NTDDI_VERSION 0x05010200
-#define _WIN32_WINNT 0x0502
-#define WINVER 0x0502
-#endif
-
 #include <cstdlib>
 #include <cstdint>
 #include <string>
diff --git a/src/network/net_lowlevel.cpp b/src/network/net_lowlevel.cpp
index 42746b6db..fdfc64c80 100644
--- a/src/network/net_lowlevel.cpp
+++ b/src/network/net_lowlevel.cpp
@@ -50,14 +50,6 @@
 #include <windows.h>
 #include <winsock.h>
 #include <ws2tcpip.h>
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-// that's fine
-#elif (NTDDI_VERSION >= NTDDI_WIN2K)
-// that's fine, too
-#else
-// oh no, we're at least NTDDI_WIN2K, otherwise Iphlpapi doesn't work
-#define NTDDI_VERSION NTDDI_WIN2K
-#endif
 #include <Iphlpapi.h>
 #pragma comment(lib, "Iphlpapi.lib")
 
diff --git a/src/win32/SetupConsole_win32.cpp b/src/win32/SetupConsole_win32.cpp
index 0c3a6585a..8094293d1 100644
--- a/src/win32/SetupConsole_win32.cpp
+++ b/src/win32/SetupConsole_win32.cpp
@@ -16,16 +16,6 @@
 
 */
 
-/* _WIN32_WINNT must be set to at least 0x0501 */
-#ifdef _WIN32_WINNT
-#if _WIN32_WINNT < 0x0501
-#undef _WIN32_WINNT
-#endif
-#endif
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-
 #include <windows.h>
 #include <stdio.h>
 #include <io.h>