forked from elastic/logstash-forwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zmq_compat.h
18 lines (16 loc) · 1005 Bytes
/
zmq_compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef _ZMQ_COMPAT_H_
#define _ZMQ_COMPAT_H_
# if ZMQ_VERSION_MAJOR == 2 /* zeromq 2 */
# define zmq_compat_set_sendhwm(socket, hwm) zmq_setsockopt(socket, ZMQ_HWM, &hwm, sizeof(hwm))
# define zmq_compat_set_recvhwm(socket, hwm) zmq_setsockopt(socket, ZMQ_HWM, &hwm, sizeof(hwm))
# define zmq_compat_recvmsg(socket, message, flags) zmq_recv(socket, message, flags)
# define zmq_compat_sendmsg(socket, message, flags) zmq_send(socket, message, flags)
# elif ZMQ_VERSION_MAJOR == 3 /* zeromq 3 */
# define zmq_compat_set_sendhwm(socket, hwm) zmq_setsockopt(socket, ZMQ_SNDHWM, &hwm, sizeof(hwm))
# define zmq_compat_set_recvhwm(socket, hwm) zmq_setsockopt(socket, ZMQ_RCVHWM, &hwm, sizeof(hwm))
# define zmq_compat_recvmsg(socket, message, flags) zmq_recvmsg(socket, message, flags)
# define zmq_compat_sendmsg(socket, message, flags) zmq_sendmsg(socket, message, flags)
# else
# error "Unsupported zeromq version " ## ZMQ_VERSION_MAJOR
# endif
#endif /* _ZMQ_COMPAT_H_ */