[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:
lizzie
2025-10-18 01:54:43 +02:00
committed by crueter
parent 84ab54c4bc
commit f55e560ac5
17 changed files with 122 additions and 51 deletions
+24
View File
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -119,4 +122,25 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase*
[[nodiscard]] u32 MapSizeBytes(const ImageBase& image);
// TODO: Remove once Debian STABLE no longer has such outdated boost
// This is a gcc bug where ADL lookup fails for range niebloids of std::span<T>
// for any given type of the static_vector/small_vector, etc which makes a whole mess
// for anything using std::span<T> so we just do this terrible hack on older versions of
// GCC12 because people actually still use stable debian so... yeah
// One may say: "This is bad for performance" - to which I say, using GCC 12 you already know
// what kind of bs you will be dealing with anyways.
template<typename T, size_t N>
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
[[nodiscard]] boost::container::small_vector<T, N> FixSmallVectorADL(const boost::container::small_vector<T, N>& v) {
return v;
}
#else
[[nodiscard]] std::vector<T> FixSmallVectorADL(const boost::container::small_vector<T, N>& v) {
std::vector<T> u;
for (auto const& e : v)
u.push_back(e);
return u;
}
#endif
} // namespace VideoCommon