Automated merge with ssh://bitbucket.org/lindenlab/viewer-vs2017

meow-7.2.2
Nat Goodspeed 2019-12-12 09:06:15 -05:00
commit c627c69020
1 changed files with 22 additions and 15 deletions

View File

@ -305,28 +305,35 @@ namespace LLError
{
#ifdef __GNUC__
// GCC: type_info::name() returns a mangled class name,st demangle
// passing nullptr, 0 forces allocation of a unique buffer we can free
// fixing MAINT-8724 on OSX 10.14
// passing nullptr, 0 forces allocation of a unique buffer we can free
// fixing MAINT-8724 on OSX 10.14
int status = -1;
char* name = abi::__cxa_demangle(mangled, nullptr, 0, &status);
std::string result(name ? name : mangled);
free(name);
return result;
std::string result(name ? name : mangled);
free(name);
return result;
#elif LL_WINDOWS
// DevStudio: type_info::name() includes the text "class " at the start
static const std::string class_prefix = "class ";
// Visual Studio: type_info::name() includes the text "class " at the start
std::string name = mangled;
if (0 != name.compare(0, class_prefix.length(), class_prefix))
for (const auto& prefix : std::vector<std::string>{ "class ", "struct " })
{
LL_DEBUGS() << "Did not see '" << class_prefix << "' prefix on '"
<< name << "'" << LL_ENDL;
return name;
if (0 == name.compare(0, prefix.length(), prefix))
{
return name.substr(prefix.length());
}
}
// huh, that's odd, we should see one or the other prefix -- but don't
// try to log unless logging is already initialized
if (is_available())
{
// in Python, " or ".join(vector) -- but in C++, a PITB
LL_DEBUGS() << "Did not see 'class' or 'struct' prefix on '"
<< name << "'" << LL_ENDL;
}
return name;
return name.substr(class_prefix.length());
#else
#else // neither GCC nor Visual Studio
return mangled;
#endif
}