From 8fac511a6e8309181f219c4b9fd2a0be578f1db3 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 24 Oct 2019 15:39:25 +0200 Subject: socket.c: build multiaddr socket API helpers only if used by public APIs Those two functions are only used by osmo_sock_init2_multiaddr(), which is only built if HAVE_LIBSCTP is defined. Avoid compiler warning about unusued function helpers if osmo_sock_init2_multiaddr() is not being built. Change-Id: I52769d6b8f70af1a8bda23d60b3230a932e71fab --- src/socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/socket.c b/src/socket.c index 47528810..9b1d30ec 100644 --- a/src/socket.c +++ b/src/socket.c @@ -100,6 +100,7 @@ static struct addrinfo *addrinfo_helper(uint16_t family, uint16_t type, uint8_t return result; } +#ifdef HAVE_LIBSCTP /*! Retrieve an array of addrinfo with specified hints, one for each host in the hosts array. * \param[out] addrinfo array of addrinfo pointers, will be filled by the function on success. * Its size must be at least the one of hosts. @@ -127,6 +128,7 @@ static int addrinfo_helper_multi(struct addrinfo **addrinfo, uint16_t family, ui } return 0; } +#endif /* HAVE_LIBSCTP*/ static int socket_helper(const struct addrinfo *rp, unsigned int flags) { @@ -150,6 +152,7 @@ static int socket_helper(const struct addrinfo *rp, unsigned int flags) return sfd; } +#ifdef HAVE_LIBSCTP /* Fill buf with a string representation of the address set, in the form: * buf_len == 0: "()" * buf_len == 1: "hostA" @@ -181,6 +184,7 @@ static int multiaddr_snprintf(char* buf, size_t buf_len, const char **hosts, siz return len; } +#endif /* HAVE_LIBSCTP */ static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags) { -- cgit v1.2.3