mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
fix build on gcc<9
This commit is contained in:
parent
2f9400bcf3
commit
77918a74c5
1 changed files with 2 additions and 2 deletions
|
|
@ -140,7 +140,7 @@ constexpr auto n() noexcept {
|
|||
static_assert(is_enum_v<E>, "magic_enum::detail::n requires enum type.");
|
||||
#if defined(__clang__)
|
||||
constexpr std::string_view name{__PRETTY_FUNCTION__ + 34, sizeof(__PRETTY_FUNCTION__) - 36};
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 9
|
||||
#elif defined(__GNUC__)
|
||||
constexpr std::string_view name{__PRETTY_FUNCTION__ + 49, sizeof(__PRETTY_FUNCTION__) - 51};
|
||||
#elif defined(_MSC_VER)
|
||||
constexpr std::string_view name{__FUNCSIG__ + 40, sizeof(__FUNCSIG__) - 57};
|
||||
|
|
@ -160,7 +160,7 @@ inline constexpr auto type_name_v = n<E>();
|
|||
template <typename E, E V>
|
||||
constexpr auto n() noexcept {
|
||||
static_assert(is_enum_v<E>, "magic_enum::detail::n requires enum type.");
|
||||
#if defined(__clang__) || defined(__GNUC__) && __GNUC__ >= 9
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
constexpr auto name = pretty_name({__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 2});
|
||||
#elif defined(_MSC_VER)
|
||||
constexpr auto name = pretty_name({__FUNCSIG__, sizeof(__FUNCSIG__) - 17});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue