[zeromq-dev] platform checks.

George Neill georgen at neillnet.com
Wed Nov 12 05:19:20 CET 2008


On Tue, Nov 11, 2008 at 10:10 PM, George Neill <georgen at neillnet.com> wrote:
> All,
>
>  I see a potential (future?) problem in at least one spot in the
> zeromq code base.  I have been looking at the ysemaphore.[ch]pp
> ZMQ_HAVE_*  ifdefs and they seem to be disjoint, not to the point of
> conflict ... but I spose' it could happen very easily.  I guess I had
> expected to see the same ifdefs from the header wrapped around the
> zmq::ysemaphore_t::signal() funcs in the .cpp.  Maybe a +1 for
> platform feature tests?

sorry to post to myself!  just continuing my thoughts ... maybe
something like this in platform.h is in order

/* define synchronization mechanics */
#if defined(ZMQ_HAVE_WINDOWS)
#define ZMQ_USE_EVENTS
#elif defined(ZMQ_HAVE_SOLARIS) || defined(ZMQ_HAVE_LINUX)
#define ZMQ_USE_PTHREADS
#else
#define ZMQ_USE_SEMAPHORES
#endif

This might be cumbersome, but would probably help in the long run.

Later,
George



More information about the zeromq-dev mailing list