Commit c23bf75c authored by Edward Capriolo's avatar Edward Capriolo Committed by Dominik Charousset

Fix build on GCC 4.7

parent 15bde3b2
......@@ -33,7 +33,7 @@ namespace fd_util {
std::string last_socket_error_as_string();
// throws network_error and adds errno failure if @p add_errno_failure
void throw_io_failure [[noreturn]] (const char* what, bool add_errno = true);
void throw_io_failure (const char* what, bool add_errno = true);
// sets fd to nonblocking if <tt>set_nonblocking == true</tt>
// or to blocking if <tt>set_nonblocking == false</tt>
......
......@@ -34,7 +34,7 @@ class cppa_exception : public std::exception {
public:
~cppa_exception();
~cppa_exception() noexcept;
cppa_exception() = delete;
cppa_exception(const cppa_exception&) = default;
......@@ -73,7 +73,7 @@ class actor_exited : public cppa_exception {
public:
~actor_exited();
~actor_exited() noexcept;
actor_exited(std::uint32_t exit_reason);
......@@ -101,7 +101,7 @@ class network_error : public cppa_exception {
public:
~network_error();
~network_error() noexcept;
network_error(std::string&& what_str);
network_error(const std::string& what_str);
......@@ -115,7 +115,7 @@ class bind_failure : public network_error {
public:
~bind_failure();
~bind_failure() noexcept;
bind_failure(int bind_errno);
bind_failure(const bind_failure&) = default;
......@@ -143,7 +143,7 @@ class stream_at_eof : public network_error {
public:
~stream_at_eof();
~stream_at_eof() noexcept;
template<typename... Ts>
stream_at_eof(Ts&&... args) : super(std::forward<Ts>(args)...) { }
......
......@@ -67,7 +67,7 @@ std::string be_what(int err_code) {
namespace cppa {
cppa_exception::~cppa_exception() { }
cppa_exception::~cppa_exception() noexcept { }
cppa_exception::cppa_exception(const std::string& what_str)
: m_what(what_str) { }
......@@ -79,14 +79,14 @@ const char* cppa_exception::what() const noexcept {
return m_what.c_str();
}
actor_exited::~actor_exited() { }
actor_exited::~actor_exited() noexcept { }
actor_exited::actor_exited(std::uint32_t reason)
: cppa_exception(ae_what(reason)) {
m_reason = reason;
}
network_error::~network_error() { }
network_error::~network_error() noexcept { }
network_error::network_error(const std::string& str) : cppa_exception(str) { }
......@@ -97,8 +97,8 @@ bind_failure::bind_failure(int err_code) : network_error(be_what(err_code)) {
m_errno = err_code;
}
bind_failure::~bind_failure() { }
bind_failure::~bind_failure() noexcept { }
stream_at_eof::~stream_at_eof() { }
stream_at_eof::~stream_at_eof() noexcept { }
} // namespace cppa
......@@ -48,7 +48,7 @@ namespace cppa {
namespace detail {
namespace fd_util {
void throw_io_failure [[noreturn]] (const char* what, bool add_errno) {
void throw_io_failure (const char* what, bool add_errno) {
if (add_errno) {
std::ostringstream oss;
oss << what << ": " << last_socket_error_as_string()
......
......@@ -250,9 +250,9 @@ coordinator::shutdown_helper::~shutdown_helper() { }
void coordinator::initialize() {
// launch threads of utility actors
auto ptr = m_timer.get();
m_timer_thread = std::thread{[ptr] {
m_timer_thread = std::thread([ptr](){
ptr->act();
}};
});
m_printer_thread = std::thread{printer_loop, m_printer.get()};
// create & start workers
auto hwc = static_cast<size_t>(std::thread::hardware_concurrency());
......@@ -353,9 +353,9 @@ void worker::start(size_t id, coordinator* parent) {
m_last_victim = id;
m_parent = parent;
auto this_worker = this;
m_this_thread = std::thread{[this_worker] {
m_this_thread = std::thread([this_worker](){
this_worker->run();
}};
});
}
void worker::run() {
......
......@@ -213,7 +213,7 @@ class string_deserializer : public deserializer {
while (*m_pos == ' ' || *m_pos == ',') ++m_pos;
}
void throw_malformed [[noreturn]] (const string& error_msg) {
void throw_malformed (const string& error_msg) {
throw logic_error("malformed string: " + error_msg);
}
......
......@@ -52,7 +52,7 @@ vector<string> split(const string& str, char delim, bool keep_empties) {
return result;
}
void verbose_terminate [[noreturn]] () {
void verbose_terminate () {
try { throw; }
catch (exception& e) {
CPPA_PRINTERR("terminate called after throwing "
......
......@@ -19,7 +19,7 @@ struct pseudo_worker {
pseudo_worker() : m_count(0), m_blocked(true) { }
void run [[noreturn]] () {
void run () {
for (;;) {
if (m_blocked) {
yield(yield_state::blocked);
......@@ -33,7 +33,7 @@ struct pseudo_worker {
};
void coroutine [[noreturn]] (void* worker) {
void coroutine (void* worker) {
reinterpret_cast<pseudo_worker*>(worker)->run();
}
......
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