diff --git a/desmume/src/utils/task.cpp b/desmume/src/utils/task.cpp index 7ad2ea8db..a0088ced0 100644 --- a/desmume/src/utils/task.cpp +++ b/desmume/src/utils/task.cpp @@ -23,9 +23,9 @@ #include #else #include -#if defined HOST_LINUX || defined HOST_DARWIN +#if defined HOST_LINUX #include -#elif defined HOST_BSD +#elif defined HOST_BSD || defined HOST_DARWIN #include #endif #endif // HOST_WINDOWS @@ -37,11 +37,11 @@ int getOnlineCores (void) SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); return sysinfo.dwNumberOfProcessors; -#elif defined HOST_LINUX || defined HOST_DARWIN +#elif defined HOST_LINUX return sysconf(_SC_NPROCESSORS_ONLN); -#elif defined HOST_BSD +#elif defined HOST_BSD || defined HOST_DARWIN int cores; - const int mib[4] = { CTL_HW, HW_NCPU, 0, 0 }; + int mib[4] = { CTL_HW, HW_NCPU, 0, 0 }; size_t len = sizeof(cores); //don't make this const, i guess sysctl can't take a const * sysctl(mib, 2, &cores, &len, NULL, 0); return (cores < 1) ? 1 : cores;