From 604b7ce73f73718779caa38e19cda8b4e8bc144a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 31 Dec 2025 16:20:28 +1000 Subject: [PATCH] Misc: Fix building with GCC Not that anyone should be doing it. --- src/common/ryml_helpers.h | 8 +++++--- src/common/zip_helpers.h | 5 +++-- src/core/cpu_core.cpp | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/common/ryml_helpers.h b/src/common/ryml_helpers.h index 1c6c85951..9f190dc27 100644 --- a/src/common/ryml_helpers.h +++ b/src/common/ryml_helpers.h @@ -1,13 +1,15 @@ // SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin // SPDX-License-Identifier: CC-BY-NC-ND-4.0 +#pragma once + #include "log.h" +#include "small_string.h" #include "string_util.h" #include "types.h" -#include "common/small_string.h" - -#include "ryml.hpp" +#include +#include #include #include diff --git a/src/common/zip_helpers.h b/src/common/zip_helpers.h index 33253a46d..9fda18119 100644 --- a/src/common/zip_helpers.h +++ b/src/common/zip_helpers.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin +// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin // SPDX-License-Identifier: CC-BY-NC-ND-4.0 #pragma once @@ -12,7 +12,8 @@ #include #include -#include "zip.h" +#include +#include namespace ZipHelpers { diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index 19c478211..dd5d71bd3 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -521,7 +521,7 @@ ALWAYS_INLINE_RELEASE bool CPU::IsCop0ExecutionBreakpointUnmasked() const u32 bpc = g_state.cop0_regs.BPC; const u32 bpcm = g_state.cop0_regs.BPCM; const u32 masked_bpc = bpc & bpcm; - for (const auto [range_start, range_end] : code_address_ranges) + for (const auto& [range_start, range_end] : code_address_ranges) { if (masked_bpc >= (range_start & bpcm) && masked_bpc <= (range_end & bpcm)) return true; @@ -816,7 +816,7 @@ const std::array(old_value), static_cast(add_value), @@ -827,7 +827,7 @@ ALWAYS_INLINE static constexpr bool AddOverflow(u32 old_value, u32 add_value, u3 #endif } -ALWAYS_INLINE static constexpr bool SubOverflow(u32 old_value, u32 sub_value, u32* new_value) +ALWAYS_INLINE static bool SubOverflow(u32 old_value, u32 sub_value, u32* new_value) { #if defined(__clang__) || defined(__GNUC__) return __builtin_sub_overflow(static_cast(old_value), static_cast(sub_value),