]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
configure.ac: Improve Windows version detection 2631/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 23 May 2025 17:22:06 +0000 (19:22 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 23 May 2025 17:22:41 +0000 (19:22 +0200)
Include windows.h for better windows version detection.

Fixes https://github.com/libarchive/libarchive/issues/2628

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
configure.ac

index 09795d84689392900b68a216e28dde84eaa1c852..e772d4078b74c622d906ae7c7414fee9b12b109e 100644 (file)
@@ -258,7 +258,8 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
 case $host in
   *mingw* | *cygwin* | *msys*  )
   AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
-    [[#ifdef _WIN32_WINNT
+    [[#include <windows.h>
+     #ifdef _WIN32_WINNT
      # error _WIN32_WINNT already defined
      #endif
     ]],[[;]])
@@ -267,7 +268,8 @@ case $host in
     AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
   ])
   AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
-    [[#ifdef WINVER
+    [[#include <windows.h>
+     #ifdef WINVER
      # error WINVER already defined
      #endif
     ]],[[;]])