diff options
author | Brad <brad@comstyle.com> | 2008-09-22 05:38:50 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2008-09-22 05:38:50 +0000 |
commit | acce61a7c6dd542926bce8989a2624052e4a7bd2 (patch) | |
tree | 37d88333a92d472ed3a7388a24f97054c74bf501 | |
parent | 8dbd9cb6953aa3d01c3b4d65004e0c3e3ace245b (diff) | |
download | ffmpeg-acce61a7c6dd542926bce8989a2624052e4a7bd2.tar.gz |
AltiVec detection support for OpenBSD, patch by Brad, brad comstyle com.
Originally committed as revision 15382 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ppc/check_altivec.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/ppc/check_altivec.c b/libavcodec/ppc/check_altivec.c index f88b27688c..f21a16c674 100644 --- a/libavcodec/ppc/check_altivec.c +++ b/libavcodec/ppc/check_altivec.c @@ -25,6 +25,10 @@ #ifdef __APPLE__ #undef _POSIX_C_SOURCE #include <sys/sysctl.h> +#elif __OpenBSD__ +#include <sys/param.h> +#include <sys/sysctl.h> +#include <machine/cpu.h> #elif __AMIGAOS4__ #include <exec/exec.h> #include <interfaces/exec.h> @@ -45,8 +49,12 @@ int has_altivec(void) IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); if (result == VECTORTYPE_ALTIVEC) return 1; return 0; -#elif __APPLE__ +#elif defined(__APPLE__) || defined(__OpenBSD__) +#ifdef __OpenBSD__ + int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC}; +#else int sels[2] = {CTL_HW, HW_VECTORUNIT}; +#endif int has_vu = 0; size_t len = sizeof(has_vu); int err; |