diff options
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/fsyspath.h | 7 | ||||
| -rw-r--r-- | indra/llcommon/llapp.h | 2 | ||||
| -rw-r--r-- | indra/llcommon/llcoros.cpp | 15 | ||||
| -rw-r--r-- | indra/llcommon/lldate.cpp | 9 | ||||
| -rw-r--r-- | indra/llcommon/lldate.h | 1 |
5 files changed, 25 insertions, 9 deletions
diff --git a/indra/llcommon/fsyspath.h b/indra/llcommon/fsyspath.h index f66970ed8f..2c900c02a7 100644 --- a/indra/llcommon/fsyspath.h +++ b/indra/llcommon/fsyspath.h @@ -79,11 +79,8 @@ public: // shadow base-class string() method with UTF-8 aware method std::string string() const { - // Short of forbidden type punning, I see no way to avoid copying this - // std::u8string to a std::string. - auto u8str{ super::u8string() }; - // from https://github.com/tahonermann/char8_t-remediation/blob/master/char8_t-remediation.h#L180-L182 - return { u8str.begin(), u8str.end() }; + auto u8 = super::u8string(); + return std::string(u8.begin(), u8.end()); } // On Posix systems, where value_type is already char, this operator // std::string() method shadows the base class operator string_type() diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 3d18864b80..57f5a112d9 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -282,7 +282,7 @@ public: LLRunner& getRunner() { return mRunner; } #ifdef LL_WINDOWS - virtual void reportCrashToBugsplat(void* pExcepInfo /*EXCEPTION_POINTERS*/) { } + virtual bool reportCrashToBugsplat(void* pExcepInfo /*EXCEPTION_POINTERS*/) { return false; } #endif public: diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 1539b48bd3..ea2d102de9 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -310,18 +310,25 @@ namespace static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific -U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop) +U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS* exception_infop) { - if (code == STATUS_MSC_EXCEPTION) + if (LLApp::instance()->reportCrashToBugsplat((void*)exception_infop)) + { + // Handled + return EXCEPTION_CONTINUE_SEARCH; + } + else if (code == STATUS_MSC_EXCEPTION) { // C++ exception, go on return EXCEPTION_CONTINUE_SEARCH; } else { - // handle it + // handle it, convert to std::exception return EXCEPTION_EXECUTE_HANDLER; } + + return EXCEPTION_CONTINUE_SEARCH; } void sehandle(const LLCoros::callable_t& callable) @@ -379,6 +386,7 @@ void LLCoros::toplevel(std::string name, callable_t callable) // viewer will carry on. LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << name)); } +#ifndef LL_WINDOWS catch (...) { // Stash any OTHER kind of uncaught exception in the rethrow() queue @@ -387,6 +395,7 @@ void LLCoros::toplevel(std::string name, callable_t callable) << name << LL_ENDL; LLCoros::instance().saveException(name, std::current_exception()); } +#endif // ! LL_WINDOWS } //static diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index b38864688d..5205699b92 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -77,6 +77,15 @@ std::string LLDate::asRFC1123() const return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT")); } +std::string LLDate::toLocalDateString (std::string fmt) const +{ + LL_PROFILE_ZONE_SCOPED; + + time_t locSeconds = (time_t) mSecondsSinceEpoch; + struct tm * lt = localtime (&locSeconds); + return toHTTPDateString(lt, fmt); +} + std::string LLDate::toHTTPDateString (std::string fmt) const { LL_PROFILE_ZONE_SCOPED; diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index 1a69a04232..34c8692f20 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -77,6 +77,7 @@ public: std::string asRFC1123() const; void toStream(std::ostream&) const; bool split(S32 *year, S32 *month = NULL, S32 *day = NULL, S32 *hour = NULL, S32 *min = NULL, S32 *sec = NULL) const; + std::string toLocalDateString(std::string fmt) const; std::string toHTTPDateString (std::string fmt) const; static std::string toHTTPDateString (tm * gmt, std::string fmt); /** |
