mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-29 17:39:01 +02:00
[compat] Debian stable gcc12/clang14 compilation fixes (#2763)
Mainly because - while we can just give out an AppImage and call it a day - building natively should be an option for all major distros. And "base" stable debian doesn't provide a new enough g++/clang++ so... we need to make some "fixups". Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2763 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
84ab54c4bc
commit
f55e560ac5
17 changed files with 122 additions and 51 deletions
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -11,6 +14,21 @@
|
|||
#include "core/core_timing.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
|
||||
// See texture_cache/util.h
|
||||
template<typename T, size_t N>
|
||||
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
|
||||
[[nodiscard]] boost::container::static_vector<T, N> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
|
||||
return v;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] std::vector<T> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
|
||||
std::vector<T> u;
|
||||
for (auto const& e : v)
|
||||
u.push_back(e);
|
||||
return u;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace AudioCore::AudioIn {
|
||||
|
||||
System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_)
|
||||
|
|
@ -92,7 +110,7 @@ Result System::Start() {
|
|||
|
||||
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
|
||||
buffers.RegisterBuffers(buffers_to_flush);
|
||||
session->AppendBuffers(buffers_to_flush);
|
||||
session->AppendBuffers(FixStaticVectorADL(buffers_to_flush));
|
||||
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
|
||||
|
||||
return ResultSuccess;
|
||||
|
|
@ -137,7 +155,7 @@ void System::RegisterBuffers() {
|
|||
if (state == State::Started) {
|
||||
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
|
||||
buffers.RegisterBuffers(registered_buffers);
|
||||
session->AppendBuffers(registered_buffers);
|
||||
session->AppendBuffers(FixStaticVectorADL(registered_buffers));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -11,6 +14,21 @@
|
|||
#include "core/core_timing.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
|
||||
// See texture_cache/util.h
|
||||
template<typename T, size_t N>
|
||||
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
|
||||
[[nodiscard]] boost::container::static_vector<T, N> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
|
||||
return v;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] std::vector<T> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
|
||||
std::vector<T> u;
|
||||
for (auto const& e : v)
|
||||
u.push_back(e);
|
||||
return u;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace AudioCore::AudioOut {
|
||||
|
||||
System::System(Core::System& system_, Kernel::KEvent* event_, size_t session_id_)
|
||||
|
|
@ -91,7 +109,7 @@ Result System::Start() {
|
|||
|
||||
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
|
||||
buffers.RegisterBuffers(buffers_to_flush);
|
||||
session->AppendBuffers(buffers_to_flush);
|
||||
session->AppendBuffers(FixStaticVectorADL(buffers_to_flush));
|
||||
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
|
||||
|
||||
return ResultSuccess;
|
||||
|
|
@ -136,7 +154,7 @@ void System::RegisterBuffers() {
|
|||
if (state == State::Started) {
|
||||
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
|
||||
buffers.RegisterBuffers(registered_buffers);
|
||||
session->AppendBuffers(registered_buffers);
|
||||
session->AppendBuffers(FixStaticVectorADL(registered_buffers));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue