summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r--indra/newview/llappviewerwin32.cpp54
1 files changed, 22 insertions, 32 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index a13e4de308..ad817d5747 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -75,8 +75,9 @@
// Bugsplat (http://bugsplat.com) crash reporting tool
#ifdef LL_BUGSPLAT
#include "BugSplat.h"
-#include "json/reader.h" // JsonCpp
+#include "boost/json.hpp" // Boost.Json
#include "llagent.h" // for agent location
+#include "llstartup.h"
#include "llviewerregion.h"
#include "llvoavatarself.h" // for agent name
@@ -138,8 +139,7 @@ namespace
// We don't have an email address for any user. Hijack this
// metadata field for the platform identifier.
sBugSplatSender->setDefaultUserEmail(
- WCSTR(STRINGIZE(LLOSInfo::instance().getOSStringSimple() << " ("
- << ADDRESS_SIZE << "-bit)")));
+ WCSTR(LLOSInfo::instance().getOSStringSimple()));
if (gAgentAvatarp)
{
@@ -152,6 +152,8 @@ namespace
// LL_ERRS message, when there is one
sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage()));
+ // App state
+ sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString()));
if (gAgent.getRegion())
{
@@ -195,19 +197,6 @@ LONG WINAPI catchallCrashHandler(EXCEPTION_POINTERS * /*ExceptionInfo*/)
return 0;
}
-// *FIX:Mani - This hack is to fix a linker issue with libndofdev.lib
-// The lib was compiled under VS2005 - in VS2003 we need to remap assert
-#ifdef LL_DEBUG
-#ifdef LL_MSVC7
-extern "C" {
- void _wassert(const wchar_t * _Message, const wchar_t *_File, unsigned _Line)
- {
- LL_ERRS() << _Message << LL_ENDL;
- }
-}
-#endif
-#endif
-
const std::string LLAppViewerWin32::sWindowClass = "Second Life";
/*
@@ -238,7 +227,7 @@ bool create_app_mutex()
LPCWSTR unique_mutex_name = L"SecondLifeAppMutex";
HANDLE hMutex;
hMutex = CreateMutex(NULL, TRUE, unique_mutex_name);
- if(GetLastError() == ERROR_ALREADY_EXISTS)
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
{
result = false;
}
@@ -455,7 +444,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
gDebugInfo["FoundOtherInstanceAtStartup"] = LLSD::Boolean(found_other_instance);
bool ok = viewer_app_ptr->init();
- if(!ok)
+ if (!ok)
{
LL_WARNS() << "Application init failed." << LL_ENDL;
return -1;
@@ -522,7 +511,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
}
#endif
- gGLActive = TRUE;
+ gGLActive = true;
viewer_app_ptr->cleanup();
@@ -694,24 +683,25 @@ bool LLAppViewerWin32::init()
}
else
{
- Json::Reader reader;
- Json::Value build_data;
- if (!reader.parse(inf, build_data, false)) // don't collect comments
+ boost::system::error_code ec;
+ boost::json::value build_data = boost::json::parse(inf, ec);
+ if(ec.failed())
{
// gah, the typo is baked into Json::Reader API
LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't parse '" << build_data_fname
- << "': " << reader.getFormatedErrorMessages() << LL_ENDL;
+ << "': " << ec.what() << LL_ENDL;
}
else
{
- Json::Value BugSplat_DB = build_data["BugSplat DB"];
- if (!BugSplat_DB)
+ if (!build_data.is_object() || !build_data.as_object().contains("BugSplat DB"))
{
LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, no 'BugSplat DB' entry in '"
<< build_data_fname << "'" << LL_ENDL;
}
else
{
+ boost::json::value BugSplat_DB = build_data.at("BugSplat DB");
+
// Got BugSplat_DB, onward!
std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' <<
LL_VIEWER_VERSION_MINOR << '.' <<
@@ -733,7 +723,7 @@ bool LLAppViewerWin32::init()
// have to convert normal wide strings to strings of __wchar_t
sBugSplatSender = new MiniDmpSender(
- WCSTR(BugSplat_DB.asString()),
+ WCSTR(boost::json::value_to<std::string>(BugSplat_DB)),
WCSTR(LL_TO_WSTRING(LL_VIEWER_CHANNEL)),
WCSTR(version_string),
nullptr, // szAppIdentifier -- set later
@@ -819,17 +809,17 @@ bool LLAppViewerWin32::initHardwareTest()
// Do driver verification and initialization based on DirectX
// hardware polling and driver versions
//
- if (TRUE == gSavedSettings.getBOOL("ProbeHardwareOnStartup") && FALSE == gSavedSettings.getBOOL("NoHardwareProbe"))
+ if (true == gSavedSettings.getBOOL("ProbeHardwareOnStartup") && false == gSavedSettings.getBOOL("NoHardwareProbe"))
{
// per DEV-11631 - disable hardware probing for everything
// but vram.
- BOOL vram_only = TRUE;
+ bool vram_only = true;
LLSplashScreen::update(LLTrans::getString("StartupDetectingHardware"));
LL_DEBUGS("AppInit") << "Attempting to poll DirectX for hardware info" << LL_ENDL;
gDXHardware.setWriteDebugFunc(write_debug_dx);
- BOOL probe_ok = gDXHardware.getInfo(vram_only);
+ bool probe_ok = gDXHardware.getInfo(vram_only);
if (!probe_ok
&& gWarningSettings.getBOOL("AboutDirectX9"))
@@ -850,12 +840,12 @@ bool LLAppViewerWin32::initHardwareTest()
LLWeb::loadURLExternal("http://secondlife.com/support/", false);
return false;
}
- gWarningSettings.setBOOL("AboutDirectX9", FALSE);
+ gWarningSettings.setBOOL("AboutDirectX9", false);
}
LL_DEBUGS("AppInit") << "Done polling DirectX for hardware info" << LL_ENDL;
// Only probe once after installation
- gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE);
+ gSavedSettings.setBOOL("ProbeHardwareOnStartup", false);
// Disable so debugger can work
std::string splash_msg;
@@ -935,7 +925,7 @@ bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url)
COPYDATASTRUCT cds;
const S32 SLURL_MESSAGE_TYPE = 0;
cds.dwData = SLURL_MESSAGE_TYPE;
- cds.cbData = url.length() + 1;
+ cds.cbData = static_cast<DWORD>(url.length()) + 1;
cds.lpData = (void*)url.c_str();
LRESULT msg_result = SendMessage(other_window, WM_COPYDATA, NULL, (LPARAM)&cds);