mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-12-05 21:27:13 -06:00
windows' numcpu detection
This commit is contained in:
@@ -131,5 +131,13 @@ int cpucount(void)
|
|||||||
if (ncpu > 0)
|
if (ncpu > 0)
|
||||||
return ncpu;
|
return ncpu;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _WIN32
|
||||||
|
SYSTEM_INFO sysinfo;
|
||||||
|
GetSystemInfo(&sysinfo);
|
||||||
|
ncpu = (int)sysinfo.dwNumberOfProcessors;
|
||||||
|
if (ncpu > 0)
|
||||||
|
return ncpu;
|
||||||
|
#endif
|
||||||
|
(void) ncpu;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user