[vlc-commits] commit: Add AltiVec detection for OpenBSD/powerpc. (Brad Smith )
git at videolan.org
git at videolan.org
Sun Aug 8 22:27:01 CEST 2010
vlc | branch: master | Brad Smith <brad at comstyle.com> | Fri Aug 6 21:52:58 2010 -0400| [f210514c93fdd60103f2c203d656b83da1ecda51] | committer: Jean-Baptiste Kempf
Add AltiVec detection for OpenBSD/powerpc.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f210514c93fdd60103f2c203d656b83da1ecda51
---
src/misc/cpu.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/misc/cpu.c b/src/misc/cpu.c
index 71aed9d..7a3db47 100644
--- a/src/misc/cpu.c
+++ b/src/misc/cpu.c
@@ -49,6 +49,12 @@
#include <sys/sysctl.h>
#endif
+#if defined(__OpenBSD__) && defined(__powerpc__)
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <machine/cpu.h>
+#endif
+
#if defined(__SunOS)
#include <unistd.h>
#include <sys/types.h>
@@ -266,8 +272,12 @@ out:
#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __powerpc64__ ) \
|| defined( __ppc64__ )
-# if defined(__APPLE__)
+# if defined(__APPLE__) || defined(__OpenBSD__)
+# if defined(__OpenBSD__)
+ int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
+# else
int selectors[2] = { CTL_HW, HW_VECTORUNIT };
+# endif
int i_has_altivec = 0;
size_t i_length = sizeof( i_has_altivec );
int i_error = sysctl( selectors, 2, &i_has_altivec, &i_length, NULL, 0);
More information about the vlc-commits
mailing list