mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
fix CLI/C++
This commit is contained in:
parent
e1ea11a93d
commit
4904822db8
1 changed files with 10 additions and 3 deletions
|
|
@ -434,7 +434,10 @@ constexpr auto n() noexcept {
|
||||||
name.str_ += 37;
|
name.str_ += 37;
|
||||||
}
|
}
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
auto name = str_view{__FUNCSIG__ + 40, sizeof(__FUNCSIG__) - 57};
|
str_view name;
|
||||||
|
name.str_ = __FUNCSIG__;
|
||||||
|
name.str_ += 40;
|
||||||
|
name.size_ += sizeof(__FUNCSIG__) - 57;
|
||||||
#else
|
#else
|
||||||
auto name = str_view{};
|
auto name = str_view{};
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -508,7 +511,9 @@ constexpr auto n() noexcept {
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
str_view name;
|
str_view name;
|
||||||
if ((__FUNCSIG__[5] == '_' && __FUNCSIG__[35] != '(') || (__FUNCSIG__[5] == 'c' && __FUNCSIG__[41] != '(')) {
|
if ((__FUNCSIG__[5] == '_' && __FUNCSIG__[35] != '(') || (__FUNCSIG__[5] == 'c' && __FUNCSIG__[41] != '(')) {
|
||||||
name = str_view{__FUNCSIG__ + 35, sizeof(__FUNCSIG__) - 52};
|
name.str_ = __FUNCSIG__;
|
||||||
|
name.str_ += 35;
|
||||||
|
name.size_ = sizeof(__FUNCSIG__) - 52;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
auto name = str_view{};
|
auto name = str_view{};
|
||||||
|
|
@ -543,7 +548,9 @@ constexpr auto n() noexcept {
|
||||||
constexpr auto name_ptr = MAGIC_ENUM_GET_ENUM_NAME_BUILTIN(V);
|
constexpr auto name_ptr = MAGIC_ENUM_GET_ENUM_NAME_BUILTIN(V);
|
||||||
auto name = name_ptr ? str_view{name_ptr, std::char_traits<char>::length(name_ptr)} : str_view{};
|
auto name = name_ptr ? str_view{name_ptr, std::char_traits<char>::length(name_ptr)} : str_view{};
|
||||||
# else
|
# else
|
||||||
str_view name = str_view{__FUNCSIG__, sizeof(__FUNCSIG__) - 17};
|
str_view name;
|
||||||
|
name.str_ = __FUNCSIG__;
|
||||||
|
name.size_ = sizeof(__FUNCSIG__) - 17;
|
||||||
std::size_t p = 0;
|
std::size_t p = 0;
|
||||||
for (std::size_t i = name.size_; i > 0; --i) {
|
for (std::size_t i = name.size_; i > 0; --i) {
|
||||||
if (name.str_[i] == ',' || name.str_[i] == ':') {
|
if (name.str_[i] == ',' || name.str_[i] == ':') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue