Commit faeb4508 authored by Dominik Charousset's avatar Dominik Charousset

Fix compile errors with GCC 4.7

parent eb1452ef
......@@ -45,13 +45,19 @@ abstract_actor_ptr remote_actor_impl(const std::set<std::string>& ifs,
std::promise<abstract_actor_ptr> res;
basp_broker::client_handshake_data hdata{invalid_node_id, &res, &ifs};
mm->run_later([&] {
std::exception_ptr eptr;
try {
auto bro = mm->get_named_broker<basp_broker>(atom("_BASP"));
auto hdl = mm->backend().add_tcp_scribe(bro.get(), host, port);
bro->init_client(hdl, &hdata);
}
catch (...) {
res.set_exception(std::current_exception());
eptr = std::current_exception();
}
// accessing `res` inside the catch block triggers
// a silly compiler error on GCC 4.7
if (eptr) {
res.set_exception(std::move(eptr));
}
});
return res.get_future().get();
......
......@@ -84,10 +84,10 @@ std::thread run_program_impl(const char* cpath, std::vector<std::string> args) {
}
oss << to_dev_null;
string cmdstr = oss.str();
return thread{[cmdstr] {
return thread([cmdstr] {
if (system(cmdstr.c_str()) != 0) {
CAF_PRINTERR("FATAL: command line failed: " << cmdstr);
abort();
}
}};
});
}
......@@ -131,11 +131,11 @@ inline void caf_check_value(V1 v1, V2 v2, const char* fname, size_t line,
CAF_PRINT(#LineOfCode << " = " << (LineOfCode));
#define CAF_TEST(testname) \
::std::thread{[] { \
::std::thread([] { \
::std::this_thread::sleep_for(std::chrono::seconds(10)); \
::std::cerr << "WATCHDOG: unit test did finish within 10s, abort\n"; \
::abort(); \
}}.detach(); \
}).detach(); \
auto caf_test_scope_guard = ::caf::detail::make_scope_guard([] { \
std::cout << caf_error_count() << " error(s) detected" << std::endl; \
}); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment