X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgai_strerror.c;h=f758f8e90913c94598bc4e42ae30b84c42a62d34;hb=b781b33a9eee9f2bdb70f8fc51f6d1ec5ebbbd02;hp=aa733d6cc397527d602b8368035f3453a8f4d018;hpb=15cc48f8530976b2ec74c2209443ddc04bd9e5b8;p=gnulib.git diff --git a/lib/gai_strerror.c b/lib/gai_strerror.c index aa733d6cc..f758f8e90 100644 --- a/lib/gai_strerror.c +++ b/lib/gai_strerror.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2011 Free Software + Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 1997. @@ -18,13 +19,10 @@ #ifndef _LIBC # include -# include "getaddrinfo.h" #endif #include -#ifdef HAVE_NETDB_H -# include -#endif +#include #ifdef _LIBC # include @@ -34,6 +32,22 @@ # define N_(String) String #endif +#if HAVE_DECL_GAI_STRERROR + +# include +# undef gai_strerror +# if HAVE_DECL_GAI_STRERRORA +# define gai_strerror gai_strerrorA +# endif + +const char * +rpl_gai_strerror (int code) +{ + return gai_strerror (code); +} + +#else /* !HAVE_DECL_GAI_STRERROR */ + static struct { int code; @@ -53,7 +67,7 @@ values[] = { EAI_SOCKTYPE, N_("ai_socktype not supported") }, { EAI_SYSTEM, N_("System error") }, { EAI_OVERFLOW, N_("Argument buffer too small") }, -#ifdef __USE_GNU +#ifdef EAI_INPROGRESS { EAI_INPROGRESS, N_("Processing request in progress") }, { EAI_CANCELED, N_("Request canceled") }, { EAI_NOTCANCELED, N_("Request not canceled") }, @@ -73,6 +87,7 @@ gai_strerror (int code) return _("Unknown error"); } -#ifdef _LIBC +# ifdef _LIBC libc_hidden_def (gai_strerror) -#endif +# endif +#endif /* !HAVE_DECL_GAI_STRERROR */