comparison src/cpuinfo/SDL_cpuinfo.c @ 1590:96d8c3fec479

Don't detect Altivec on MacOS X Intel
author Sam Lantinga <slouken@libsdl.org>
date Wed, 22 Mar 2006 22:29:44 +0000
parents dc6b59e925a2
children 782fd950bd46 7bea26ad3130
comparison
equal deleted inserted replaced
1589:34cca785be57 1590:96d8c3fec479
24 /* CPU feature detection for SDL */ 24 /* CPU feature detection for SDL */
25 25
26 #include "SDL.h" 26 #include "SDL.h"
27 #include "SDL_cpuinfo.h" 27 #include "SDL_cpuinfo.h"
28 28
29 #ifdef __MACOSX__ 29 #if defined(__MACOSX__) && defined(__ppc__)
30 #include <sys/sysctl.h> /* For AltiVec check */ 30 #include <sys/sysctl.h> /* For AltiVec check */
31 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP 31 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
32 #include <signal.h> 32 #include <signal.h>
33 #include <setjmp.h> 33 #include <setjmp.h>
34 #endif 34 #endif
304 } 304 }
305 305
306 static __inline__ int CPU_haveAltiVec(void) 306 static __inline__ int CPU_haveAltiVec(void)
307 { 307 {
308 volatile int altivec = 0; 308 volatile int altivec = 0;
309 #ifdef __MACOSX__ 309 #if defined(__MACOSX__) && defined(__ppc__)
310 int selectors[2] = { CTL_HW, HW_VECTORUNIT }; 310 int selectors[2] = { CTL_HW, HW_VECTORUNIT };
311 int hasVectorUnit = 0; 311 int hasVectorUnit = 0;
312 size_t length = sizeof(hasVectorUnit); 312 size_t length = sizeof(hasVectorUnit);
313 int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); 313 int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
314 if( 0 == error ) 314 if( 0 == error )