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.
After this, most of the other conditionals on __MINGW64_VERSION_MAJOR
can probably be removed.
---
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
--
2.51.0