Skip to content

Commit

Permalink
Compilation adjustments for GCC/Clang
Browse files Browse the repository at this point in the history
These compilers are more strict than MSVC,
so fix the compilation errors coming from
the linux build.

Signed-off-by: Pavel Solodovnikov <[email protected]>
  • Loading branch information
ManManson committed Jan 23, 2024
1 parent 2cd2eb2 commit 12585b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/framework/frameresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "resly.h"

#include <list>
#include <algorithm>

// Local prototypes
static std::list<RES_TYPE *> psResTypes;
Expand Down
9 changes: 5 additions & 4 deletions lib/framework/object_list_iteration.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <list>
#include <type_traits>
#include <iterator>
#include <functional>

enum class IterationResult
{
Expand Down Expand Up @@ -67,7 +68,7 @@ struct LoopBodyHandlerCallStrategy
template <typename ObjectType>
static constexpr bool handler_accepts_iter = std::is_convertible<
Callable,
std::function<IterationResult(std::list<ObjectType*>::iterator)>>::value;
std::function<IterationResult(typename std::list<ObjectType*>::iterator)>>::value;

// `Invoke` overload for Callable taking a list iterator as the argument
template <typename ObjectType>
Expand Down Expand Up @@ -95,8 +96,8 @@ void mutating_list_iterate(std::list<ObjectType*>& list, MaybeErasingLoopBodyHan
using HandlerCallStrategy = LoopBodyHandlerCallStrategy<MaybeErasingLoopBodyHandler>;

static_assert(
HandlerCallStrategy::handler_accepts_ptr<ObjectType>
|| HandlerCallStrategy::handler_accepts_iter<ObjectType>,
HandlerCallStrategy::template handler_accepts_ptr<ObjectType>
|| HandlerCallStrategy::template handler_accepts_iter<ObjectType>,
"Unsupported loop body handler signature: "
"should return IterationResult and take either an ObjectType* or an iterator");

Expand All @@ -110,7 +111,7 @@ void mutating_list_iterate(std::list<ObjectType*>& list, MaybeErasingLoopBodyHan
{
itNext = std::next(it);
// Can possibly invalidate `it` and anything before it.
const auto res = HandlerCallStrategy::Invoke<ObjectType>(handler, it);
const auto res = HandlerCallStrategy::template Invoke<ObjectType>(handler, it);
if (res == IterationResult::BREAK_ITERATION)
{
break;
Expand Down
1 change: 0 additions & 1 deletion src/objmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <array>
#include <list>
#include <functional>

/* The lists of objects allocated */
template <typename ObjectType, unsigned PlayerCount>
Expand Down

0 comments on commit 12585b9

Please sign in to comment.