Skip to content

Commit

Permalink
Fixed: Build issues with certain preprocessor macro combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbiely committed Apr 18, 2024
1 parent 5c6e037 commit 830c3d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
11 changes: 3 additions & 8 deletions include/gaia/ecs/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,7 @@ namespace gaia {

//--------------------------------------------------------------------------------

//! Unpacks the parameter list \param types into query \param query and performs All for each of them
template <typename... T>
void unpack_args_into_query_all(QueryImpl& query, [[maybe_unused]] core::func_type_list<T...> types) const {
static_assert(sizeof...(T) > 0, "Inputs-less functors can not be unpacked to query");
query.template all<T...>();
}

#if GAIA_ASSERT_ENABLED
//! Unpacks the parameter list \param types into query \param query and performs has_all for each of them
template <typename... T>
GAIA_NODISCARD bool unpack_args_into_query_has_all(
Expand All @@ -391,6 +385,7 @@ namespace gaia {
else
return true;
}
#endif

//--------------------------------------------------------------------------------

Expand Down Expand Up @@ -935,7 +930,7 @@ namespace gaia {
void each(QueryInfo& queryInfo, Func func) {
using InputArgs = decltype(core::func_args(&Func::operator()));

#if GAIA_DEBUG
#if GAIA_ASSERT_ENABLED
// Make sure we only use components specified in the query.
// Constness is respected. Therefore, if a type is const when registered to query,
// it has to be const (or immutable) also in each().
Expand Down
4 changes: 2 additions & 2 deletions include/gaia/ecs/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ namespace gaia {
}

void handle_add(Entity entity) {
#if GAIA_DEBUG
#if GAIA_ASSERT_ENABLED
World::verify_add(m_world, *m_pArchetype, m_entity, entity);
#endif

Expand Down Expand Up @@ -424,7 +424,7 @@ namespace gaia {
}

void handle_del(Entity entity) {
#if GAIA_DEBUG
#if GAIA_ASSERT_ENABLED
World::verify_del(m_world, *m_pArchetype, m_entity, entity);
#endif

Expand Down
15 changes: 5 additions & 10 deletions single_include/gaia.h
Original file line number Diff line number Diff line change
Expand Up @@ -21425,13 +21425,7 @@ namespace gaia {

//--------------------------------------------------------------------------------

//! Unpacks the parameter list \param types into query \param query and performs All for each of them
template <typename... T>
void unpack_args_into_query_all(QueryImpl& query, [[maybe_unused]] core::func_type_list<T...> types) const {
static_assert(sizeof...(T) > 0, "Inputs-less functors can not be unpacked to query");
query.template all<T...>();
}

#if GAIA_ASSERT_ENABLED
//! Unpacks the parameter list \param types into query \param query and performs has_all for each of them
template <typename... T>
GAIA_NODISCARD bool unpack_args_into_query_has_all(
Expand All @@ -21441,6 +21435,7 @@ namespace gaia {
else
return true;
}
#endif

//--------------------------------------------------------------------------------

Expand Down Expand Up @@ -21985,7 +21980,7 @@ namespace gaia {
void each(QueryInfo& queryInfo, Func func) {
using InputArgs = decltype(core::func_args(&Func::operator()));

#if GAIA_DEBUG
#if GAIA_ASSERT_ENABLED
// Make sure we only use components specified in the query.
// Constness is respected. Therefore, if a type is const when registered to query,
// it has to be const (or immutable) also in each().
Expand Down Expand Up @@ -22529,7 +22524,7 @@ namespace gaia {
}

void handle_add(Entity entity) {
#if GAIA_DEBUG
#if GAIA_ASSERT_ENABLED
World::verify_add(m_world, *m_pArchetype, m_entity, entity);
#endif

Expand Down Expand Up @@ -22559,7 +22554,7 @@ namespace gaia {
}

void handle_del(Entity entity) {
#if GAIA_DEBUG
#if GAIA_ASSERT_ENABLED
World::verify_del(m_world, *m_pArchetype, m_entity, entity);
#endif

Expand Down

0 comments on commit 830c3d6

Please sign in to comment.