mirror of https://github.com/google/benchmark.git
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.
This commit is contained in:
parent
d60945ac43
commit
72ce39de3e
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue