Commit 4f436ce0 authored by JaeSang Yoo's avatar JaeSang Yoo

Problem: some conditional compile was not applied

Conditinoal compile for OPENPGM and NORM is mixed.
Also found few codes which needs conditional compile but not applied.

Solution: Apply conditional compile preprocessors
parent ebd22ecf
...@@ -62,9 +62,13 @@ namespace protocol_name ...@@ -62,9 +62,13 @@ namespace protocol_name
static const char inproc[] = "inproc"; static const char inproc[] = "inproc";
static const char tcp[] = "tcp"; static const char tcp[] = "tcp";
static const char udp[] = "udp"; static const char udp[] = "udp";
#ifdef ZMQ_HAVE_OPENPGM
static const char pgm[] = "pgm"; static const char pgm[] = "pgm";
static const char epgm[] = "epgm"; static const char epgm[] = "epgm";
#endif
#ifdef ZMQ_HAVE_NORM
static const char norm[] = "norm"; static const char norm[] = "norm";
#endif
#ifdef ZMQ_HAVE_WS #ifdef ZMQ_HAVE_WS
static const char ws[] = "ws"; static const char ws[] = "ws";
#endif #endif
......
...@@ -534,10 +534,14 @@ void zmq::session_base_t::reconnect () ...@@ -534,10 +534,14 @@ void zmq::session_base_t::reconnect ()
{ {
// For delayed connect situations, terminate the pipe // For delayed connect situations, terminate the pipe
// and reestablish later on // and reestablish later on
if (_pipe && options.immediate == 1 if (_pipe && options.immediate == 1
#ifdef ZMQ_HAVE_OPENPGM
&& _addr->protocol != protocol_name::pgm && _addr->protocol != protocol_name::pgm
&& _addr->protocol != protocol_name::epgm && _addr->protocol != protocol_name::epgm
#endif
#ifdef ZMQ_HAVE_NORM
&& _addr->protocol != protocol_name::norm && _addr->protocol != protocol_name::norm
#endif
&& _addr->protocol != protocol_name::udp) { && _addr->protocol != protocol_name::udp) {
_pipe->hiccup (); _pipe->hiccup ();
_pipe->terminate (false); _pipe->terminate (false);
......
...@@ -369,8 +369,14 @@ int zmq::socket_base_t::check_protocol (const std::string &protocol_) const ...@@ -369,8 +369,14 @@ int zmq::socket_base_t::check_protocol (const std::string &protocol_) const
// Specifically, multicast protocols can't be combined with // Specifically, multicast protocols can't be combined with
// bi-directional messaging patterns (socket types). // bi-directional messaging patterns (socket types).
#if defined ZMQ_HAVE_OPENPGM || defined ZMQ_HAVE_NORM #if defined ZMQ_HAVE_OPENPGM || defined ZMQ_HAVE_NORM
if ((protocol_ == protocol_name::pgm || protocol_ == protocol_name::epgm if ((false
|| protocol_ == protocol_name::norm) #ifdef ZMQ_HAVE_OPENPGM
|| protocol_ == protocol_name::pgm || protocol_ == protocol_name::epgm
#endif
#ifdef ZMQ_HAVE_NORM
|| protocol_ == protocol_name::norm
#endif
|| false)
&& options.type != ZMQ_PUB && options.type != ZMQ_SUB && options.type != ZMQ_PUB && options.type != ZMQ_SUB
&& options.type != ZMQ_XPUB && options.type != ZMQ_XSUB) { && options.type != ZMQ_XPUB && options.type != ZMQ_XSUB) {
errno = ENOCOMPATPROTO; errno = ENOCOMPATPROTO;
...@@ -547,8 +553,14 @@ int zmq::socket_base_t::bind (const char *endpoint_uri_) ...@@ -547,8 +553,14 @@ int zmq::socket_base_t::bind (const char *endpoint_uri_)
return rc; return rc;
} }
if (protocol == protocol_name::pgm || protocol == protocol_name::epgm if (false
|| protocol == protocol_name::norm) { #ifdef ZMQ_HAVE_OPENPGM
|| protocol == protocol_name::pgm || protocol == protocol_name::epgm
#endif
#ifdef ZMQ_HAVE_NORM
|| protocol == protocol_name::norm
#endif
|| false) {
// For convenience's sake, bind can be used interchangeable with // For convenience's sake, bind can be used interchangeable with
// connect for PGM, EPGM, NORM transports. // connect for PGM, EPGM, NORM transports.
rc = connect (endpoint_uri_); rc = connect (endpoint_uri_);
...@@ -1023,9 +1035,14 @@ int zmq::socket_base_t::connect_internal (const char *endpoint_uri_) ...@@ -1023,9 +1035,14 @@ int zmq::socket_base_t::connect_internal (const char *endpoint_uri_)
// PGM does not support subscription forwarding; ask for all data to be // PGM does not support subscription forwarding; ask for all data to be
// sent to this pipe. (same for NORM, currently?) // sent to this pipe. (same for NORM, currently?)
const bool subscribe_to_all = protocol == protocol_name::pgm const bool subscribe_to_all = false
#ifdef ZMQ_HAVE_OPENPGM
|| protocol == protocol_name::pgm
|| protocol == protocol_name::epgm || protocol == protocol_name::epgm
#endif
#ifdef ZMQ_HAVE_NORM
|| protocol == protocol_name::norm || protocol == protocol_name::norm
#endif
|| protocol == protocol_name::udp; || protocol == protocol_name::udp;
pipe_t *newpipe = NULL; pipe_t *newpipe = NULL;
......
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