Commit 72ce39de by Kaito Udagawa

Fix the compilation error against G++ on Mac OS X.

Using `0` as a null pointer is illegal when `-Wzero-as-null-pointer-constant` is given to G++. To avoid the warning `zero-as-null-pointer-constant`, `nullptr` (C++11 keyword) instead of `0` is used in the `sysctl` invocation.
parent d60945ac
...@@ -267,7 +267,7 @@ void InitializeSystemInfo() { ...@@ -267,7 +267,7 @@ void InitializeSystemInfo() {
int num_cpus = 0; int num_cpus = 0;
size_t size = sizeof(num_cpus); size_t size = sizeof(num_cpus);
int numcpus_name[] = {CTL_HW, HW_NCPU}; int numcpus_name[] = {CTL_HW, HW_NCPU};
if (::sysctl(numcpus_name, arraysize(numcpus_name), &num_cpus, &size, 0, 0) == if (::sysctl(numcpus_name, arraysize(numcpus_name), &num_cpus, &size, nullptr, 0) ==
0 && 0 &&
(size == sizeof(num_cpus))) (size == sizeof(num_cpus)))
cpuinfo_num_cpus = num_cpus; cpuinfo_num_cpus = num_cpus;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment