[vlc-commits] commit: Add AltiVec detection for OpenBSD/powerpc. (Brad Smith )

git at videolan.org git at videolan.org
Sun Aug 8 22:33:59 CEST 2010


vlc/vlc-1.1 | branch: master | Brad Smith <brad at comstyle.com> | Fri Aug  6 21:52:58 2010 -0400| [06069941b6b77dedad6080c4c9373c0e1deef826] | 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/vlc-1.1.git/?a=commit;h=06069941b6b77dedad6080c4c9373c0e1deef826
---

 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 3b0d278..693ae25 100644
--- a/src/misc/cpu.c
+++ b/src/misc/cpu.c
@@ -48,6 +48,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( __i386__ ) || defined( __x86_64__ ) || defined( __powerpc__ ) \
  || defined( __ppc__ ) || defined( __ppc64__ ) || defined( __powerpc64__ )
 # ifndef WIN32
@@ -258,8 +264,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