On 2025-11-20 16:29, Brian Inglis wrote:
On 2025-11-20 08:19, Corinna Vinschen wrote:
Hi Jon,

On Nov 20 14:47, Jon Turney wrote:
Since we now require w32api-headers >= 13 for the
AllocConsoleWithOptions() prototype, 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.

Good idea.

After this, most of the other conditionals on __MINGW64_VERSION_MAJOR
can probably be removed.

Yup.

---
  winsup/configure.ac | 15 +++++++++++++++
  1 file changed, 15 insertions(+)

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

One problem here: The error message "no" isn't overly helpful to the
unaware developer because it neglects to mention the version requirement.
If you just run configure, what you get is this:

   checking for required w32api-headers version... configure: error: no

Given that this code is checking for the actual version number, to be
bumped as we go along, it would be helpful to tell the dev which version
is supposed to be installed, isn't it?

...in both messages:

 >> +    #error "w32api-headers version < 13"
...
 >> +  AC_MSG_ERROR([w32api-headers version < 13])


sorry...better in all messages:

>>> +AC_MSG_CHECKING([for w32api-headers version >= 13])
...
>>> +    #error "require w32api-headers version >= 13"
...
>>> +  AC_MSG_ERROR([require w32api-headers version >= 13])
...

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                -- Antoine de Saint-Exupéry

Reply via email to