From 2c9bdd78566a7215416e9db076e36d4c77a04da0 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 16 Dec 2010 20:45:34 +0100 Subject: ares_inet_ntop: reapply changes from previous c-ares version (II) - Remove rcsid. - Adjust header file inclusions. - ares_inet_ntop used only on systems without a proper inet_ntop function. --- inet_ntop.c | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'inet_ntop.c') diff --git a/inet_ntop.c b/inet_ntop.c index cc25a59..cdd1a40 100644 --- a/inet_ntop.c +++ b/inet_ntop.c @@ -15,25 +15,38 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp $"; -#endif /* LIBC_SCCS and not lint */ +#include "ares_setup.h" -#include "port_before.h" - -#include -#include -#include - -#include -#include -#include +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include +#else +# include "nameser.h" +#endif +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +# include +#endif +#include #include #include #include +#include + +#include "ares.h" +#include "ares_ipv6.h" +#include "inet_ntop.h" -#include "port_after.h" + +#ifndef HAVE_INET_NTOP #ifdef SPRINTF_CHAR # define SPRINTF(x) strlen(sprintf/**/x) @@ -58,7 +71,7 @@ static const char *inet_ntop6(const u_char *src, char *dst, size_t size); * Paul Vixie, 1996. */ const char * -inet_ntop(int af, const void *src, char *dst, size_t size) +ares_inet_ntop(int af, const void *src, char *dst, size_t size) { switch (af) { case AF_INET: @@ -193,5 +206,4 @@ inet_ntop6(const u_char *src, char *dst, size_t size) strcpy(dst, tmp); return (dst); } - -/*! \file */ +#endif -- cgit v1.2.3