From 3c64d030c5895519023ac42a925ace289bc8738b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Jan 2024 16:37:00 -0500 Subject: [PATCH 1/5] FreeLookManager: check for __APPLE__ with defined() Previously this was treating the identifier as if it were always defined by default --- Source/Core/Core/FreeLookManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/FreeLookManager.cpp b/Source/Core/Core/FreeLookManager.cpp index 7cf64a08fa..4c5596588d 100644 --- a/Source/Core/Core/FreeLookManager.cpp +++ b/Source/Core/Core/FreeLookManager.cpp @@ -160,7 +160,7 @@ void FreeLookController::LoadDefaults(const ControllerInterface& ciface) "if(`Click 3`,`RelativeMouse Y-` * 0.10, 0)"); m_rotation_gyro->SetControlExpression(GyroButtons::PitchDown, "if(`Click 3`,`RelativeMouse Y+` * 0.10, 0)"); -#elif __APPLE__ +#elif defined(__APPLE__) m_rotation_gyro->SetControlExpression(GyroButtons::PitchUp, "if(`Left Click`,`RelativeMouse Y-` * 0.10, 0)"); m_rotation_gyro->SetControlExpression(GyroButtons::PitchDown, @@ -191,7 +191,7 @@ void FreeLookController::LoadDefaults(const ControllerInterface& ciface) "if(`Click 3`,`RelativeMouse X-` * 0.10, 0)"); m_rotation_gyro->SetControlExpression(GyroButtons::YawRight, "if(`Click 3`,`RelativeMouse X+` * 0.10, 0)"); -#elif __APPLE__ +#elif defined(__APPLE__) m_rotation_gyro->SetControlExpression(GyroButtons::YawLeft, "if(`Right Click`,`RelativeMouse X-` * 0.10, 0)"); m_rotation_gyro->SetControlExpression(GyroButtons::YawRight, From a9f89a7d3b71bb151f509b1c499cba8af166b048 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Jan 2024 16:38:26 -0500 Subject: [PATCH 2/5] WiimoteEmu: check for __APPLE__ with defined() This is only defined on certain platforms and isn't always defined. --- Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index e74e807898..b3aab5b486 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -694,7 +694,7 @@ void Wiimote::LoadDefaults(const ControllerInterface& ciface) m_buttons->SetControlExpression(0, "`Click 1`"); // B m_buttons->SetControlExpression(1, "`Click 3`"); -#elif __APPLE__ +#elif defined(__APPLE__) // A m_buttons->SetControlExpression(0, "`Left Click`"); // B From f695ae573084b4b2fa736737037e635f9c02f2c3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Jan 2024 16:42:33 -0500 Subject: [PATCH 3/5] JitInterface: Use #ifdef instead of #if for platform testing \#if assumes the symbols will always be defined, but they aren't depending on the platform. --- Source/Core/Core/PowerPC/JitInterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index d44a648fd6..ed60b4d489 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -32,11 +32,11 @@ #include "Core/PowerPC/Profiler.h" #include "Core/System.h" -#if _M_X86_64 +#ifdef _M_X86_64 #include "Core/PowerPC/Jit64/Jit.h" #endif -#if _M_ARM_64 +#ifdef _M_ARM_64 #include "Core/PowerPC/JitArm64/Jit.h" #endif @@ -61,12 +61,12 @@ CPUCoreBase* JitInterface::InitJitCore(PowerPC::CPUCore core) { switch (core) { -#if _M_X86_64 +#ifdef _M_X86_64 case PowerPC::CPUCore::JIT64: m_jit = std::make_unique(m_system); break; #endif -#if _M_ARM_64 +#ifdef _M_ARM_64 case PowerPC::CPUCore::JITARM64: m_jit = std::make_unique(m_system); break; From 4ccc5178a6eb8a29367d920200a17c5569b79f54 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Jan 2024 16:47:40 -0500 Subject: [PATCH 4/5] PowerPC: Use #ifdef instead of #if for platform testing This way we don't assume these symbols are always defined. --- Source/Core/Core/PowerPC/PowerPC.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h index c473f20fd0..c0611ae916 100644 --- a/Source/Core/Core/PowerPC/PowerPC.h +++ b/Source/Core/Core/PowerPC/PowerPC.h @@ -160,7 +160,7 @@ struct PowerPCState // lscbx u16 xer_stringctrl = 0; -#if _M_X86_64 +#ifdef _M_X86_64 // This member exists only for the purpose of an assertion that its offset <= 0x100. std::tuple<> above_fits_in_first_0x100; @@ -234,7 +234,7 @@ struct PowerPCState void UpdateFPRFSingle(float fvalue); }; -#if _M_X86_64 +#ifdef _M_X86_64 #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Winvalid-offsetof" From 258161bab7de7fdc5517ca283c9da1e133c76543 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Jan 2024 16:51:31 -0500 Subject: [PATCH 5/5] DolphinAnalytics: Use #ifdef instead of #if for platform testing --- Source/Core/Core/DolphinAnalytics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/DolphinAnalytics.cpp b/Source/Core/Core/DolphinAnalytics.cpp index 5593a66963..a7bb39d394 100644 --- a/Source/Core/Core/DolphinAnalytics.cpp +++ b/Source/Core/Core/DolphinAnalytics.cpp @@ -293,7 +293,7 @@ void DolphinAnalytics::MakeBaseBuilder() }; // Under arm64, we need to call objc_msgSend to recieve a struct. // On x86_64, we need to explicitly call objc_msgSend_stret for a struct. -#if _M_ARM_64 +#ifdef _M_ARM_64 #define msgSend objc_msgSend #else #define msgSend objc_msgSend_stret