<html><head></head><body>It's a mistake. It should move the existing weak qualifier, not add a new one.<br><br><div class="gmail_quote">Le 30 mars 2020 10:35:38 GMT+03:00, Alexandre Janniaux <ajanni@videolabs.io> 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,<br><br>Can you add the reason for putting an additional VLC_WEAK<br>on vlc_CPU_raw in the commit message? It would probably help<br>in the future.<br><br>Regards,<br>--<br>Alexandre Janniaux<br>Videolabs<br><br>On Sun, Mar 29, 2020 at 11:43:54PM +0300, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><hr> include/vlc_cpu.h | 8 ++++++++<br> src/linux/cpu.c | 22 +---------------------<br> src/misc/cpu.c | 2 +-<br> 3 files changed, 10 insertions(+), 22 deletions(-)<br><br> diff --git a/include/vlc_cpu.h b/include/vlc_cpu.h<br> index 6fe098f78a..80dfd9656d 100644<br> --- a/include/vlc_cpu.h<br> +++ b/include/vlc_cpu.h<br> @@ -31,6 +31,14 @@<br> */<br> VLC_API unsigned vlc_CPU(void);<br><br> +/**<br> + * Computes CPU capability flags.<br> + *<br> + * Do not call this function directly.<br> + * Call vlc_CPU() instead, which caches the correct value.<br> + */<br> +unsigned vlc_CPU_raw(void);<br> +<br> # if defined (__i386__) || defined (__x86_64__)<br> # define HAVE_FPU 1<br> # define VLC_CPU_MMX 0x00000008<br> diff --git a/src/linux/cpu.c b/src/linux/cpu.c<br> index f9a82bb51e..6ba11512ef 100644<br> --- a/src/linux/cpu.c<br> +++ b/src/linux/cpu.c<br> @@ -40,7 +40,7 @@<br> #endif<br><br> #ifdef CPU_FLAGS<br> -static unsigned vlc_CPU_raw(void)<br> +unsigned vlc_CPU_raw(void)<br> {<br> FILE *info = fopen ("/proc/cpuinfo", "rte");<br> if (info == NULL)<br> @@ -120,24 +120,4 @@ static unsigned vlc_CPU_raw(void)<br><br> return all_caps;<br> }<br> -<br> -static uint32_t cpu_flags = 0;<br> -<br> -static void vlc_CPU_init(void)<br> -{<br> - cpu_flags = vlc_CPU_raw();<br> -}<br> -<br> -unsigned vlc_CPU (void)<br> -{<br> - static pthread_once_t once = PTHREAD_ONCE_INIT;<br> -<br> - pthread_once (&once, vlc_CPU_init);<br> - return cpu_flags;<br> -}<br> -#else /* CPU_FLAGS */<br> -unsigned vlc_CPU (void)<br> -{<br> - return 0;<br> -}<br> #endif<br> diff --git a/src/misc/cpu.c b/src/misc/cpu.c<br> index 8a8835b79b..7f3a89a3cb 100644<br> --- a/src/misc/cpu.c<br> +++ b/src/misc/cpu.c<br> @@ -113,7 +113,7 @@ static void Altivec_test (void)<br> /**<br> * Determines the CPU capabilities.<br> */<br> -static unsigned vlc_CPU_raw(void)<br> +VLC_WEAK unsigned vlc_CPU_raw(void)<br> {<br> uint32_t i_capabilities = 0;<br><br> --<br> 2.26.0<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><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>