mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-04-21 06:19:09 +00:00
windows' numcpu detection
This commit is contained in:
parent
24f35b6197
commit
fa7d5cdab5
1 changed files with 8 additions and 0 deletions
|
@ -131,5 +131,13 @@ int cpucount(void)
|
|||
if (ncpu > 0)
|
||||
return ncpu;
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
ncpu = (int)sysinfo.dwNumberOfProcessors;
|
||||
if (ncpu > 0)
|
||||
return ncpu;
|
||||
#endif
|
||||
(void) ncpu;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue