erickt / rust-zmq

Rust zeromq bindings.
Apache License 2.0
900 stars 194 forks source link

Fix `zmq::has` feature detection #237

Closed rotty closed 5 years ago

rotty commented 5 years ago

Before this commit, zmq::has will always return None because the compiler flag ZMQ_HAS_ZMQ_HAS wasn't set at all when feature zmq_has was enabled, and was incorrectly set (typo "rust-cfg" instead of "rustc-cfg") when the zmq_has feature was not enabled, but a new-enough version of libzmq was detected.

This commit makes the necessary adjustments to the build script, and adds a test to check that zmq::has is actually being called (i.e. it returns Some(_)).

rotty commented 5 years ago

This is a slightly tweaked version of PR #236, retargeted against the release/v0.8 branch.

@CjS77: I've expanded the commit message based on your PR description -- I prefer to have the git repo as independent of github as possible, keeping helpful information in git, if possible/sensible.