Merge pull request #261 from mkoppanen/windows-build

Windows build
This commit is contained in:
Ian Barber 2012-02-17 14:38:02 -08:00
commit 06140daf29
3 changed files with 8 additions and 3 deletions

View File

@ -41,10 +41,12 @@ zmq::address_t::~address_t ()
resolved.tcp_addr = 0; resolved.tcp_addr = 0;
} }
} }
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
else if (protocol == "ipc") { else if (protocol == "ipc") {
if (resolved.ipc_addr) { if (resolved.ipc_addr) {
delete resolved.ipc_addr; delete resolved.ipc_addr;
resolved.ipc_addr = 0; resolved.ipc_addr = 0;
} }
} }
#endif
} }

View File

@ -26,8 +26,9 @@
namespace zmq namespace zmq
{ {
class tcp_address_t; class tcp_address_t;
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
class ipc_address_t; class ipc_address_t;
#endif
struct address_t { struct address_t {
address_t (const std::string &protocol_, const std::string &address_); address_t (const std::string &protocol_, const std::string &address_);
@ -39,10 +40,11 @@ namespace zmq
// Protocol specific resolved address // Protocol specific resolved address
union { union {
tcp_address_t *tcp_addr; tcp_address_t *tcp_addr;
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
ipc_address_t *ipc_addr; ipc_address_t *ipc_addr;
#endif
} resolved; } resolved;
}; };
} }
#endif #endif

View File

@ -464,6 +464,7 @@ int zmq::socket_base_t::connect (const char *addr_)
return -1; return -1;
} }
} }
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
else if(protocol == "ipc") { else if(protocol == "ipc") {
paddr->resolved.ipc_addr = new (std::nothrow) ipc_address_t (); paddr->resolved.ipc_addr = new (std::nothrow) ipc_address_t ();
zmq_assert (paddr->resolved.ipc_addr); zmq_assert (paddr->resolved.ipc_addr);
@ -473,7 +474,7 @@ int zmq::socket_base_t::connect (const char *addr_)
return -1; return -1;
} }
} }
#endif
// Create session. // Create session.
session_base_t *session = session_base_t::create (io_thread, true, this, session_base_t *session = session_base_t::create (io_thread, true, this,
options, paddr); options, paddr);