Fixed bug #924
authorSam Lantinga <slouken@libsdl.org>
Wed, 06 Jan 2010 04:33:31 +0000
changeset 36061a4456a01995
parent 3605 55b0a0191163
child 3607 8b4c0320638e
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()
src/cpuinfo/SDL_cpuinfo.c
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Wed Dec 30 19:48:23 2009 +0000
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Wed Jan 06 04:33:31 2010 +0000
     1.3 @@ -308,7 +308,7 @@
     1.4  SDL_GetCPUCount()
     1.5  {
     1.6      if (!SDL_CPUCount) {
     1.7 -#ifdef HAVE_SYSCONF
     1.8 +#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
     1.9          if (SDL_CPUCount <= 0) {
    1.10              SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN);
    1.11          }