[vlc-devel] [3.0 PATCH 1/2] configure: Make the new value of _WIN32_WINNT available to configure tests

Martin Storsjö martin at martin.st
Fri Apr 3 13:21:11 CEST 2020


On Fri, 3 Apr 2020, Steve Lhomme wrote:

> On 2020-04-02 22:11, Martin Storsjö wrote:
>> On Thu, 2 Apr 2020, Steve Lhomme wrote:
>> 
>>> LGTM
>>>
>>> It's slightly different from the one I submitted earlier, by testing 
>>> the _WIN32_WINNT value:
>>> [3.0 PATCH v2 18/20] configure: Make the new value of _WIN32_WINNT 
>>> available to configure tests
>> 
>> Yep, I tested yours as well, but I think I prefer this form, to avoid 
>> forcing _WIN32_WINNT to a lower-than-default version which easily could 
>> give inconsistent results as well.
>
> For 3.0 I guess that's good as it's a hard limit we can't go below.
>
> For 4.0 it's debatable as it might be possible to build for Vista and 
> things mostly work. If we decide we don't want that, it should be done 
> in 4.0 first and then backported to 3.0.

I think another form of the patch might be even better - and we could do 
that on master, so the cherrypicked form is closer to what we have there. 
I'd suggest this form of conditional:

     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
       [[#ifdef _WIN32_WINNT
        # error _WIN32_WINNT already defined
        #else
        # include <windows.h>
        # if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0601
        #  error _WIN32_WINNT toolchain default high enough
        # endif
        #endif
       ]],[[;]])
     ],[
       AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7 APIs.])
     ])


So if the user has passed -D_WIN32_WINNT to the compiler (via cflags), 
that's what's being used and we don't touch it. If _WIN32_WINNT isn't 
manually defined, check the toolchain default. If the toolchain defaults 
to a version new enough compared to what VLC wants, we also leave it be. 
In other cases, we set our desired default in config.h (and using 
AC_DEFINE to make it visible to the rest of configure).

I can send that as a patch against master - and then the thing for 3.0 
would be a backport of 255e2ce27954004b8e6aa65ed37266c422f08a58, 
0a27328b5ac2bc0e417c70f048131f783b201d04 and the new patch (either 
squashed into one, or made as three adapted cherrypicks).

// Martin


More information about the vlc-devel mailing list