<html><head></head><body>Oh, that's right. Not sure why GCC tolerates this mistake.<br><br><div class="gmail_quote">Le 21 février 2020 02:22:31 GMT+02: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">Hi, I did not do a full review of this, I just applied it<br>and tried it out and ran into a compilation error due<br>to the atomic pointer.<br><br>See inline:<br><br>On 20 Feb 2020, at 20:58, 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;"> This provides a common implementation of fast (non-debug),<br> error-checking (debug) and recursive muteces on top of<br> vlc_atomic_wait() and vlc_atomic_notify_one(), using Drepper's tristate<br> mutex algorithm.<br><br> [ … ]<br><br>  /**<br>   * Read/write lock.<br> @@ -343,6 +335,43 @@ typedef struct vlc_timer *vlc_timer_t;<br>   * \defgroup mutex Mutual exclusion locks<br>   * @{<br>   */<br> +#ifndef LIBVLC_DONT_WANT_MUTEX<br> +/**<br> + * Mutex.<br> + *<br> + * Storage space for a mutual exclusion lock.<br> + */<br> +typedef struct<br> +{<br> +    union {<br> +#ifndef __cplusplus<br> +        struct {<br> +            atomic_uint value;<br> +            atomic_uint recursion;<br> +            _Atomic const void *owner;<br></blockquote><br>I believe you meant to do<br><br>    const void * _Atomic owner;<br><br>here, as you want the pointer and not void itself to be<br>atomic? With clang at least, _Atomic const void *owner<br>does not compile:<br><br>   error: _Atomic cannot be applied to incomplete type 'void'<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> +        };<br> +#endif<br> +        struct {<br> +            unsigned int value;<br> +            unsigned int recursion;<br> +            const void *owner;<br> +        } dummy;<br> +    };<br> +} vlc_mutex_t;<br><br> [ … ]<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>