https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=745ef5e6eb9182116a0fe3a1fb6292f1bb91c6e2

commit 745ef5e6eb9182116a0fe3a1fb6292f1bb91c6e2
Author: Jon Turney <[email protected]>
Date:   Wed Nov 19 17:34:15 2025 +0000

    Cygwin: Add a configure-time check for minimum w32api headers version
    
    Since we now require w32api-headers >= 13 for the
    AllocConsoleWithOptions() prototype and flags, add a configure-time
    check for that, as I've mused about a couple of times before.
    
    This maybe gives a more obvious diagnosis of the problem than 'not
    declared' errors, and is perhaps more self-documenting about our
    expectations here.
    
    Future work: Most of the other conditionals on __MINGW64_VERSION_MAJOR
    can probably be removed.

Diff:
---
 winsup/configure.ac | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/winsup/configure.ac b/winsup/configure.ac
index e7ac814b1..05b5a9897 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -57,6 +57,23 @@ AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
 AC_CHECK_TOOL(STRIP, strip, strip)
 AC_CHECK_TOOL(WINDRES, windres, windres)
 
+required_w32api_version=13
+AC_MSG_CHECKING([w32api-headers version])
+AC_COMPILE_IFELSE([
+  AC_LANG_SOURCE([[
+    #include <_mingw.h>
+
+    #if __MINGW64_VERSION_MAJOR < $required_w32api_version
+    #error "w32api-headers version >= $required_w32api_version required"
+    #endif
+ ]])
+],[
+  AC_MSG_RESULT([yes])
+],[
+  AC_MSG_RESULT([no, >= $required_w32api_version required])
+  AC_MSG_ERROR([required w32api-headers version not met])
+])
+
 AC_ARG_ENABLE(debugging,
 [AS_HELP_STRING([--enable-debugging],[Build a cygwin DLL which has more 
consistency checking for debugging])],
 [case "${enableval}" in

Reply via email to