From 12585b9fb828be76532bfb08848658aab744bc76 Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Tue, 23 Jan 2024 16:40:10 +0300 Subject: [PATCH] Compilation adjustments for GCC/Clang These compilers are more strict than MSVC, so fix the compilation errors coming from the linux build. Signed-off-by: Pavel Solodovnikov --- lib/framework/frameresource.cpp | 1 + lib/framework/object_list_iteration.h | 9 +++++---- src/objmem.h | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/framework/frameresource.cpp b/lib/framework/frameresource.cpp index 52e04525784..62183602881 100644 --- a/lib/framework/frameresource.cpp +++ b/lib/framework/frameresource.cpp @@ -33,6 +33,7 @@ #include "resly.h" #include +#include // Local prototypes static std::list psResTypes; diff --git a/lib/framework/object_list_iteration.h b/lib/framework/object_list_iteration.h index f4dd377b851..804f5a345be 100644 --- a/lib/framework/object_list_iteration.h +++ b/lib/framework/object_list_iteration.h @@ -24,6 +24,7 @@ #include #include #include +#include enum class IterationResult { @@ -67,7 +68,7 @@ struct LoopBodyHandlerCallStrategy template static constexpr bool handler_accepts_iter = std::is_convertible< Callable, - std::function::iterator)>>::value; + std::function::iterator)>>::value; // `Invoke` overload for Callable taking a list iterator as the argument template @@ -95,8 +96,8 @@ void mutating_list_iterate(std::list& list, MaybeErasingLoopBodyHan using HandlerCallStrategy = LoopBodyHandlerCallStrategy; static_assert( - HandlerCallStrategy::handler_accepts_ptr - || HandlerCallStrategy::handler_accepts_iter, + HandlerCallStrategy::template handler_accepts_ptr + || HandlerCallStrategy::template handler_accepts_iter, "Unsupported loop body handler signature: " "should return IterationResult and take either an ObjectType* or an iterator"); @@ -110,7 +111,7 @@ void mutating_list_iterate(std::list& list, MaybeErasingLoopBodyHan { itNext = std::next(it); // Can possibly invalidate `it` and anything before it. - const auto res = HandlerCallStrategy::Invoke(handler, it); + const auto res = HandlerCallStrategy::template Invoke(handler, it); if (res == IterationResult::BREAK_ITERATION) { break; diff --git a/src/objmem.h b/src/objmem.h index c17033d8034..3d3c4122d04 100644 --- a/src/objmem.h +++ b/src/objmem.h @@ -28,7 +28,6 @@ #include #include -#include /* The lists of objects allocated */ template