mirror of
https://github.com/google/benchmark.git
synced 2025-02-21 00:30:13 +08:00
Fix compilation for Android (#816)
Android doesn't support `getloadavg`
This commit is contained in:
parent
33d4404650
commit
b988639f31
@ -658,9 +658,9 @@ double GetCPUCyclesPerSecond() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> GetLoadAvg() {
|
std::vector<double> GetLoadAvg() {
|
||||||
#if defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
|
#if (defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
|
||||||
defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
|
defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
|
||||||
defined BENCHMARK_OS_OPENBSD
|
defined BENCHMARK_OS_OPENBSD) && !defined(__ANDROID__)
|
||||||
constexpr int kMaxSamples = 3;
|
constexpr int kMaxSamples = 3;
|
||||||
std::vector<double> res(kMaxSamples, 0.0);
|
std::vector<double> res(kMaxSamples, 0.0);
|
||||||
const int nelem = getloadavg(res.data(), kMaxSamples);
|
const int nelem = getloadavg(res.data(), kMaxSamples);
|
||||||
|
Loading…
Reference in New Issue
Block a user