mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-02 12:12:59 +08:00
Fix on Windows
This commit is contained in:
parent
f62962b3cc
commit
bf92473c2b
|
@ -1162,7 +1162,7 @@ chsrc_get_cpuarch ()
|
|||
#if XY_On_Windows
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo (&info);
|
||||
WORD num = info.wProcessorArchitecture
|
||||
WORD num = info.wProcessorArchitecture;
|
||||
switch (num)
|
||||
{
|
||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||
|
@ -1174,7 +1174,7 @@ chsrc_get_cpuarch ()
|
|||
case PROCESSOR_ARCHITECTURE_IA64:
|
||||
ret = "IA-64"; break;
|
||||
case PROCESSOR_ARCHITECTURE_UNKNOWN:
|
||||
case default:
|
||||
default:
|
||||
char *msg = CliOpt_InEnglish ? "Unable to detect CPU type" : "无法检测到CPU类型";
|
||||
chsrc_error (msg);
|
||||
exit (Exit_UserCause);
|
||||
|
@ -1214,7 +1214,7 @@ chsrc_get_cpucore ()
|
|||
#if XY_On_Windows
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo (&info);
|
||||
DWORD num = sysinfo.dwNumberOfProcessors
|
||||
DWORD num = info.dwNumberOfProcessors;
|
||||
cores = (int)num;
|
||||
#else
|
||||
long num = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
|
|
Loading…
Reference in New Issue
Block a user