From 1e1a20562bdffc8aea062cd5f151ef3009d3c096 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 12 May 2025 18:53:30 +0800 Subject: [PATCH] smc: disable for PowerPC --- src/osx/btop_collect.cpp | 7 +++++++ src/osx/smc.cpp | 5 +++++ 2 files changed, 12 insertions(+) diff --git src/osx/btop_collect.cpp src/osx/btop_collect.cpp index 0300304..9ed8fe1 100644 --- src/osx/btop_collect.cpp +++ src/osx/btop_collect.cpp @@ -228,6 +228,7 @@ namespace Cpu { macM1 = true; } else { #endif +#ifndef __POWERPC__ // try SMC (intel) Logger::debug("checking intel"); SMCConnection smcCon; @@ -252,6 +253,10 @@ namespace Cpu { // ignore, we don't have temp got_sensors = false; } +#else + Logger::debug("not supported on PowerPC yet"); + got_sensors = false; +#endif // __POWERPC__ #if __MAC_OS_X_VERSION_MIN_REQUIRED > 101504 } #endif @@ -262,6 +267,7 @@ namespace Cpu { void update_sensors() { current_cpu.temp_max = 95; // we have no idea how to get the critical temp try { +#ifndef __POWERPC__ if (macM1) { #if __MAC_OS_X_VERSION_MIN_REQUIRED > 101504 ThermalSensors sensors; @@ -284,6 +290,7 @@ namespace Cpu { } } } +#endif // __POWERPC__ } catch (std::runtime_error &e) { got_sensors = false; Logger::error("failed getting CPU temp"); diff --git src/osx/smc.cpp src/osx/smc.cpp index c972d29..b2a2a7a 100644 --- src/osx/smc.cpp +++ src/osx/smc.cpp @@ -16,6 +16,9 @@ indent = tab tab-size = 4 */ +/* Not supported on PowerPC */ +#ifndef __POWERPC__ + #include "smc.hpp" static constexpr size_t MaxIndexCount = sizeof("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") - 1; @@ -152,3 +155,5 @@ namespace Cpu { } } // namespace Cpu + +#endif // __POWERPC__