cppzmq icon indicating copy to clipboard operation
cppzmq copied to clipboard

poller_t tests are not correctly disabled

Open QuLogic opened this issue 5 years ago • 3 comments

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 avatar Jan 22 '19 07:01 QuLogic

Seems to also affect tests/active_poller.cpp.

QuLogic avatar Jan 22 '19 08:01 QuLogic

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.

sigiesec avatar Jan 22 '19 08:01 sigiesec

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

bluca avatar Jan 22 '19 09:01 bluca