Commit 8b82ed50 authored by Luca Boccassi's avatar Luca Boccassi

Problem: Solaris Studio does not convert from char * to string

Solution: do it explicitly to fix build on Solaris 10/11 with the Sun
compiler
parent 3d9c1195
...@@ -503,7 +503,8 @@ int zmq::ctx_t::register_endpoint (const char *addr_, ...@@ -503,7 +503,8 @@ int zmq::ctx_t::register_endpoint (const char *addr_,
scoped_lock_t locker (endpoints_sync); scoped_lock_t locker (endpoints_sync);
const bool inserted = const bool inserted =
endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, endpoint_).second; endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (std::string (addr_), endpoint_)
.second;
if (!inserted) { if (!inserted) {
errno = EADDRINUSE; errno = EADDRINUSE;
return -1; return -1;
......
...@@ -62,7 +62,8 @@ void zmq::mechanism_t::set_user_id (const void *data_, size_t size_) ...@@ -62,7 +62,8 @@ void zmq::mechanism_t::set_user_id (const void *data_, size_t size_)
{ {
user_id.set (static_cast<const unsigned char *> (data_), size_); user_id.set (static_cast<const unsigned char *> (data_), size_);
zap_properties.ZMQ_MAP_INSERT_OR_EMPLACE ( zap_properties.ZMQ_MAP_INSERT_OR_EMPLACE (
ZMQ_MSG_PROPERTY_USER_ID, std::string ((char *) data_, size_)); std::string (ZMQ_MSG_PROPERTY_USER_ID),
std::string ((char *) data_, size_));
} }
const zmq::blob_t &zmq::mechanism_t::get_user_id () const const zmq::blob_t &zmq::mechanism_t::get_user_id () const
......
...@@ -783,7 +783,7 @@ int zmq::socket_base_t::connect (const char *addr_) ...@@ -783,7 +783,7 @@ int zmq::socket_base_t::connect (const char *addr_)
last_endpoint.assign (addr_); last_endpoint.assign (addr_);
// remember inproc connections for disconnect // remember inproc connections for disconnect
inprocs.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, new_pipes[0]); inprocs.ZMQ_MAP_INSERT_OR_EMPLACE (std::string (addr_), new_pipes[0]);
options.connected = true; options.connected = true;
return 0; return 0;
...@@ -982,7 +982,7 @@ void zmq::socket_base_t::add_endpoint (const char *addr_, ...@@ -982,7 +982,7 @@ void zmq::socket_base_t::add_endpoint (const char *addr_,
{ {
// Activate the session. Make it a child of this socket. // Activate the session. Make it a child of this socket.
launch_child (endpoint_); launch_child (endpoint_);
endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (std::string (addr_),
endpoint_pipe_t (endpoint_, pipe)); endpoint_pipe_t (endpoint_, pipe));
} }
......
...@@ -999,14 +999,15 @@ bool zmq::stream_engine_t::init_properties (properties_t &properties) ...@@ -999,14 +999,15 @@ bool zmq::stream_engine_t::init_properties (properties_t &properties)
{ {
if (peer_address.empty ()) if (peer_address.empty ())
return false; return false;
properties.ZMQ_MAP_INSERT_OR_EMPLACE (ZMQ_MSG_PROPERTY_PEER_ADDRESS, properties.ZMQ_MAP_INSERT_OR_EMPLACE (
peer_address); std::string (ZMQ_MSG_PROPERTY_PEER_ADDRESS), peer_address);
// Private property to support deprecated SRCFD // Private property to support deprecated SRCFD
std::ostringstream stream; std::ostringstream stream;
stream << (int) s; stream << (int) s;
std::string fd_string = stream.str (); std::string fd_string = stream.str ();
properties.ZMQ_MAP_INSERT_OR_EMPLACE ("__fd", ZMQ_MOVE (fd_string)); properties.ZMQ_MAP_INSERT_OR_EMPLACE (std::string ("__fd"),
ZMQ_MOVE (fd_string));
return true; return true;
} }
......
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