From d6f6fdf979f5aa79c015d9a57442f8bb0911f5c8 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Fri, 23 May 2025 19:22:06 +0200 Subject: [PATCH] configure.ac: Improve Windows version detection Include windows.h for better windows version detection. Fixes https://github.com/libarchive/libarchive/issues/2628 Signed-off-by: Tobias Stoeckmann --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 09795d846..e772d4078 100644 --- a/configure.ac +++ b/configure.ac @@ -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 + #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 + #ifdef WINVER # error WINVER already defined #endif ]],[[;]]) -- 2.47.2