From e3c693c9f17bfc29b87e5ec6c39fe53ba1fb4a8e Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Thu, 7 Sep 2023 22:40:59 +0200
Subject: [PATCH] autoconf.ac: fix detection of windows.h for mingw (fixes
#605)
(cherry picked from commit 341588333e9a7bd48ac2910f89415ebba47e56c2)
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index c71eaef8..804ab2ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -993,14 +993,14 @@ AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")
dnl ---------------------------------------------------------------------------
dnl Check for Win32 IO: make sure we have windows.h but not cygwin
-dnl this must be after the ogl test, since that looks for windows.h and we
-dnl test it
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(win32-io,
AS_HELP_STRING([--disable-win32-io],
[disable Win32 I/O (Windows only, enabled by default except for Cygwin)]),,)
+AC_CHECK_HEADER(windows.h)
+
win32_io_ok=no
case "${host_os}" in
cygwin*)