Skip to content

Commit

Permalink
[benchmark] Fix OpenBSD build (#97269)
Browse files Browse the repository at this point in the history
(cherry picked from commit f3ec7b8820ca8136c4e1dad4552608b51b47831a)
  • Loading branch information
brad0 authored Jul 1, 2024
1 parent 9f03bc3 commit 3eb795c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third-party/benchmark/src/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3eb795c

Please sign in to comment.