[benchmark] Fix OpenBSD build (#97269)
(cherry picked from commit f3ec7b8820ca8136c4e1dad4552608b51b47831a)
This commit is contained in:
parent
9f03bc3794
commit
3eb795cd0f
4
third-party/benchmark/src/sysinfo.cc
vendored
4
third-party/benchmark/src/sysinfo.cc
vendored
@ -169,7 +169,7 @@ ValueUnion GetSysctlImp(std::string const& name) {
|
||||
mib[1] = HW_CPUSPEED;
|
||||
}
|
||||
|
||||
if (sysctl(mib, 2, buff.data(), &buff.Size, nullptr, 0) == -1) {
|
||||
if (sysctl(mib, 2, buff.data(), &buff.size, nullptr, 0) == -1) {
|
||||
return ValueUnion();
|
||||
}
|
||||
return buff;
|
||||
@ -742,7 +742,7 @@ double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
|
||||
#endif
|
||||
unsigned long long hz = 0;
|
||||
#if defined BENCHMARK_OS_OPENBSD
|
||||
if (GetSysctl(freqStr, &hz)) return hz * 1000000;
|
||||
if (GetSysctl(freqStr, &hz)) return static_cast<double>(hz * 1000000);
|
||||
#else
|
||||
if (GetSysctl(freqStr, &hz)) return hz;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user