From 8fb758eca4f0ef9cbb0599d779da9233269b8c48 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Fri, 23 Feb 2024 23:28:21 +0000 Subject: [PATCH] Fix compilation errors on GCC/Clang --- include/ring_buffer.hpp | 2 +- src/core/audio/teakra_core.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ring_buffer.hpp b/include/ring_buffer.hpp index d4397f8f..e27bb8da 100644 --- a/include/ring_buffer.hpp +++ b/include/ring_buffer.hpp @@ -96,7 +96,7 @@ namespace Common { // Having them on the same cache-line would result in false-sharing between them. // TODO: Remove this ifdef whenever clang and GCC support // std::hardware_destructive_interference_size. -#ifdef __cpp_lib_hardware_interference_size +#if __cpp_lib_hardware_interference_size == 201703L alignas(std::hardware_destructive_interference_size) std::atomic_size_t m_read_index{0}; alignas(std::hardware_destructive_interference_size) std::atomic_size_t m_write_index{0}; #else diff --git a/src/core/audio/teakra_core.cpp b/src/core/audio/teakra_core.cpp index bdbf39d9..da2e5a5a 100644 --- a/src/core/audio/teakra_core.cpp +++ b/src/core/audio/teakra_core.cpp @@ -53,7 +53,7 @@ TeakraDSP::TeakraDSP(Memory& mem, Scheduler& scheduler, DSPService& dspService) ahbm.write32 = [&](u32 addr, u32 value) { *(u32*)&mem.getFCRAM()[addr - PhysicalAddrs::FCRAM] = value; }; teakra.SetAHBMCallback(ahbm); - teakra.SetAudioCallback([=](std::array sample) { /* Do nothing */ }); + teakra.SetAudioCallback([](std::array sample) { /* Do nothing */ }); // Set up event handlers. These handlers forward a hardware interrupt to the DSP service, which is responsible // For triggering the appropriate DSP kernel events @@ -123,7 +123,7 @@ void TeakraDSP::setAudioEnabled(bool enable) { // Set the appropriate audio callback for Teakra if (audioEnabled) { - teakra.SetAudioCallback([=](std::array sample) { + teakra.SetAudioCallback([this](std::array sample) { audioFrame[audioFrameIndex++] = sample[0]; audioFrame[audioFrameIndex++] = sample[1]; @@ -140,7 +140,7 @@ void TeakraDSP::setAudioEnabled(bool enable) { } }); } else { - teakra.SetAudioCallback([=](std::array sample) { /* Do nothing */ }); + teakra.SetAudioCallback([](std::array sample) { /* Do nothing */ }); } } }