Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Neargye committed Oct 4, 2023
1 parent ed8bb5d commit dfcd851
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/magic_enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ constexpr auto n() noexcept {
constexpr auto name = name_ptr ? str_view{name_ptr, std::char_traits<char>::length(name_ptr)} : str_view{};
#elif defined(__clang__)
str_view name;
if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
static_assert(always_false_v<E>, "magic_enum::detail::n requires __PRETTY_FUNCTION__.");
return str_view{};
} else {
Expand All @@ -433,7 +433,7 @@ constexpr auto n() noexcept {
}
#elif defined(__GNUC__)
auto name = str_view{__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 1};
if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
static_assert(always_false_v<E>, "magic_enum::detail::n requires __PRETTY_FUNCTION__.");
return str_view{};
} else if (name.str_[name.size_ - 1] == ']') {
Expand Down Expand Up @@ -500,7 +500,7 @@ constexpr auto n() noexcept {
auto name = name_ptr ? str_view{name_ptr, std::char_traits<char>::length(name_ptr)} : str_view{};
#elif defined(__clang__)
str_view name;
if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
static_assert(always_false_v<decltype(V)>, "magic_enum::detail::n requires __PRETTY_FUNCTION__.");
return str_view{};
} else {
Expand All @@ -516,7 +516,7 @@ constexpr auto n() noexcept {
}
#elif defined(__GNUC__)
auto name = str_view{__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 1};
if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) {
static_assert(always_false_v<decltype(V)>, "magic_enum::detail::n requires __PRETTY_FUNCTION__.");
return str_view{};
} else if (name.str_[name.size_ - 1] == ']') {
Expand Down

0 comments on commit dfcd851

Please sign in to comment.