[zeromq-dev] Checking for Win platform?

Martin Sustrik sustrik at 250bpm.com
Thu Oct 29 15:42:41 CET 2009

Hi all,

I'm trying to extend async I/O functionality (zmq_poll) so that it works 
on Windows in addition to POSIX platforms. The task is pretty easy, the 
only problem is how to identify (in the header file - zmq.h) whether we 
are using windows sockets (void*) or a posix sockets (int)

Something like this would work:

#ifdef _WINDOWS_
typedef void* fd_t
typedef int fd_t

The problem is that every user would have to include windows.h before 
zmq.h to get the _WINDOWS_ macro defined.

Anyone is aware of a better solution?


More information about the zeromq-dev mailing list