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
diff --git a/src/socket.c b/src/socket.c
index 4752881..9b1d30e 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -100,6 +100,7 @@
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 @@
}
return 0;
}
+#endif /* HAVE_LIBSCTP*/
static int socket_helper(const struct addrinfo *rp, unsigned int flags)
{
@@ -150,6 +152,7 @@
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 @@
return len;
}
+#endif /* HAVE_LIBSCTP */
static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags)
{