diff options
| author | Evgeny Ermakov <22344340+unspecd@users.noreply.github.com> | 2021-01-02 04:09:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-02 01:09:55 -0800 |
| commit | 44b8e23f39e4753ba8e9b7999dd5158adaecb5dc (patch) | |
| tree | 4ef7a61c40332be2520610a004b75983f329ac64 /src/compat | |
| parent | ed542ac45e00c9b2faa0b41f3c00de6e291e5678 (diff) | |
| download | nng-44b8e23f39e4753ba8e9b7999dd5158adaecb5dc.tar.gz nng-44b8e23f39e4753ba8e9b7999dd5158adaecb5dc.tar.bz2 nng-44b8e23f39e4753ba8e9b7999dd5158adaecb5dc.zip | |
Fix compilation errors when NNG_ELIDE_DEPRECATED is ON (#1392)
Diffstat (limited to 'src/compat')
| -rw-r--r-- | src/compat/nanomsg/nn.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/compat/nanomsg/nn.c b/src/compat/nanomsg/nn.c index b6af8233..7c5d2383 100644 --- a/src/compat/nanomsg/nn.c +++ b/src/compat/nanomsg/nn.c @@ -238,7 +238,7 @@ nn_socket(int domain, int protocol) } // Legacy sockets have nodelay disabled. - (void) nng_setopt_bool(sock, NNG_OPT_TCP_NODELAY, false); + (void) nng_socket_set_bool(sock, NNG_OPT_TCP_NODELAY, false); return ((int) sock.id); } @@ -683,7 +683,7 @@ nn_getdomain(nng_socket s, void *valp, size_t *szp) bool b; int rv; - if ((rv = nng_getopt_bool(s, NNG_OPT_RAW, &b)) != 0) { + if ((rv = nng_socket_get_bool(s, NNG_OPT_RAW, &b)) != 0) { nn_seterror(rv); return (-1); } @@ -704,7 +704,7 @@ nn_getfd(nng_socket s, void *valp, size_t *szp, const char *opt) int rv; SOCKET sfd; - if ((rv = nng_getopt_int(s, opt, &ifd)) != 0) { + if ((rv = nng_socket_get_int(s, opt, &ifd)) != 0) { nn_seterror(rv); return (-1); } @@ -799,7 +799,7 @@ nn_settcpnodelay(nng_socket s, const void *valp, size_t sz) return (-1); } - if ((rv = nng_setopt_bool(s, NNG_OPT_TCP_NODELAY, val)) != 0) { + if ((rv = nng_socket_set_bool(s, NNG_OPT_TCP_NODELAY, val)) != 0) { nn_seterror(rv); return (-1); } @@ -813,7 +813,7 @@ nn_gettcpnodelay(nng_socket s, void *valp, size_t *szp) int ival; int rv; - if ((rv = nng_getopt_bool(s, NNG_OPT_TCP_NODELAY, &val)) != 0) { + if ((rv = nng_socket_get_bool(s, NNG_OPT_TCP_NODELAY, &val)) != 0) { nn_seterror(rv); return (-1); } @@ -829,7 +829,7 @@ nn_getrcvbuf(nng_socket s, void *valp, size_t *szp) int cnt; int rv; - if ((rv = nng_getopt_int(s, NNG_OPT_RECVBUF, &cnt)) != 0) { + if ((rv = nng_socket_get_int(s, NNG_OPT_RECVBUF, &cnt)) != 0) { nn_seterror(rv); return (-1); } @@ -855,7 +855,7 @@ nn_setrcvbuf(nng_socket s, const void *valp, size_t sz) // estimate, and assumes messages are 1kB on average. cnt += 1023; cnt /= 1024; - if ((rv = nng_setopt_int(s, NNG_OPT_RECVBUF, cnt)) != 0) { + if ((rv = nng_socket_set_int(s, NNG_OPT_RECVBUF, cnt)) != 0) { nn_seterror(rv); return (-1); } @@ -868,7 +868,7 @@ nn_getsndbuf(nng_socket s, void *valp, size_t *szp) int cnt; int rv; - if ((rv = nng_getopt_int(s, NNG_OPT_SENDBUF, &cnt)) != 0) { + if ((rv = nng_socket_get_int(s, NNG_OPT_SENDBUF, &cnt)) != 0) { nn_seterror(rv); return (-1); } @@ -894,7 +894,7 @@ nn_setsndbuf(nng_socket s, const void *valp, size_t sz) // estimate, and assumes messages are 1kB on average. cnt += 1023; cnt /= 1024; - if ((rv = nng_setopt_int(s, NNG_OPT_SENDBUF, cnt)) != 0) { + if ((rv = nng_socket_set_int(s, NNG_OPT_SENDBUF, cnt)) != 0) { nn_seterror(rv); return (-1); } @@ -923,7 +923,7 @@ nn_setrcvmaxsz(nng_socket s, const void *valp, size_t sz) errno = EINVAL; return (-1); } - if ((rv = nng_setopt_size(s, NNG_OPT_RECVMAXSZ, val)) != 0) { + if ((rv = nng_socket_set_size(s, NNG_OPT_RECVMAXSZ, val)) != 0) { nn_seterror(rv); return (-1); } @@ -937,7 +937,7 @@ nn_getrcvmaxsz(nng_socket s, void *valp, size_t *szp) int rv; size_t val; - if ((rv = nng_getopt_size(s, NNG_OPT_RECVMAXSZ, &val)) != 0) { + if ((rv = nng_socket_get_size(s, NNG_OPT_RECVMAXSZ, &val)) != 0) { nn_seterror(rv); return (-1); } @@ -1104,7 +1104,7 @@ nn_getsockopt(int s, int nnlevel, int nnopt, void *valp, size_t *szp) return (-1); } - if ((rv = nng_getopt(sid, name, valp, szp)) != 0) { + if ((rv = nng_socket_get(sid, name, valp, szp)) != 0) { nn_seterror(rv); return (-1); } @@ -1141,7 +1141,7 @@ nn_setsockopt(int s, int nnlevel, int nnopt, const void *valp, size_t sz) return (-1); } - if ((rv = nng_setopt(sid, name, valp, sz)) != 0) { + if ((rv = nng_socket_set(sid, name, valp, sz)) != 0) { nn_seterror(rv); return (-1); } @@ -1234,7 +1234,7 @@ nn_poll(struct nn_pollfd *fds, int nfds, int timeout) if (fds[i].events & NN_POLLIN) { nng_socket s; s.id = fds[i].fd; - if ((rv = nng_getopt_int(s, NNG_OPT_RECVFD, &fd)) != + if ((rv = nng_socket_get_int(s, NNG_OPT_RECVFD, &fd)) != 0) { nn_seterror(rv); NNI_FREE_STRUCTS(pfd, nfds * 2); @@ -1251,7 +1251,7 @@ nn_poll(struct nn_pollfd *fds, int nfds, int timeout) if (fds[i].events & NN_POLLOUT) { nng_socket s; s.id = fds[i].fd; - if ((rv = nng_getopt_int(s, NNG_OPT_SENDFD, &fd)) != + if ((rv = nng_socket_get_int(s, NNG_OPT_SENDFD, &fd)) != 0) { nn_seterror(rv); NNI_FREE_STRUCTS(pfd, nfds * 2); @@ -1317,7 +1317,7 @@ nn_term(void) // all sockets in the process, including those // in use by libraries, etc. Accordingly, do not use this // in a library -- only e.g. atexit() and similar. - nng_closeall(); + nni_sock_closeall(); } uint64_t |
