summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-10-24 15:39:25 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-10-24 15:39:27 +0200
commit8fac511a6e8309181f219c4b9fd2a0be578f1db3 (patch)
treebd38fbfb733159e404de5e376d62c2324b4ff1fb /src
parent80c8a1d281ff630770f94160ff98a6f7afeed4d8 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/socket.c4
1 files changed, 4 insertions, 0 deletions
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)
{