Implement rarch_get_cpu_cores for Android and Xbox 360

This commit is contained in:
twinaphex 2014-04-15 22:42:10 +02:00
parent 6bb5a08f3e
commit dade7c4af1

View File

@ -299,6 +299,8 @@ unsigned rarch_get_cpu_cores(void)
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
return sysinfo.dwNumberOfProcessors;
#elif defined(ANDROID)
return android_getCpuCount();
#elif defined(_SC_NPROCESSORS_ONLN) // Linux, most unix-likes.
long ret = sysconf(_SC_NPROCESSORS_ONLN);
if (ret <= 0)
@ -321,6 +323,8 @@ unsigned rarch_get_cpu_cores(void)
num_cpu = 1;
}
return num_cpu;
#elif defined(_XBOX360)
return 3;
#else
// No idea, assume single core.
return 1;