[vlc-devel] [PATCH] vlc_fixups: allow overriding the minimum Windows SDK for certain files

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 6 16:06:10 CET 2020


On 2020-03-06 15:31, Remi Denis-Courmont wrote:
> Le 2020-03-06 15:47, Steve Lhomme a écrit :
>> We often use this to compile code targeting newer versions of Windows 
>> than the
>> minimal version we support.
> 
> I don't see how that would actually work. <vlc_fixups.h> could end up 
> defining stuff which conflicts with newer Windows versions and the build 
> would fail.

We have never had the case so far and since at least 3.0 we compile some 
C file with a different _WIN32_WINNT than the project one.

In 4.0 it's currently not an issue, we don't support anything older than 
Win7 so all of these defines have actually no effect. The idea here is 
to have a common way to do it so it can be backported to 3.0.

In 4.0 vlc_fixup includes the following headers on windows:

config.h
vlc/include/vlc_fixups.h
x86_64-w64-mingw32/include/time.h
x86_64-w64-mingw32/include/crtdefs.h
x86_64-w64-mingw32/include/corecrt.h
x86_64-w64-mingw32/include/_mingw.h
x86_64-w64-mingw32/include/_mingw_mac.h
x86_64-w64-mingw32/include/_mingw_secapi.h
lib/clang/9.0.0/include/vadefs.h
x86_64-w64-mingw32/include/vadefs.h
x86_64-w64-mingw32/include/sdks/_mingw_directx.h
x86_64-w64-mingw32/include/sdks/_mingw_ddk.h
x86_64-w64-mingw32/include/_timeval.h
x86_64-w64-mingw32/include/sys/timeb.h
x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h
contrib/x86_64-w64-mingw32/include/pthread_time.h
lib/clang/9.0.0/include/stddef.h
lib/clang/9.0.0/include/__stddef_max_align_t.h
x86_64-w64-mingw32/include/stdio.h
x86_64-w64-mingw32/include/_mingw_off_t.h
x86_64-w64-mingw32/include/swprintf.inl
x86_64-w64-mingw32/include/sec_api/stdio_s.h
x86_64-w64-mingw32/include/sys/types.h
x86_64-w64-mingw32/include/dirent.h
x86_64-w64-mingw32/include/io.h
x86_64-w64-mingw32/include/string.h
x86_64-w64-mingw32/include/sec_api/string_s.h
x86_64-w64-mingw32/include/errno.h
x86_64-w64-mingw32/include/search.h
x86_64-w64-mingw32/include/sec_api/search_s.h

In 3.0 the following headers (different pthread_time and extra search):

config.h
vlc/include/vlc_fixups.h
x86_64-w64-mingw32/include/time.h
x86_64-w64-mingw32/include/crtdefs.h
x86_64-w64-mingw32/include/corecrt.h
x86_64-w64-mingw32/include/_mingw.h
x86_64-w64-mingw32/include/_mingw_mac.h
x86_64-w64-mingw32/include/_mingw_secapi.h
lib/clang/10.0.0/include/vadefs.h
x86_64-w64-mingw32/include/vadefs.h
x86_64-w64-mingw32/include/sdks/_mingw_directx.h
x86_64-w64-mingw32/include/sdks/_mingw_ddk.h
x86_64-w64-mingw32/include/_timeval.h
x86_64-w64-mingw32/include/sys/timeb.h
x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h
x86_64-w64-mingw32/include/pthread_time.h
lib/clang/10.0.0/include/stddef.h
lib/clang/10.0.0/include/__stddef_max_align_t.h
x86_64-w64-mingw32/include/stdio.h
x86_64-w64-mingw32/include/_mingw_off_t.h
x86_64-w64-mingw32/include/swprintf.inl
x86_64-w64-mingw32/include/sec_api/stdio_s.h
x86_64-w64-mingw32/include/sys/types.h
x86_64-w64-mingw32/include/dirent.h
x86_64-w64-mingw32/include/io.h
x86_64-w64-mingw32/include/string.h
x86_64-w64-mingw32/include/sec_api/string_s.h
x86_64-w64-mingw32/include/errno.h


It seems no Windows header where _WIN32_WINNT would be used is included. 
So it should not matter if _WIN32_WINNT is set before or after config.h. 
I prefer after as it's friendlier with precompiled headers. I'll give 
this a try.


More information about the vlc-devel mailing list