Mercurial > sdl-ios-xcode
comparison src/cpuinfo/SDL_cpuinfo.c @ 3606:1a4456a01995
Fixed bug #924
Only use sysconf if _SC_NPROCESSORS_ONLN is available. Fortunately the case for this was Mac OS X 10.4, which has sysctlbyname()
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 06 Jan 2010 04:33:31 +0000 |
parents | 2080e8d75ac6 |
children | f7b03b6838cb |
comparison
equal
deleted
inserted
replaced
3605:55b0a0191163 | 3606:1a4456a01995 |
---|---|
306 | 306 |
307 int | 307 int |
308 SDL_GetCPUCount() | 308 SDL_GetCPUCount() |
309 { | 309 { |
310 if (!SDL_CPUCount) { | 310 if (!SDL_CPUCount) { |
311 #ifdef HAVE_SYSCONF | 311 #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) |
312 if (SDL_CPUCount <= 0) { | 312 if (SDL_CPUCount <= 0) { |
313 SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN); | 313 SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN); |
314 } | 314 } |
315 #endif | 315 #endif |
316 #ifdef HAVE_SYSCTLBYNAME | 316 #ifdef HAVE_SYSCTLBYNAME |