Only use sysconf if _SC_NPROCESSORS_ONLN is available.  Fortunately the case for this was Mac OS X 10.4, which has sysctlbyname()
This commit is contained in:
Sam Lantinga 2010-01-06 04:33:31 +00:00
parent 4386417754
commit 8eaf7c78b9

View File

@ -308,7 +308,7 @@ int
SDL_GetCPUCount()
{
if (!SDL_CPUCount) {
#ifdef HAVE_SYSCONF
#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
if (SDL_CPUCount <= 0) {
SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN);
}