Skip to content

Commit 3eb795c

Browse files
authored
[benchmark] Fix OpenBSD build (#97269)
(cherry picked from commit f3ec7b8820ca8136c4e1dad4552608b51b47831a)
1 parent 9f03bc3 commit 3eb795c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

third-party/benchmark/src/sysinfo.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ ValueUnion GetSysctlImp(std::string const& name) {
169169
mib[1] = HW_CPUSPEED;
170170
}
171171

172-
if (sysctl(mib, 2, buff.data(), &buff.Size, nullptr, 0) == -1) {
172+
if (sysctl(mib, 2, buff.data(), &buff.size, nullptr, 0) == -1) {
173173
return ValueUnion();
174174
}
175175
return buff;
@@ -742,7 +742,7 @@ double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
742742
#endif
743743
unsigned long long hz = 0;
744744
#if defined BENCHMARK_OS_OPENBSD
745-
if (GetSysctl(freqStr, &hz)) return hz * 1000000;
745+
if (GetSysctl(freqStr, &hz)) return static_cast<double>(hz * 1000000);
746746
#else
747747
if (GetSysctl(freqStr, &hz)) return hz;
748748
#endif

0 commit comments

Comments
 (0)