[vlc-devel] [3.0 PATCH 1/5] configure: Don't force _WIN32_WINNT to 0x0601 if it is set to a higher version

Martin Storsjö martin at martin.st
Mon Apr 6 15:31:33 CEST 2020


Since e807c8e91, we're explicitly unconditionally defining _WIN32_WINNT,
regardless if it was set before or not.

If it was set before (e.g. on the command line), to a higher version,
we should honor that.

This is cruicial for WinRT building, where _WIN32_WINNT is set to Windows
8 or higher on the command line.

EDIT: Adapted to a different default version in the 3.0 branch.

(cherry picked from commit 255e2ce27954004b8e6aa65ed37266c422f08a58)
---
Posted for reference/discussion now, totally ok to defer pushing until
after the pending 3.0 release.
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 93d2ae3bcd..5505f05811 100644
--- a/configure.ac
+++ b/configure.ac
@@ -218,7 +218,8 @@ case "${host_os}" in
     CXXFLAGS="${CXXFLAGS} -static-libgcc"
     AC_CHECK_TOOL(WINDRES, windres, :)
     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
-    AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
+    AH_TOP([#if defined(_WIN32) && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0502)])
+    AH_TOP([# undef _WIN32_WINNT])
     AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
     AH_TOP([#endif])
     AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
-- 
2.17.1



More information about the vlc-devel mailing list