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@comstyle.com>
This commit is contained in:
Brad Smith 2024-05-18 07:38:40 -04:00
parent be3404bbac
commit 115c96b9bd

View File

@ -27,7 +27,7 @@
#if HAVE_UNISTD_H #if HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#elif defined(__OpenBSD__) #elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/types.h> #include <sys/types.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <machine/cpu.h> #include <machine/cpu.h>
@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
if (result == VECTORTYPE_ALTIVEC) if (result == VECTORTYPE_ALTIVEC)
return AV_CPU_FLAG_ALTIVEC; return AV_CPU_FLAG_ALTIVEC;
return 0; return 0;
#elif defined(__APPLE__) || defined(__OpenBSD__) #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
#ifdef __OpenBSD__ #if defined(__NetBSD__) || defined(__OpenBSD__)
int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC}; int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
#else #else
int sels[2] = {CTL_HW, HW_VECTORUNIT}; int sels[2] = {CTL_HW, HW_VECTORUNIT};