Skip to content

Commit

Permalink
configure.ac: error if --with-winidn and target OS too old
Browse files Browse the repository at this point in the history
- If the minimum Windows target OS is pre-Vista (_WIN32_WINNT < 0x600)
  then error.

- Stop comparing against WINVER when making the minimum OS
  determinations (ie check only _WIN32_WINNT instead of both since
  that's the one that matters).

Prior to this change, if --with-winidn was used in such a case configure
would change the minimum target OS to Vista (0x600) so the build would
compile. That was done primarily as a workaround for original MinGW
which we no longer support.

Bug: curl#12606 (comment)
Reported-by: Viktor Szakats

Closes #xxxxx
  • Loading branch information
jay committed Jan 12, 2024
1 parent 5d044ad commit 76b8d0b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,6 @@ if test "$want_winidn" = "yes"; then
WINIDN_DIR="$want_winidn_path/lib$libsuff"
fi
#
dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <windows.h>
Expand All @@ -2479,11 +2478,8 @@ if test "$want_winidn" = "yes"; then
]])
],[
],[
CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
AC_MSG_RESULT([no])
AC_MSG_ERROR([--with-winidn requires a minimum supported OS version of at least Vista])
])
#
CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
Expand Down

0 comments on commit 76b8d0b

Please sign in to comment.