Commit 3953586c authored by Pierre's avatar Pierre
Browse files

cpu: Implement vlc_GetCPUCount() on Mac OS X.

parent 9f410e42
......@@ -344,6 +344,12 @@ unsigned vlc_GetCPUCount(void)
for (unsigned i = 0; i < CPU_SETSIZE; i++)
count += CPU_ISSET(i, &cpu) != 0;
return count;
#elif defined(__APPLE_)
int count;
size_t size = sizeof(count) ;
if (sysctlbyname("hw.ncpu", &count, &size, NULL, 0))
return 1; /* Failure */
return count;
#else
# warning "vlc_GetCPUCount is not implemented for your platform"
return 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment