Fix compilation errors on GCC/Clang

This commit is contained in:
wheremyfoodat 2024-02-23 23:28:21 +00:00 committed by GitHub
parent 318f55f7c3
commit 8fb758eca4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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<s16, 2> sample) { /* Do nothing */ });
teakra.SetAudioCallback([](std::array<s16, 2> 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<s16, 2> sample) {
teakra.SetAudioCallback([this](std::array<s16, 2> sample) {
audioFrame[audioFrameIndex++] = sample[0];
audioFrame[audioFrameIndex++] = sample[1];
@ -140,7 +140,7 @@ void TeakraDSP::setAudioEnabled(bool enable) {
}
});
} else {
teakra.SetAudioCallback([=](std::array<s16, 2> sample) { /* Do nothing */ });
teakra.SetAudioCallback([](std::array<s16, 2> sample) { /* Do nothing */ });
}
}
}