zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.95k stars 757 forks source link

poller_t tests are not correctly disabled #283

Open QuLogic opened 5 years ago

QuLogic commented 5 years ago

In zmq.hpp, poller_t is defined if #if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER).

In tests/poller.cpp, the code is wrapped in #if defined(ZMQ_CPP11) && defined(ZMQ_BUILD_DRAFT_API).

It seems the latter is missing the check for ZMQ_HAVE_POLLER, which can cause compile to fail with undefined types.

QuLogic commented 5 years ago

Seems to also affect tests/active_poller.cpp.

sigiesec commented 5 years ago

Thanks for pointing this out. This is inconsistent for sure. However, I think that ZMQ_BUILD_DRAFT_API implies ZMQ_HAVE_POLLER, so only one of ZMQ_BUILD_DRAFT_API or ZMQ_HAVE_POLLER needs to be used in the condition. I will check this in libzmq.

bluca commented 5 years ago

Use have_poller so that when it goes out of draft you don't have to change the code