changeset 10032:3e6530c5e7c2

Make sure inet_ntop/inet_pton is declared when needed.
author Simon Josefsson <simon@josefsson.org>
date Sat, 03 May 2008 06:22:26 +0200
parents 20ec438bdeb8
children 24328ed2c4f6
files ChangeLog m4/inet_ntop.m4 m4/inet_pton.m4
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-03  Simon Josefsson  <simon@josefsson.org>
+
+	* m4/inet_pton.m4: Set HAVE_DECL_INET_PTON to 0 when declarations
+	are needed from arpa/inet.h.
+	* m4/inet_ntop.m4: Likewise, for HAVE_DECL_INET_NTOP.
+	Reported by Bruno Haible.
+
 2008-05-02  Jim Meyering  <meyering@redhat.com>
 
 	avoid compilation error on FreeBSD 6
--- a/m4/inet_ntop.m4
+++ b/m4/inet_ntop.m4
@@ -1,4 +1,4 @@
-# inet_ntop.m4 serial 5
+# inet_ntop.m4 serial 6
 dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,6 +19,9 @@
 # Prerequisites of lib/inet_ntop.c.
 AC_DEFUN([gl_PREREQ_INET_NTOP], [
   AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
+  if test $ac_cv_have_decl_inet_ntop = no; then
+    HAVE_DECL_INET_NTOP=0
+  fi
   AC_REQUIRE([gl_SOCKET_FAMILIES])
   AC_REQUIRE([AC_C_RESTRICT])
 ])
--- a/m4/inet_pton.m4
+++ b/m4/inet_pton.m4
@@ -1,4 +1,4 @@
-# inet_pton.m4 serial 4
+# inet_pton.m4 serial 5
 dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,6 +19,9 @@
 # Prerequisites of lib/inet_pton.c.
 AC_DEFUN([gl_PREREQ_INET_PTON], [
   AC_CHECK_DECLS([inet_pton],,,[#include <arpa/inet.h>])
+  if test $ac_cv_have_decl_inet_pton = no; then
+    HAVE_DECL_INET_PTON=0
+  fi
   AC_REQUIRE([gl_SOCKET_FAMILIES])
   AC_REQUIRE([AC_C_RESTRICT])
 ])