From c04b3d15d914b089d0c7cf512723010aefdb8896 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 7 Aug 2026 03:16:58 +0000 Subject: [PATCH 20/38] displayserver: define CG_LEGACY_API for pre-10.6/PowerPC targets and declare ffdsParseRefreshRate Ported from https://github.com/macos-powerpc/powerpc-ports/blob/main/sysutils/fastfetch/files/0012-Misc-fixes-for-legacy-systems.patch --- src/detection/displayserver/displayserver.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/detection/displayserver/displayserver.h b/src/detection/displayserver/displayserver.h index 715a2de43..1a18e0a4b 100644 --- a/src/detection/displayserver/displayserver.h +++ b/src/detection/displayserver/displayserver.h @@ -3,6 +3,13 @@ #include "fastfetch.h" #include "modules/display/option.h" +#ifdef __APPLE__ +#include +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 || defined(__ppc__) +#define CG_LEGACY_API +#endif +#endif + #define FF_DE_PRETTY_PLASMA "KDE Plasma" #define FF_DE_PRETTY_GNOME "GNOME" #define FF_DE_PRETTY_GNOME_CLASSIC "GNOME Classic" @@ -104,6 +111,10 @@ typedef struct FFDisplayServerResult { const FFDisplayServerResult* ffConnectDisplayServer(); +#ifdef CG_LEGACY_API +uint32_t ffdsParseRefreshRate(int32_t refreshRate); +#endif + FFDisplayResult* ffdsAppendDisplay( FFDisplayServerResult* result, uint32_t width, -- 2.43.0