Workaround for MSVC stdlib and coroutine interaction:

If beast::Time::currentTimeMillis is first called from a coroutine launched
using boost::asio::spawn, Win32 throws an exception. This workaround calls
getCurrentTime once in main to prevent the exception.
Reference:
    https://svn.boost.org/trac/boost/ticket/10657
This commit is contained in:
Vinnie Falco
2014-10-14 19:13:02 -07:00
parent ec92344fb4
commit 9deae34b20

View File

@@ -43,6 +43,8 @@
#include <ripple/app/main/Application.cpp>
#include <ripple/app/main/Main.cpp>
#include <beast/module/core/time/Time.h>
//------------------------------------------------------------------------------
namespace ripple {
@@ -61,6 +63,10 @@ struct ProtobufLibrary
//
int main (int argc, char** argv)
{
// Workaround for Boost.Context / Boost.Coroutine
// https://svn.boost.org/trac/boost/ticket/10657
(void)beast::Time::currentTimeMillis();
#if defined(__GNUC__) && !defined(__clang__)
auto constexpr gccver = (__GNUC__ * 100 * 100) +
(__GNUC_MINOR__ * 100) +