diff --git a/subprojects/gst-plugins-bad/ext/sctp/usrsctp/meson.build b/subprojects/gst-plugins-bad/ext/sctp/usrsctp/meson.build index 8d474970bb..0869dd59fd 100644 --- a/subprojects/gst-plugins-bad/ext/sctp/usrsctp/meson.build +++ b/subprojects/gst-plugins-bad/ext/sctp/usrsctp/meson.build @@ -77,7 +77,6 @@ elif system == 'windows' if compiler.get_id() == 'gcc' compile_args += [compiler.get_supported_arguments([ '-Wno-format', - '-D_WIN32_WINNT=0x601', # Enables inet_ntop and friends ])] endif else diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index ce1918eeee..0d5b66c466 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -408,6 +408,23 @@ endif if host_machine.system() == 'windows' winsock2 = [cc.find_library('ws2_32')] + + building_for_win7 = cc.compiles('''#include + #ifndef WINVER + #error "unknown minimum supported OS version" + #endif + #if (WINVER < _WIN32_WINNT_WIN7) + #error "Windows 7 API is not guaranteed" + #endif + ''', + name: 'building for Windows 7') + + if not building_for_win7 + add_project_arguments([ + '-D_WIN32_WINNT=_WIN32_WINNT_WIN7', + '-DWINVER=_WIN32_WINNT_WIN7', + ], language: ['c', 'cpp']) + endif else winsock2 = [] endif diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build index ae2ca58b41..46551c7978 100644 --- a/subprojects/gstreamer/meson.build +++ b/subprojects/gstreamer/meson.build @@ -404,6 +404,23 @@ if host_system == 'windows' if cc.compiles(code, name : 'building for UWP') building_for_uwp = true endif + + building_for_win7 = cc.compiles('''#include + #ifndef WINVER + #error "unknown minimum supported OS version" + #endif + #if (WINVER < _WIN32_WINNT_WIN7) + #error "Windows 7 API is not guaranteed" + #endif + ''', + name: 'building for Windows 7') + + if not building_for_win7 + add_project_arguments([ + '-D_WIN32_WINNT=_WIN32_WINNT_WIN7', + '-DWINVER=_WIN32_WINNT_WIN7', + ], language: ['c', 'cpp']) + endif endif backtrace_deps = []