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