mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-13 09:41:03 +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
|
#if XY_On_Windows
|
||||||
SYSTEM_INFO info;
|
SYSTEM_INFO info;
|
||||||
GetSystemInfo (&info);
|
GetSystemInfo (&info);
|
||||||
WORD num = info.wProcessorArchitecture
|
WORD num = info.wProcessorArchitecture;
|
||||||
switch (num)
|
switch (num)
|
||||||
{
|
{
|
||||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||||
|
@ -1174,7 +1174,7 @@ chsrc_get_cpuarch ()
|
||||||
case PROCESSOR_ARCHITECTURE_IA64:
|
case PROCESSOR_ARCHITECTURE_IA64:
|
||||||
ret = "IA-64"; break;
|
ret = "IA-64"; break;
|
||||||
case PROCESSOR_ARCHITECTURE_UNKNOWN:
|
case PROCESSOR_ARCHITECTURE_UNKNOWN:
|
||||||
case default:
|
default:
|
||||||
char *msg = CliOpt_InEnglish ? "Unable to detect CPU type" : "无法检测到CPU类型";
|
char *msg = CliOpt_InEnglish ? "Unable to detect CPU type" : "无法检测到CPU类型";
|
||||||
chsrc_error (msg);
|
chsrc_error (msg);
|
||||||
exit (Exit_UserCause);
|
exit (Exit_UserCause);
|
||||||
|
@ -1214,7 +1214,7 @@ chsrc_get_cpucore ()
|
||||||
#if XY_On_Windows
|
#if XY_On_Windows
|
||||||
SYSTEM_INFO info;
|
SYSTEM_INFO info;
|
||||||
GetSystemInfo (&info);
|
GetSystemInfo (&info);
|
||||||
DWORD num = sysinfo.dwNumberOfProcessors
|
DWORD num = info.dwNumberOfProcessors;
|
||||||
cores = (int)num;
|
cores = (int)num;
|
||||||
#else
|
#else
|
||||||
long num = sysconf(_SC_NPROCESSORS_ONLN);
|
long num = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user