diff options
author | Brad Smith <brad@comstyle.com> | 2024-07-01 17:11:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 17:11:21 -0400 |
commit | 3eb795cd0f0c30791a47db105382e275416fdd4f (patch) | |
tree | 63f6e10309f82f85e3c2f299278054c0ea6664dc /third-party | |
parent | 9f03bc3794423512dbca21accc21c98fe7b82b57 (diff) | |
download | llvm-3eb795cd0f0c30791a47db105382e275416fdd4f.zip llvm-3eb795cd0f0c30791a47db105382e275416fdd4f.tar.gz llvm-3eb795cd0f0c30791a47db105382e275416fdd4f.tar.bz2 |
[benchmark] Fix OpenBSD build (#97269)
(cherry picked from commit f3ec7b8820ca8136c4e1dad4552608b51b47831a)
Diffstat (limited to 'third-party')
-rw-r--r-- | third-party/benchmark/src/sysinfo.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/third-party/benchmark/src/sysinfo.cc b/third-party/benchmark/src/sysinfo.cc index 46df973..2bed166 100644 --- a/third-party/benchmark/src/sysinfo.cc +++ b/third-party/benchmark/src/sysinfo.cc @@ -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 |