Commit 415bdbc1 authored by Luca Boccassi's avatar Luca Boccassi

Problem: ZMQ_BINDTODEVICE is DRAFT but not DRAFT

Solution: move definition in the DRAFT section of the header
parent 2048ed5d
...@@ -368,7 +368,6 @@ ZMQ_EXPORT const char *zmq_msg_gets (const zmq_msg_t *msg, const char *property) ...@@ -368,7 +368,6 @@ ZMQ_EXPORT const char *zmq_msg_gets (const zmq_msg_t *msg, const char *property)
#define ZMQ_VMCI_BUFFER_MAX_SIZE 87 #define ZMQ_VMCI_BUFFER_MAX_SIZE 87
#define ZMQ_VMCI_CONNECT_TIMEOUT 88 #define ZMQ_VMCI_CONNECT_TIMEOUT 88
#define ZMQ_USE_FD 89 #define ZMQ_USE_FD 89
#define ZMQ_BINDTODEVICE 90
/* Message options */ /* Message options */
#define ZMQ_MORE 1 #define ZMQ_MORE 1
...@@ -562,6 +561,9 @@ ZMQ_EXPORT void zmq_threadclose (void* thread); ...@@ -562,6 +561,9 @@ ZMQ_EXPORT void zmq_threadclose (void* thread);
#define ZMQ_SCATTER 17 #define ZMQ_SCATTER 17
#define ZMQ_DGRAM 18 #define ZMQ_DGRAM 18
/* DRAFT Socket options. */
#define ZMQ_BINDTODEVICE 90
/* DRAFT 0MQ socket events and monitoring */ /* DRAFT 0MQ socket events and monitoring */
#define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800 #define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800
#define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000 #define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000
......
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
#define ZMQ_SCATTER 17 #define ZMQ_SCATTER 17
#define ZMQ_DGRAM 18 #define ZMQ_DGRAM 18
/* DRAFT Socket options. */
#define ZMQ_BINDTODEVICE 90
/* DRAFT 0MQ socket events and monitoring */ /* DRAFT 0MQ socket events and monitoring */
#define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800 #define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800
#define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000 #define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000
......
...@@ -113,10 +113,11 @@ void test_setsockopt_use_fd () ...@@ -113,10 +113,11 @@ void test_setsockopt_use_fd ()
#define BOUNDDEVBUFSZ 16 #define BOUNDDEVBUFSZ 16
void test_setsockopt_bindtodevice () void test_setsockopt_bindtodevice ()
{ {
int rc;
void *ctx = zmq_ctx_new (); void *ctx = zmq_ctx_new ();
void *socket = zmq_socket (ctx, ZMQ_PUSH); void *socket = zmq_socket (ctx, ZMQ_PUSH);
#ifdef ZMQ_BINDTODEVICE
int rc;
char devname[BOUNDDEVBUFSZ]; char devname[BOUNDDEVBUFSZ];
size_t buflen = BOUNDDEVBUFSZ; size_t buflen = BOUNDDEVBUFSZ;
...@@ -137,6 +138,7 @@ void test_setsockopt_bindtodevice () ...@@ -137,6 +138,7 @@ void test_setsockopt_bindtodevice ()
rc = zmq_getsockopt (socket, ZMQ_BINDTODEVICE, devname, &buflen); rc = zmq_getsockopt (socket, ZMQ_BINDTODEVICE, devname, &buflen);
assert(rc == 0); assert(rc == 0);
assert(!strncmp("testdev", devname, buflen)); assert(!strncmp("testdev", devname, buflen));
#endif
zmq_close (socket); zmq_close (socket);
zmq_ctx_term (ctx); zmq_ctx_term (ctx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment