<html><head></head><body>Hi,<br><br>Similar to weak ELF symbols then but they're a bit questionable for C/C++ semantics. A function cannot compare nul, as opposed to a function pointer.<br><br><div class="gmail_quote">Le 2 août 2019 16:24:53 GMT+03:00, Marvin Scholz <epirat07@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2 Aug 2019, at 14:45, Rémi Denis-Courmont wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Hi,<br><br> That's not how symbol resolution normally works... Are you sure?<br></blockquote><br>Yes, thats the concept of partially available symbols (requires special<br>annotation in the function declaration) which allows symbols to be <br>undefined<br>without causing a failure at runtime (essentially a weak symbol).<br><br>Most macOS headers use some complex macro magic to mark symbols as <br>partially<br>available (weak) when targeting macOS versions that are lower than the <br>macOS<br>version where the symbol was introduced.<br><br>The user must then check if the symbol is NULL before using it or just <br>check<br>the macOS version.<br><br>The header declaring the symbol has it annotated correctly:<br><a href="https://opensource.apple.com/source/libplatform/libplatform-125/include/os/lock.h.auto.html">https://opensource.apple.com/source/libplatform/libplatform-125/include/os/lock.h.auto.html</a><br><br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le 2 août 2019 14:59:13 GMT+03:00, Marvin Scholz <epirat07@gmail.com> <br>a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> It is not needed to load the symbols using dlsym here, they will be<br> automatically available if the OS version is recent enough or NULL if<br> not.<hr> modules/audio_output/coreaudio_common.c | 4 ++--<br> 1 file changed, 2 insertions(+), 2 deletions(-)<br><br> diff --git a/modules/audio_output/coreaudio_common.c<br> b/modules/audio_output/coreaudio_common.c<br> index 3a9ec69113..836a5f6de4 100644<br> --- a/modules/audio_output/coreaudio_common.c<br> +++ b/modules/audio_output/coreaudio_common.c<br> @@ -63,10 +63,10 @@ ca_ClearOutBuffers(audio_output_t *p_aout)<br> static void<br> ca_init_once(void)<br> {<br> -    unfair_lock.lock = dlsym(RTLD_DEFAULT, "os_unfair_lock_lock");<br> +    unfair_lock.lock = os_unfair_lock_lock;<br>     if (!unfair_lock.lock)<br>         return;<br> -    unfair_lock.unlock = dlsym(RTLD_DEFAULT, <br> "os_unfair_lock_unlock");<br> +    unfair_lock.unlock = os_unfair_lock_unlock;<br>     if (!unfair_lock.unlock)<br>         unfair_lock.lock = NULL;<br><br> -- <br> 2.19.1<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez <br>excuser ma brièveté._______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>