[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: provide inet_?to? declarations in arpa_inet.h
From: |
Simon Josefsson |
Subject: |
Re: provide inet_?to? declarations in arpa_inet.h |
Date: |
Sat, 03 May 2008 06:22:59 +0200 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) |
Bruno Haible <address@hidden> writes:
>> The variable are set to 0 in the inet_ntop/inet_pton modules, via a
>> AC_CHECK_DECLS statement.
>
> No, it isn't. AC_CHECK_DECLS([inet_ntop]...) sets the shell variable
> ac_cv_have_decl_inet_ntop to yes or no. It does not set the shell variable
> HAVE_DECL_INET_NTOP to 1 or 0.
>
> Look at the generated configure file to convince yourself:
> $ ./gnulib-tool --create-testdir --dir=/dev/shm/testdir5 inet_ntop
> $ cd /dev/shm/testdir5
> $ grep HAVE_DECL_INET_NTOP configure
> HAVE_DECL_INET_NTOP
> HAVE_DECL_INET_NTOP=1;
> #define HAVE_DECL_INET_NTOP 1
> #define HAVE_DECL_INET_NTOP 0
Ah, sorry. Thanks for explaining. Indeed, the following was missing.
Pushed.
Thanks,
/Simon
>From 029a3a28224414fe9495a160febd3431b981e659 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Sat, 3 May 2008 06:22:26 +0200
Subject: [PATCH] Make sure inet_ntop/inet_pton is declared when needed.
---
ChangeLog | 7 +++++++
m4/inet_ntop.m4 | 5 ++++-
m4/inet_pton.m4 | 5 ++++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7f2e5f5..f566efa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-03 Simon Josefsson <address@hidden>
+
+ * 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 <address@hidden>
avoid compilation error on FreeBSD 6
diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4
index 342cd28..25a3ee9 100644
--- 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 @@ AC_DEFUN([gl_INET_NTOP],
# 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])
])
diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4
index 7d7f993..a57e4c6 100644
--- 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 @@ AC_DEFUN([gl_INET_PTON],
# 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])
])
--
1.5.5