[gnome-applets] cpufreq: fix build with kernel 5.1+
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] cpufreq: fix build with kernel 5.1+
- Date: Sun, 5 May 2019 11:59:38 +0000 (UTC)
commit 5195e93aeb4d5ce9cc29672f0bf327d244621de6
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun May 5 14:45:24 2019 +0300
cpufreq: fix build with kernel 5.1+
configure.ac | 5 +++++
cpufreq/src/cpufreq-monitor.c | 6 ++++++
cpufreq/src/cpufreq-selector/cpufreq-selector.c | 6 ++++++
3 files changed, 17 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index cf90abbd8..44d88c033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -410,6 +410,11 @@ AS_IF([test "x$disable_cpufreq" = "xno"], [
AC_DEFINE([HAVE_IS_CPU_ONLINE], 1,
[Define to 1 if cpupower_is_cpu_online() is available])
cpufreq_lib="cpupower"
+
+ AC_CHECK_LIB([cpupower], [cpufreq_get_frequencies], [
+ AC_DEFINE([HAVE_GET_FREQUENCIES], 1,
+ [Define to 1 if cpufreq_get_frequencies() is available])
+ ])
], [
AC_CHECK_LIB([cpupower], [cpufreq_cpu_exists], [
cpufreq_lib="cpupower"
diff --git a/cpufreq/src/cpufreq-monitor.c b/cpufreq/src/cpufreq-monitor.c
index 663056cf6..680c9dcbd 100644
--- a/cpufreq/src/cpufreq-monitor.c
+++ b/cpufreq/src/cpufreq-monitor.c
@@ -29,6 +29,12 @@
#define CPUFREQ_MONITOR_INTERVAL 1
+#ifdef HAVE_GET_FREQUENCIES
+typedef struct cpufreq_frequencies cpufreq_available_frequencies;
+#define cpufreq_get_available_frequencies(cpu) cpufreq_get_frequencies ("available", cpu)
+#define cpufreq_put_available_frequencies(first) cpufreq_put_frequencies (first)
+#endif
+
typedef struct cpufreq_policy CPUFreqPolicy;
typedef struct cpufreq_available_frequencies CPUFreqFrequencyList;
typedef struct cpufreq_available_governors CPUFreqGovernorList;
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector.c b/cpufreq/src/cpufreq-selector/cpufreq-selector.c
index 68e3e3c80..855f24762 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector.c
@@ -36,6 +36,12 @@ typedef enum
#define CPUFREQ_SELECTOR_ERROR cpufreq_selector_error_quark ()
+#ifdef HAVE_GET_FREQUENCIES
+typedef struct cpufreq_frequencies cpufreq_available_frequencies;
+#define cpufreq_get_available_frequencies(cpu) cpufreq_get_frequencies ("available", cpu)
+#define cpufreq_put_available_frequencies(first) cpufreq_put_frequencies (first)
+#endif
+
typedef struct cpufreq_policy CPUFreqPolicy;
typedef struct cpufreq_available_frequencies CPUFreqFrequencyList;
typedef struct cpufreq_available_governors CPUFreqGovernorList;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]