mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Stub parseCpuFrequencies on *BSD platforms
This commit is contained in:
parent
08ea5ebe1f
commit
99643ba2e6
@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
#include <spdlog/spdlog.h>
|
||||||
#include <cstdlib> // malloc
|
#include <cstdlib> // malloc
|
||||||
#include <unistd.h> // sysconf
|
#include <unistd.h> // sysconf
|
||||||
|
#include <cmath> // NAN
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
# include <sys/sched.h>
|
# include <sys/sched.h>
|
||||||
@ -97,5 +99,10 @@ std::vector<std::tuple<size_t, size_t>> waybar::modules::Cpu::parseCpuinfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<float> waybar::modules::Cpu::parseCpuFrequencies() {
|
std::vector<float> waybar::modules::Cpu::parseCpuFrequencies() {
|
||||||
throw std::runtime_error("Cpu frequency is not implemented on BSD.");
|
static std::vector<float> frequencies;
|
||||||
|
if (frequencies.empty()) {
|
||||||
|
spdlog::warn("cpu/bsd: parseCpuFrequencies is not implemented, expect garbage in {*_frequency}");
|
||||||
|
frequencies.push_back(NAN);
|
||||||
|
}
|
||||||
|
return frequencies;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user