Skip to content

Commit 2001c70

Browse files
committed
#2024 Fix unreachable code warning for MSVC
1 parent 754e5ce commit 2001c70

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
@@ -32449,9 +32449,12 @@ inline ecs_cpp_type_action_t enum_action() {
3244932449
#if FLECS_CPP_ENUM_REFLECTION_SUPPORT
3245032450
if constexpr (is_enum_v<T>) {
3245132451
return &_::init_enum<T>;
32452+
} else {
32453+
return nullptr;
3245232454
}
32453-
#endif
32455+
#else
3245432456
return nullptr;
32457+
#endif
3245532458
}
3245632459

3245732460
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)