intel_cpus.cpp: Change open parameter to const char *
Rosen Penev
PATCH 1/1 intel_cpus.cpp: Change open parameter to const char *
ifstream::open takes std::string starting with C++11, not before.
This fixes compilation with uClibc++ and potentially other older libraries
--- src/cpu/intel_cpus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/cpu/intel_cpus.cpp +1 -1
@@ -92,7 +92,7 @@ int is_supported_intel_cpu(int model, int cpu) int is_intel_pstate_driver_loaded() { - const string filename("/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver"); + const char *filename = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver"; const string intel_pstate("intel_pstate"); char line[32] = { '\0' }; ifstream file;
Signature · 1 line
2.17.1
Kammela
AppliedThanks, Applied!
Quoted 39 lines
-----Original Message-----
From: PowerTop [mailto:powertop-bounces(a)lists.01.org] On Behalf Of Rosen Penev
Sent: Saturday, March 30, 2019 8:22 PM
To: powertop(a)lists.01.org
Subject: [Powertop] [PATCH] intel_cpus.cpp: Change open parameter to const char *
ifstream::opentakesstd::stringstarting with C++11, not before.This fixes compilation with uClibc++ and potentially other older libraries
Signed-off-by Rosen Penev <rosenp(a)gmail.com>--- src/cpu/intel_cpus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/cpu/intel_cpus.cpp index renamed from src/cpu/intel_cpus.cpp +0
-00030dba..4dffadc 100644
src/cpu/intel_cpus.cpp +2
-2@@ -92,7 +92,7 @@ int is_supported_intel_cpu(int model, int cpu) int is_intel_pstate_driver_loaded() { - const string filename("/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver"); + const char *filename = +"/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver"; const string intel_pstate("intel_pstate"); char line[32] = { '\0' }; ifstream file; --2.17.1
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop