mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 15:26:04 +00:00
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.
This commit is contained in:
parent
970a005399
commit
c3f7543ebe
@ -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 <sys/uio.h>
|
||||
#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);
|
||||
|
||||
|
12
src/zmq.cpp
12
src/zmq.cpp
@ -51,6 +51,18 @@
|
||||
#endif
|
||||
|
||||
|
||||
// XSI vector I/O
|
||||
#if ZMQ_HAVE_UIO
|
||||
#include <sys/uio.h>
|
||||
#else
|
||||
struct iovec
|
||||
{
|
||||
void *iov_base;
|
||||
size_t iov_len;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user