[vlc-devel] [PATCH] configure: link with synchronization library when building for win8+

Steve Lhomme robux4 at ycbcr.xyz
Sat Jun 6 08:07:23 CEST 2020


On 2020-06-05 16:52, Rémi Denis-Courmont wrote:
> Le perjantaina 5. kesäkuuta 2020, 12.28.52 EEST Steve Lhomme a écrit :
>> That's what should be used when calling WaitOnAddress.
>> It's not part of the kernel32.dll anymore.
>>
>> https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wait
>> onaddress ---
>>   configure.ac | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 3f6e91a1888f..08e87df41c3e 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -266,6 +266,18 @@ case "${host_os}" in
>>       ],[
>>         AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7
>> APIs.]) ])
>> +    AC_MSG_CHECKING([if libsynchronization is needed])
>> +    AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
>> +      [[#if _WIN32_WINNT >= 0x0602
>> +       # error building for Win8+ and above
>> +       #endif
>> +      ]],[[;]])
>> +    ],[
>> +      AC_MSG_RESULT([no])
>> +    ],[
>> +      AC_MSG_RESULT([yes])
>> +      VLC_ADD_LIBS([libvlccore], [-lsynchronization])
>> +    ])
> 
> I'm going to guess that 'proper' AC_SEARCH_LIBS will give false positives, but
> I don't see how this is supposed to work for values < 0x602.

By working you mean the detection or the code ? The code (you did) 
triggers the direct calls if built for Win8+. For example when building 
with Universal Runtime. So the detection matches what the code (and the 
OS availability) does.

As for AC_SEARCH_LIBS, it seems [1] it will first link with nothing, 
which when building for Windows implies kernel32, user32 and a bunch of 
other default libraries. And until last night, mingw had the functions 
in libkernel32.a which is (now?) wrong. So it would just pick that but 
that's not the proper way.

Also we never had the issue so far because we always built UWP with 
synchronization, runtimeobject and nomaliz forced. But this it too broad 
and not done in the current build.sh.

>>       AC_DEFINE([_WIN32_IE], [0x0600], [Define to '0x0600' for IE 6.0 (and
>> shell) APIs.]) AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide
>> Chars) APIs.]) AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from
>> ISO C99.])

[1] 
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/autoconf.html#Libraries


More information about the vlc-devel mailing list