diff --git a/libs/freetdm/configure.ac b/libs/freetdm/configure.ac index ffe599eb37..2931a4f262 100644 --- a/libs/freetdm/configure.ac +++ b/libs/freetdm/configure.ac @@ -45,7 +45,8 @@ sun) ;; esac -AC_CHECK_HEADERS([netinet/sctp.h]) +AC_CHECK_HEADERS([netinet/sctp.h netdb.h]) +AC_CHECK_FUNCS([gethostbyname_r]) # Enable debugging AC_ARG_ENABLE(debug, diff --git a/libs/freetdm/src/ss7_boost_client.c b/libs/freetdm/src/ss7_boost_client.c index dc0151e2ab..d2ec25d597 100644 --- a/libs/freetdm/src/ss7_boost_client.c +++ b/libs/freetdm/src/ss7_boost_client.c @@ -30,15 +30,21 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#if HAVE_NETDB_H +#include +#endif + #include "openzap.h" #include -#ifndef gethostbyname_r -extern int gethostbyname_r (__const char *__restrict __name, - struct hostent *__restrict __result_buf, - char *__restrict __buf, size_t __buflen, - struct hostent **__restrict __result, - int *__restrict __h_errnop); + +#ifndef HAVE_GETHOSTBYNAME_R +extern int gethostbyname_r (const char *__name, + struct hostent *__result_buf, + char *__buf, size_t __buflen, + struct hostent **__result, + int *__h_errnop); #endif struct ss7bc_map {