Skip to content
Snippets Groups Projects
Commit cd21556a authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

SL-821: Convert wstrings to strings of __wchar_t for BugSplat API.

parent c5f618d0
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,14 @@ ...@@ -76,7 +76,14 @@
// FIXME: need a production BugSplat database name // FIXME: need a production BugSplat database name
static const wchar_t *bugdb_name = L"second_life_callum_test"; static const wchar_t *bugdb_name = L"second_life_callum_test";
#endif
// MiniDmpSender's constructor is defined to accept __wchar_t* instead of
// plain wchar_t*.
inline std::basic_string<__wchar_t> wunder(const std::wstring& str)
{
return { str.begin(), str.end() };
}
#endif // LL_BUGSPLAT
namespace namespace
{ {
...@@ -518,8 +525,12 @@ bool LLAppViewerWin32::init() ...@@ -518,8 +525,12 @@ bool LLAppViewerWin32::init()
LL_VIEWER_VERSION_PATCH << '.' << LL_VIEWER_VERSION_PATCH << '.' <<
LL_VIEWER_VERSION_BUILD)); LL_VIEWER_VERSION_BUILD));
// have to convert normal wide strings to strings of __wchar_t
auto sender = new MiniDmpSender( auto sender = new MiniDmpSender(
bugdb_name, LL_TO_WSTRING(LL_VIEWER_CHANNEL), version_string.c_str(), nullptr); wunder(bugdb_name).c_str(),
wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(),
wunder(version_string).c_str(),
nullptr);
sender->setCallback( sender->setCallback(
[sender](unsigned int nCode, void* lpVal1, void* lpVal2) [sender](unsigned int nCode, void* lpVal1, void* lpVal2)
{ {
...@@ -532,16 +543,17 @@ bool LLAppViewerWin32::init() ...@@ -532,16 +543,17 @@ bool LLAppViewerWin32::init()
if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp) if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp)
{ {
// send the main viewer log file // send the main viewer log file
// widen to wstring, then pass c_str() // widen to wstring, convert to __wchar_t, then pass c_str()
sender->sendAdditionalFile( sender->sendAdditionalFile(
wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log")).c_str()); wunder(wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))).c_str());
} }
return false; return false;
}); });
// engage stringize() overload that converts from wstring
LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL)
<< version_string << ')' << LL_ENDL; << stringize(version_string) << ')' << LL_ENDL;
#endif // LL_BUGSPLAT #endif // LL_BUGSPLAT
#endif // LL_SEND_CRASH_REPORTS #endif // LL_SEND_CRASH_REPORTS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment