[vlc-commits] configure: Make the new value of _WIN32_WINNT available to configure tests

Martin Storsjö git at videolan.org
Thu Jul 12 08:00:14 CEST 2018


vlc | branch: master | Martin Storsjö <martin at martin.st> | Wed Jul 11 22:24:06 2018 +0300| [0a27328b5ac2bc0e417c70f048131f783b201d04] | committer: Martin Storsjö

configure: Make the new value of _WIN32_WINNT available to configure tests

Definitions from AH_TOP aren't included in the configure checks.

This was the original intent of e807c8e91.

This makes sure configure checks and actual compilation are run
with the same version defined.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0a27328b5ac2bc0e417c70f048131f783b201d04
---

 configure.ac | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index de9c69da9f..ba76fc124f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,10 +202,14 @@ 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) || _WIN32_WINNT < 0x0601)])
-    AH_TOP([# undef _WIN32_WINNT])
-    AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
-    AH_TOP([#endif])
+    AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+      [[#ifdef _WIN32_WINNT
+       # error _WIN32_WINNT already defined
+       #endif
+      ]],[[;]])
+    ],[
+      AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
+    ])
     AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
     AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
     AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])



More information about the vlc-commits mailing list