comparison src/cpuinfo/SDL_cpuinfo.c @ 5088:c2539ff054c8

Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
author Sam Lantinga <slouken@libsdl.org>
date Mon, 24 Jan 2011 15:46:11 -0800
parents e8916fe9cfc8
children 327f181542f1
comparison
equal deleted inserted replaced
5087:e7680e2c9f3c 5088:c2539ff054c8
36 #include <sys/sysctl.h> /* For AltiVec check */ 36 #include <sys/sysctl.h> /* For AltiVec check */
37 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP 37 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
38 #include <signal.h> 38 #include <signal.h>
39 #include <setjmp.h> 39 #include <setjmp.h>
40 #endif 40 #endif
41 #ifdef __WINDOWS__ 41 #ifdef __WIN32__
42 #define WIN32_LEAN_AND_MEAN 42 #define WIN32_LEAN_AND_MEAN
43 #include <windows.h> 43 #include <windows.h>
44 #endif 44 #endif
45 45
46 #define CPU_HAS_RDTSC 0x00000001 46 #define CPU_HAS_RDTSC 0x00000001
317 if (SDL_CPUCount <= 0) { 317 if (SDL_CPUCount <= 0) {
318 size_t size = sizeof(SDL_CPUCount); 318 size_t size = sizeof(SDL_CPUCount);
319 sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0); 319 sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0);
320 } 320 }
321 #endif 321 #endif
322 #ifdef __WINDOWS__ 322 #ifdef __WIN32__
323 if (SDL_CPUCount <= 0) { 323 if (SDL_CPUCount <= 0) {
324 SYSTEM_INFO info; 324 SYSTEM_INFO info;
325 GetSystemInfo(&info); 325 GetSystemInfo(&info);
326 SDL_CPUCount = info.dwNumberOfProcessors; 326 SDL_CPUCount = info.dwNumberOfProcessors;
327 } 327 }