Commit 4be71478 authored by Dominik Charousset's avatar Dominik Charousset

Fix build on GCC 4.7

parent 8b2306dd
...@@ -64,7 +64,7 @@ struct ieee_754_trait<uint64_t> : ieee_754_trait<double> {}; ...@@ -64,7 +64,7 @@ struct ieee_754_trait<uint64_t> : ieee_754_trait<double> {};
template<typename T> template<typename T>
typename ieee_754_trait<T>::packed_type pack754(T f) { typename ieee_754_trait<T>::packed_type pack754(T f) {
using trait = ieee_754_trait<T>; typedef ieee_754_trait<T> trait; // using trait = ... fails on GCC 4.7
using result_type = typename trait::packed_type; using result_type = typename trait::packed_type;
// filter special type // filter special type
if (fabs(f) <= trait::zero) return 0; // only true if f equals +0 or -0 if (fabs(f) <= trait::zero) return 0; // only true if f equals +0 or -0
...@@ -103,7 +103,7 @@ typename ieee_754_trait<T>::packed_type pack754(T f) { ...@@ -103,7 +103,7 @@ typename ieee_754_trait<T>::packed_type pack754(T f) {
template<typename T> template<typename T>
typename ieee_754_trait<T>::float_type unpack754(T i) { typename ieee_754_trait<T>::float_type unpack754(T i) {
using trait = ieee_754_trait<T>; typedef ieee_754_trait<T> trait; // using trait = ... fails on GCC 4.7
using signed_type = typename trait::signed_packed_type; using signed_type = typename trait::signed_packed_type;
using result_type = typename trait::float_type; using result_type = typename trait::float_type;
if (i == 0) return trait::zero; if (i == 0) return trait::zero;
......
...@@ -33,7 +33,7 @@ class caf_exception : public std::exception { ...@@ -33,7 +33,7 @@ class caf_exception : public std::exception {
public: public:
~caf_exception(); ~caf_exception() noexcept;
caf_exception() = delete; caf_exception() = delete;
caf_exception(const caf_exception&) = default; caf_exception(const caf_exception&) = default;
...@@ -72,7 +72,7 @@ class actor_exited : public caf_exception { ...@@ -72,7 +72,7 @@ class actor_exited : public caf_exception {
public: public:
~actor_exited(); ~actor_exited() noexcept;
actor_exited(uint32_t exit_reason); actor_exited(uint32_t exit_reason);
...@@ -102,7 +102,7 @@ class network_error : public caf_exception { ...@@ -102,7 +102,7 @@ class network_error : public caf_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);
network_error(const network_error&) = default; network_error(const network_error&) = default;
...@@ -120,7 +120,7 @@ class bind_failure : public network_error { ...@@ -120,7 +120,7 @@ class bind_failure : public network_error {
public: public:
~bind_failure(); ~bind_failure() noexcept;
bind_failure(std::string&& what_str); bind_failure(std::string&& what_str);
bind_failure(const std::string& what_str); bind_failure(const std::string& what_str);
......
...@@ -236,7 +236,8 @@ class broker : public extend<local_actor>:: ...@@ -236,7 +236,8 @@ class broker : public extend<local_actor>::
return spawn_functor(nullptr, return spawn_functor(nullptr,
[sptr](broker* forked) { [sptr](broker* forked) {
sptr->set_broker(forked); sptr->set_broker(forked);
forked->m_scribes.emplace(sptr->hdl(), sptr); forked->m_scribes.insert(
std::make_pair(sptr->hdl(), sptr));
}, },
fun, hdl, std::forward<Ts>(vs)...); fun, hdl, std::forward<Ts>(vs)...);
} }
...@@ -295,7 +296,7 @@ class broker : public extend<local_actor>:: ...@@ -295,7 +296,7 @@ class broker : public extend<local_actor>::
}; };
intrusive_ptr<impl> ptr{new impl{this, std::move(sock)}}; intrusive_ptr<impl> ptr{new impl{this, std::move(sock)}};
m_scribes.emplace(ptr->hdl(), ptr); m_scribes.insert(std::make_pair(ptr->hdl(), ptr));
return ptr->hdl(); return ptr->hdl();
} }
...@@ -336,7 +337,7 @@ class broker : public extend<local_actor>:: ...@@ -336,7 +337,7 @@ class broker : public extend<local_actor>::
}; };
intrusive_ptr<impl> ptr{new impl{this, std::move(sock)}}; intrusive_ptr<impl> ptr{new impl{this, std::move(sock)}};
m_doormen.emplace(ptr->hdl(), ptr); m_doormen.insert(std::make_pair(ptr->hdl(), ptr));
if (initialized()) ptr->launch(); if (initialized()) ptr->launch();
return ptr->hdl(); return ptr->hdl();
} }
......
...@@ -110,7 +110,7 @@ intrusive_ptr<Impl> middleman::get_named_broker(atom_value name) { ...@@ -110,7 +110,7 @@ intrusive_ptr<Impl> middleman::get_named_broker(atom_value name) {
if (i != m_named_brokers.end()) return static_cast<Impl*>(i->second.get()); if (i != m_named_brokers.end()) return static_cast<Impl*>(i->second.get());
intrusive_ptr<Impl> result{new Impl}; intrusive_ptr<Impl> result{new Impl};
result->launch(true, nullptr); result->launch(true, nullptr);
m_named_brokers.emplace(name, result); m_named_brokers.insert(std::make_pair(name, result));
return result; return result;
} }
......
...@@ -67,8 +67,8 @@ class upgrade_to_unique_lock { ...@@ -67,8 +67,8 @@ class upgrade_to_unique_lock {
using lockable = UpgradeLockable; using lockable = UpgradeLockable;
template<template<typename> class LockType> template<class LockType>
upgrade_to_unique_lock(LockType<lockable>& other) { upgrade_to_unique_lock(LockType& other) {
m_lockable = other.release(); m_lockable = other.release();
if (m_lockable) m_lockable->lock_upgrade(); if (m_lockable) m_lockable->lock_upgrade();
} }
......
...@@ -475,7 +475,8 @@ Result unroll_expr(PPFPs& fs, uint64_t bitmask, long_constant<N>, ...@@ -475,7 +475,8 @@ Result unroll_expr(PPFPs& fs, uint64_t bitmask, long_constant<N>,
auto& f = get<N>(fs); auto& f = get<N>(fs);
using Fun = typename detail::rm_const_and_ref<decltype(f)>::type; using Fun = typename detail::rm_const_and_ref<decltype(f)>::type;
using pattern_type = typename Fun::pattern_type; using pattern_type = typename Fun::pattern_type;
using policy = detail::invoke_util<pattern_type>; //using policy = detail::invoke_util<pattern_type>;
typedef detail::invoke_util<pattern_type> policy; // using fails on GCC 4.7
typename policy::tuple_type targs; typename policy::tuple_type targs;
if (policy::prepare_invoke(targs, type_token, is_dynamic, ptr, tup)) { if (policy::prepare_invoke(targs, type_token, is_dynamic, ptr, tup)) {
auto is = detail::get_indices(targs); auto is = detail::get_indices(targs);
......
...@@ -304,7 +304,7 @@ basp_broker::handle_basp_header(connection_context& ctx, ...@@ -304,7 +304,7 @@ basp_broker::handle_basp_header(connection_context& ctx,
std::set<string> remote_ifs; std::set<string> remote_ifs;
for (uint32_t i = 0; i < remote_ifs_size; ++i) { for (uint32_t i = 0; i < remote_ifs_size; ++i) {
auto str = bd.read<string>(); auto str = bd.read<string>();
remote_ifs.emplace(std::move(str)); remote_ifs.insert(std::move(str));
} }
auto& ifs = *(ctx.handshake_data->expected_ifs); auto& ifs = *(ctx.handshake_data->expected_ifs);
if (!std::includes(ifs.begin(), ifs.end(), if (!std::includes(ifs.begin(), ifs.end(),
...@@ -565,7 +565,7 @@ void basp_broker::init_handshake_as_sever(connection_context& ctx, ...@@ -565,7 +565,7 @@ void basp_broker::init_handshake_as_sever(connection_context& ctx,
void basp_broker::announce_published_actor(accept_handle hdl, void basp_broker::announce_published_actor(accept_handle hdl,
const abstract_actor_ptr& ptr) { const abstract_actor_ptr& ptr) {
m_published_actors.emplace(hdl, ptr); m_published_actors.insert(std::make_pair(hdl, ptr));
singletons::get_actor_registry()->put(ptr->id(), ptr); singletons::get_actor_registry()->put(ptr->id(), ptr);
} }
......
...@@ -42,7 +42,9 @@ std::string ae_what(uint32_t reason) { ...@@ -42,7 +42,9 @@ std::string ae_what(uint32_t reason) {
namespace caf { namespace caf {
caf_exception::~caf_exception() {} caf_exception::~caf_exception() noexcept {
// nop
}
caf_exception::caf_exception(const std::string& what_str) caf_exception::caf_exception(const std::string& what_str)
: m_what(what_str) {} : m_what(what_str) {}
...@@ -52,7 +54,9 @@ caf_exception::caf_exception(std::string&& what_str) ...@@ -52,7 +54,9 @@ caf_exception::caf_exception(std::string&& what_str)
const char* caf_exception::what() const noexcept { return m_what.c_str(); } const char* caf_exception::what() const noexcept { return m_what.c_str(); }
actor_exited::~actor_exited() {} actor_exited::~actor_exited() noexcept {
// nop
}
actor_exited::actor_exited(uint32_t reason) : caf_exception(ae_what(reason)) { actor_exited::actor_exited(uint32_t reason) : caf_exception(ae_what(reason)) {
m_reason = reason; m_reason = reason;
...@@ -62,12 +66,16 @@ network_error::network_error(const std::string& str) : super(str) {} ...@@ -62,12 +66,16 @@ network_error::network_error(const std::string& str) : super(str) {}
network_error::network_error(std::string&& str) : super(std::move(str)) {} network_error::network_error(std::string&& str) : super(std::move(str)) {}
network_error::~network_error() {} network_error::~network_error() noexcept {
// nop
}
bind_failure::bind_failure(const std::string& str) : super(str) {} bind_failure::bind_failure(const std::string& str) : super(str) {}
bind_failure::bind_failure(std::string&& str) : super(std::move(str)) {} bind_failure::bind_failure(std::string&& str) : super(std::move(str)) {}
bind_failure::~bind_failure() {} bind_failure::~bind_failure() noexcept {
// nop
}
} // namespace caf } // namespace caf
...@@ -62,7 +62,7 @@ middleman* middleman::instance() { ...@@ -62,7 +62,7 @@ middleman* middleman::instance() {
} }
void middleman::add_broker(broker_ptr bptr) { void middleman::add_broker(broker_ptr bptr) {
m_brokers.emplace(bptr); m_brokers.insert(bptr);
bptr->attach_functor([=](uint32_t) { bptr->attach_functor([=](uint32_t) {
m_brokers.erase(bptr); m_brokers.erase(bptr);
}); });
......
...@@ -50,7 +50,7 @@ vector<string> split(const string& str, char delim, bool keep_empties) { ...@@ -50,7 +50,7 @@ vector<string> split(const string& str, char delim, bool keep_empties) {
return result; return result;
} }
void verbose_terminate[[noreturn]]() { void verbose_terminate() {
try { try {
throw; throw;
} }
......
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