diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llcoros.cpp | 37 | ||||
-rw-r--r-- | indra/viewer_components/login/tests/lllogin_test.cpp | 2 |
2 files changed, 29 insertions, 10 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 5d23e1d284..377bfaa247 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -54,15 +54,6 @@ bool LLCoros::cleanup(const LLSD&) return false; } -std::string LLCoros::launchImpl(const std::string& prefix, coro* newCoro) -{ - std::string name(generateDistinctName(prefix)); - mCoros.insert(name, newCoro); - /* Run the coroutine until its first wait, then return here */ - (*newCoro)(std::nothrow); - return name; -} - std::string LLCoros::generateDistinctName(const std::string& prefix) const { // Allowing empty name would make getName()'s not-found return ambiguous. @@ -116,3 +107,31 @@ std::string LLCoros::getNameByID(const void* self_id) const } return ""; } + +/***************************************************************************** +* MUST BE LAST +*****************************************************************************/ +// Turn off MSVC optimizations for just LLCoros::launchImpl() -- see +// DEV-32777. But MSVC doesn't support push/pop for optimization flags as it +// does for warning suppression, and we really don't want to force +// optimization ON for other code even in Debug or RelWithDebInfo builds. + +#if LL_MSVC +// work around broken optimizations +#pragma warning(disable: 4748) +#pragma optimize("", off) +#endif // LL_MSVC + +std::string LLCoros::launchImpl(const std::string& prefix, coro* newCoro) +{ + std::string name(generateDistinctName(prefix)); + mCoros.insert(name, newCoro); + /* Run the coroutine until its first wait, then return here */ + (*newCoro)(std::nothrow); + return name; +} + +#if LL_MSVC +// reenable optimizations +#pragma optimize("", on) +#endif // LL_MSVC diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp index e43065d49f..51f00c8344 100644 --- a/indra/viewer_components/login/tests/lllogin_test.cpp +++ b/indra/viewer_components/login/tests/lllogin_test.cpp @@ -56,7 +56,7 @@ public: return pump.listen(mName, boost::bind(&LoginListener::call, this, _1)); } - LLSD lastEvent() { return mLastEvent; } + LLSD lastEvent() const { return mLastEvent; } friend std::ostream& operator<<(std::ostream& out, const LoginListener& listener) { |