mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 18:03:50 +00:00
Problem: non-portable memset
Solution: add dummy pointer meber to union instead
This commit is contained in:
parent
9c8fde09ca
commit
93194e7c53
@ -51,7 +51,7 @@ zmq::address_t::address_t (const std::string &protocol_,
|
|||||||
address (address_),
|
address (address_),
|
||||||
parent (parent_)
|
parent (parent_)
|
||||||
{
|
{
|
||||||
memset (&resolved, 0, sizeof resolved);
|
resolved.dummy = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
zmq::address_t::~address_t ()
|
zmq::address_t::~address_t ()
|
||||||
|
@ -76,8 +76,10 @@ struct address_t
|
|||||||
ctx_t *const parent;
|
ctx_t *const parent;
|
||||||
|
|
||||||
// Protocol specific resolved address
|
// Protocol specific resolved address
|
||||||
|
// All members must be pointers to allow for consistent initialization
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
|
void *dummy;
|
||||||
tcp_address_t *tcp_addr;
|
tcp_address_t *tcp_addr;
|
||||||
udp_address_t *udp_addr;
|
udp_address_t *udp_addr;
|
||||||
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
|
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user