From ce4c19c96fb0f90c7728fc209f3544023bb5ddcd Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 23 May 2023 15:02:15 +0200 Subject: [PATCH 1/2] meson: don't force the Windows version if it's higher than Vista If the user requires a newer Windows version it should set it manually. It is also questionable to call inet_ntop (aka InetNtopA) if the build requests minimum support for Win XP (VLC 3.0). It's only available since Vista [1]. So building for a Vista target should be fine. [1] https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-inet_ntop --- meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f8ec49b..c2df33a 100755 --- a/meson.build +++ b/meson.build @@ -64,7 +64,17 @@ threads = [] test_args = [] if host_machine.system() == 'windows' deps += [ cc.find_library('ws2_32') ] - add_project_arguments(['-D_WIN32_WINNT=0x0601'], language: 'c') + +windows_version_test = ''' +#include +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600 +# error _WIN32_WINNT toolchain default not high enough +#endif +''' + if not cc.compiles(windows_version_test, name: '_WIN32_WINNT includes Vista') + add_project_arguments(['-D_WIN32_WINNT=0x0600'], language: 'c') + endif + if get_option('default_library') != 'static' add_project_arguments(['-DLIBRIST_BUILDING_DLL'], language: 'c') endif -- 2.37.3.windows.1