From 9deae34b204677b8ce54f545be7c2132b74f8006 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 14 Oct 2014 19:13:02 -0700 Subject: [PATCH] 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 --- src/ripple/unity/app.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ripple/unity/app.cpp b/src/ripple/unity/app.cpp index 0b4a3f9b4e..17304478a5 100644 --- a/src/ripple/unity/app.cpp +++ b/src/ripple/unity/app.cpp @@ -43,6 +43,8 @@ #include #include +#include + //------------------------------------------------------------------------------ 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) +