From c3f7543ebe08cfdadf218fa558f03a5d382d322c Mon Sep 17 00:00:00 2001 From: skaller Date: Wed, 8 Feb 2012 13:15:47 +1100 Subject: [PATCH] Fix uio support. We have to use an incomplete type in the interface. The definition of iovec is only in the implementation. This appears to following existing practice in 0MQ. It seems a bit flakey that zmq.h is not included in zmq.cpp, which is normal practice to ensure the implementation matches the specified interface. YMMV. I follow 0MQ style. --- include/zmq.h | 11 ----------- src/zmq.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/zmq.h b/include/zmq.h index aaa04305..f28d5456 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -215,17 +215,6 @@ ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags); ZMQ_EXPORT int zmq_sendmsg (void *s, zmq_msg_t *msg, int flags); ZMQ_EXPORT int zmq_recvmsg (void *s, zmq_msg_t *msg, int flags); -// XSI vector I/O -#if ZMQ_HAVE_UIO -#include -#else -struct iovec -{ - void *iov_base; - size_t iov_len; -}; -#endif - ZMQ_EXPORT int zmq_sendv (void *s, struct iovec *iov, size_t count, int flags); ZMQ_EXPORT int zmq_recvmmsg (void *s, struct iovec *iov, size_t *count, int flags); diff --git a/src/zmq.cpp b/src/zmq.cpp index c70cfa6b..e4179127 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -51,6 +51,18 @@ #endif +// XSI vector I/O +#if ZMQ_HAVE_UIO +#include +#else +struct iovec +{ + void *iov_base; + size_t iov_len; +}; +#endif + + #include #include #include