[FFmpeg-devel] [PATCH] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
Sean McGovern
gseanmcg at gmail.com
Mon May 6 17:15:04 EEST 2024
Hi Brad,
On Sun, May 5, 2024 at 11:22 PM Brad Smith
<brad-at-comstyle.com at ffmpeg.org> wrote:
>
> avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
>
> Use the machdep.altivec sysctl on NetBSD for AltiVec detection
> as is done with OpenBSD.
>
> Signed-off-by: Brad Smith <brad at comstyle.com>
> ---
> libavutil/ppc/cpu.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
> index bc8bb5f47c..2b13cda662 100644
> --- a/libavutil/ppc/cpu.c
> +++ b/libavutil/ppc/cpu.c
> @@ -27,7 +27,7 @@
> #if HAVE_UNISTD_H
> #include <unistd.h>
> #endif
> -#elif defined(__OpenBSD__)
> +#elif defined(__NetBSD__) || defined(__OpenBSD__)
> #include <sys/types.h>
> #include <sys/sysctl.h>
> #include <machine/cpu.h>
> @@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
> if (result == VECTORTYPE_ALTIVEC)
> return AV_CPU_FLAG_ALTIVEC;
> return 0;
> -#elif defined(__APPLE__) || defined(__OpenBSD__)
> -#ifdef __OpenBSD__
> +#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
> +#if defined(__NetBSD__) || defined(__OpenBSD__)
> int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
> #else
> int sels[2] = {CTL_HW, HW_VECTORUNIT};
> --
> 2.44.0
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
OK, looks good to me.
-- Sean McGovern
More information about the ffmpeg-devel
mailing list