From 04d2cf1f25f669ada3b5e8b7f6cee306305cc137 Mon Sep 17 00:00:00 2001 From: RipleyTom Date: Sat, 24 Feb 2024 16:30:38 +0100 Subject: [PATCH] Fix Apple Clang build --- darwin/util/sysinfo_darwin.mm | 3 +++ rpcs3/Input/gui_pad_thread.cpp | 3 +++ rpcs3/display_sleep_control.cpp | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/darwin/util/sysinfo_darwin.mm b/darwin/util/sysinfo_darwin.mm index e398b69d0382..e1ffe458f3c6 100644 --- a/darwin/util/sysinfo_darwin.mm +++ b/darwin/util/sysinfo_darwin.mm @@ -1,4 +1,7 @@ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" #import +#pragma GCC diagnostic pop namespace Darwin_Version { diff --git a/rpcs3/Input/gui_pad_thread.cpp b/rpcs3/Input/gui_pad_thread.cpp index 4ddb6d44e01d..92fb23367da9 100644 --- a/rpcs3/Input/gui_pad_thread.cpp +++ b/rpcs3/Input/gui_pad_thread.cpp @@ -24,8 +24,11 @@ #include #define CHECK_IOCTRL_RET(res) if (res == -1) { gui_log.error("gui_pad_thread: ioctl failed (errno=%d=%s)", res, strerror(errno)); } #elif defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" #include #include +#pragma GCC diagnostic pop #endif #include diff --git a/rpcs3/display_sleep_control.cpp b/rpcs3/display_sleep_control.cpp index 8e51abb79f6b..42c371dfe821 100644 --- a/rpcs3/display_sleep_control.cpp +++ b/rpcs3/display_sleep_control.cpp @@ -4,7 +4,10 @@ #include #elif defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" #include +#pragma GCC diagnostic pop static IOPMAssertionID s_pm_assertion = kIOPMNullAssertionID; @@ -78,7 +81,11 @@ void disable_display_sleep() #ifdef _WIN32 SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); #elif defined(__APPLE__) +#pragma GCC diagnostic push +// Necessary as some of those values are macro using old casts +#pragma GCC diagnostic ignored "-Wold-style-cast" IOPMAssertionCreateWithName(kIOPMAssertionTypePreventUserIdleDisplaySleep, kIOPMAssertionLevelOn, CFSTR("Game running"), &s_pm_assertion); +#pragma GCC diagnostic pop #elif defined(HAVE_QTDBUS) for (const char* service : { "org.freedesktop.ScreenSaver", "org.mate.ScreenSaver" }) {