Commit 3953586c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

cpu: Implement vlc_GetCPUCount() on Mac OS X.

parent 9f410e42
...@@ -344,6 +344,12 @@ unsigned vlc_GetCPUCount(void) ...@@ -344,6 +344,12 @@ unsigned vlc_GetCPUCount(void)
for (unsigned i = 0; i < CPU_SETSIZE; i++) for (unsigned i = 0; i < CPU_SETSIZE; i++)
count += CPU_ISSET(i, &cpu) != 0; count += CPU_ISSET(i, &cpu) != 0;
return count; 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 #else
# warning "vlc_GetCPUCount is not implemented for your platform" # warning "vlc_GetCPUCount is not implemented for your platform"
return 1; 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