Skip to content

Commit 7f949c4

Browse files
committed
don't need to rename zmq_recv
we don't support libzmq 2, so this is unnecessary
1 parent 649216d commit 7f949c4

File tree

5 files changed

+11
-39
lines changed

5 files changed

+11
-39
lines changed

zmq/backend/cffi/_cdefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int zmq_msg_close(zmq_msg_t *msg);
4646
int zmq_msg_copy(zmq_msg_t *dst, zmq_msg_t *src);
4747
int zmq_msg_send(zmq_msg_t *msg, void *socket, int flags);
4848
int zmq_msg_recv(zmq_msg_t *msg, void *socket, int flags);
49-
int zmq_recvbuf(void *socket, void *buf, int nbytes, int flags);
49+
int zmq_recv(void *socket, void *buf, int nbytes, int flags);
5050

5151
int zmq_getsockopt(void *socket,
5252
int option_name,

zmq/backend/cffi/socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def recv_into(self, buffer, /, *, nbytes: int = 0, flags: int = 0) -> int:
351351
elif nbytes > view_bytes:
352352
raise ValueError(f"{nbytes=} too big for memoryview of {view_bytes}B")
353353
c_buf = ffi.from_buffer(view)
354-
rc: int = _retry_sys_call(C.zmq_recvbuf, self._zmq_socket, c_buf, nbytes, flags)
354+
rc: int = _retry_sys_call(C.zmq_recv, self._zmq_socket, c_buf, nbytes, flags)
355355
_check_rc(rc)
356356
return rc
357357

zmq/backend/cython/_zmq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
zmq_pollitem_t,
133133
zmq_proxy,
134134
zmq_proxy_steerable,
135-
zmq_recvbuf,
135+
zmq_recv,
136136
zmq_setsockopt,
137137
zmq_socket,
138138
zmq_socket_monitor,
@@ -1258,7 +1258,7 @@ def recv_into(self, buffer, /, *, nbytes=0, flags=0) -> C.int:
12581258
# call zmq_recv, with retries
12591259
while True:
12601260
with nogil:
1261-
rc: C.int = zmq_recvbuf(self.handle, py_buf.buf, c_nbytes, c_flags)
1261+
rc: C.int = zmq_recv(self.handle, py_buf.buf, c_nbytes, c_flags)
12621262
try:
12631263
_check_rc(rc)
12641264
except InterruptedSystemCall:

zmq/backend/cython/libzmq.pxd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ cdef extern from "zmq.h" nogil:
7878
int zmq_msg_set (zmq_msg_t *msg, int option, int optval)
7979
const char *zmq_msg_gets (zmq_msg_t *msg, const char *property)
8080
int zmq_has (const char *capability)
81-
int zmq_recvbuf(void *s_, void *buf_, size_t len_, int flags_)
8281

8382
void *zmq_socket (void *context, int type)
8483
int zmq_close (void *s)
@@ -92,8 +91,8 @@ cdef extern from "zmq.h" nogil:
9291
int zmq_socket_monitor (void *s, char *addr, int flags)
9392

9493
# send/recv
95-
int zmq_sendbuf (void *s, const void *buf, size_t n, int flags)
96-
int zmq_recvbuf (void *s, void *buf, size_t n, int flags)
94+
int zmq_send (void *s, const void *buf, size_t n, int flags)
95+
int zmq_recv (void *s, void *buf, size_t n, int flags)
9796

9897
ctypedef struct zmq_pollitem_t:
9998
void *socket

zmq/utils/zmq_compat.h

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -78,35 +78,8 @@
7878
#define zmq_proxy_steerable(in, out, mon, ctrl) _missing
7979
#endif
8080

81-
#if ZMQ_VERSION_MAJOR >= 3
82-
#define zmq_sendbuf zmq_send
83-
#define zmq_recvbuf zmq_recv
84-
85-
// 3.x deprecations - these symbols haven't been removed,
86-
// but let's protect against their planned removal
87-
#define zmq_device(device_type, isocket, osocket) _missing
88-
#define zmq_init(io_threads) ((void*)NULL)
89-
#define zmq_term zmq_ctx_destroy
90-
#else
91-
#define zmq_ctx_set(ctx, opt, val) _missing
92-
#define zmq_ctx_get(ctx, opt) _missing
93-
#define zmq_ctx_destroy zmq_term
94-
#define zmq_ctx_new() ((void*)NULL)
95-
96-
#define zmq_proxy(a,b,c) _missing
97-
98-
#define zmq_disconnect(s, addr) _missing
99-
#define zmq_unbind(s, addr) _missing
100-
101-
#define zmq_msg_more(msg) _missing
102-
#define zmq_msg_get(msg, opt) _missing
103-
#define zmq_msg_set(msg, opt, val) _missing
104-
#define zmq_msg_send(msg, s, flags) zmq_send(s, msg, flags)
105-
#define zmq_msg_recv(msg, s, flags) zmq_recv(s, msg, flags)
106-
107-
#define zmq_sendbuf(s, buf, len, flags) _missing
108-
#define zmq_recvbuf(s, buf, len, flags) _missing
109-
110-
#define zmq_socket_monitor(s, addr, flags) _missing
111-
112-
#endif
81+
// 3.x deprecations - these symbols haven't been removed,
82+
// but let's protect against their planned removal
83+
#define zmq_device(device_type, isocket, osocket) _missing
84+
#define zmq_init(io_threads) ((void*)NULL)
85+
#define zmq_term zmq_ctx_destroy

0 commit comments

Comments
 (0)