Mercurial > sdl-ios-xcode
comparison src/cpuinfo/SDL_cpuinfo.c @ 1402:d910939febfa
Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 21 Feb 2006 08:46:50 +0000 |
parents | 19418e4422cb |
children | ef9a9064bff2 |
comparison
equal
deleted
inserted
replaced
1401:1819fd069e89 | 1402:d910939febfa |
---|---|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 |
19 Sam Lantinga | 19 Sam Lantinga |
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 #include "SDL_config.h" | |
22 | 23 |
23 /* CPU feature detection for SDL */ | 24 /* CPU feature detection for SDL */ |
24 | 25 |
25 #include "SDL.h" | 26 #include "SDL.h" |
26 #include "SDL_cpuinfo.h" | 27 #include "SDL_cpuinfo.h" |
28 #if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP | 29 #if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP |
29 #include <signal.h> | 30 #include <signal.h> |
30 #include <setjmp.h> | 31 #include <setjmp.h> |
31 #endif | 32 #endif |
32 | 33 |
33 #if MACOSX | 34 #ifdef __MACOSX__ |
34 #include <sys/sysctl.h> /* For AltiVec check */ | 35 #include <sys/sysctl.h> /* For AltiVec check */ |
35 #endif | 36 #endif |
36 | 37 |
37 #define CPU_HAS_RDTSC 0x00000001 | 38 #define CPU_HAS_RDTSC 0x00000001 |
38 #define CPU_HAS_MMX 0x00000002 | 39 #define CPU_HAS_MMX 0x00000002 |
305 } | 306 } |
306 | 307 |
307 static __inline__ int CPU_haveAltiVec() | 308 static __inline__ int CPU_haveAltiVec() |
308 { | 309 { |
309 volatile int altivec = 0; | 310 volatile int altivec = 0; |
310 #if MACOSX | 311 #ifdef __MACOSX__ |
311 int selectors[2] = { CTL_HW, HW_VECTORUNIT }; | 312 int selectors[2] = { CTL_HW, HW_VECTORUNIT }; |
312 int hasVectorUnit = 0; | 313 int hasVectorUnit = 0; |
313 size_t length = sizeof(hasVectorUnit); | 314 size_t length = sizeof(hasVectorUnit); |
314 int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); | 315 int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); |
315 if( 0 == error ) | 316 if( 0 == error ) |