Skip to content

Commit 831c712

Browse files
committed
#2024 Fix unreachable code warning for MSVC
1 parent ae6c1b4 commit 831c712

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

distr/flecs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30161,9 +30161,12 @@ inline ecs_cpp_type_action_t enum_action() {
3016130161
#if FLECS_CPP_ENUM_REFLECTION_SUPPORT
3016230162
if constexpr (is_enum_v<T>) {
3016330163
return &_::init_enum<T>;
30164+
} else {
30165+
return nullptr;
3016430166
}
30165-
#endif
30167+
#else
3016630168
return nullptr;
30169+
#endif
3016730170
}
3016830171

3016930172
template <typename T>

include/flecs/addons/cpp/component.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ inline ecs_cpp_type_action_t enum_action() {
102102
#if FLECS_CPP_ENUM_REFLECTION_SUPPORT
103103
if constexpr (is_enum_v<T>) {
104104
return &_::init_enum<T>;
105+
} else {
106+
return nullptr;
105107
}
106-
#endif
108+
#else
107109
return nullptr;
110+
#endif
108111
}
109112

110113
template <typename T>

0 commit comments

Comments
 (0)