mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-27 07:31:03 +08: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_),
|
||||
parent (parent_)
|
||||
{
|
||||
memset (&resolved, 0, sizeof resolved);
|
||||
resolved.dummy = NULL;
|
||||
}
|
||||
|
||||
zmq::address_t::~address_t ()
|
||||
|
@ -76,8 +76,10 @@ struct address_t
|
||||
ctx_t *const parent;
|
||||
|
||||
// Protocol specific resolved address
|
||||
// All members must be pointers to allow for consistent initialization
|
||||
union
|
||||
{
|
||||
void *dummy;
|
||||
tcp_address_t *tcp_addr;
|
||||
udp_address_t *udp_addr;
|
||||
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
|
||||
|
Loading…
x
Reference in New Issue
Block a user