mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 19:36:55 +02:00
build: fix clang-cl compile of ResourceTracking
Tracker::IndirectImagePlan lives in an anonymous namespace, so std::projected cannot be formed for it and the three std::ranges algorithms over m_indirect_images fail to compile under clang-cl with the MSVC STL: error: function 'std::projected<..., std::identity>::operator*' is used but not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage Using the iterator-pair overloads compiles and is otherwise identical. Seen with clang-cl and MSVC 14.29 (VS2019) STL. CI does not catch this because its build targets are launcher and the smaller test binaries; kyty_emulator, which is what pulls in this file, is never built there.
This commit is contained in:
@@ -139,7 +139,8 @@ public:
|
||||
}
|
||||
std::erase_if(m_program.dynamic_reads, [&](Value value) {
|
||||
const auto* inst = value.Resolve().TryInstruction();
|
||||
return std::ranges::any_of(m_indirect_images, [&](const IndirectImagePlan& plan) {
|
||||
return std::any_of(m_indirect_images.begin(), m_indirect_images.end(),
|
||||
[&](const IndirectImagePlan& plan) {
|
||||
return std::ranges::find(plan.reads, inst) != plan.reads.end();
|
||||
});
|
||||
});
|
||||
@@ -432,14 +433,16 @@ private:
|
||||
|
||||
const IndirectImagePlan* FindIndirectImage(const Inst& handle) const {
|
||||
const auto found =
|
||||
std::ranges::find_if(m_indirect_images, [&](const IndirectImagePlan& plan) {
|
||||
std::find_if(m_indirect_images.begin(), m_indirect_images.end(),
|
||||
[&](const IndirectImagePlan& plan) {
|
||||
return plan.handle == &handle;
|
||||
});
|
||||
return found == m_indirect_images.end() ? nullptr : &*found;
|
||||
}
|
||||
|
||||
bool IsIndirectPlanningMemory(uint32_t index) const {
|
||||
return std::ranges::any_of(m_indirect_images, [&](const IndirectImagePlan& plan) {
|
||||
return std::any_of(m_indirect_images.begin(), m_indirect_images.end(),
|
||||
[&](const IndirectImagePlan& plan) {
|
||||
return std::ranges::find(plan.memory, index) != plan.memory.end();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user