From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26574 invoked by alias); 23 Sep 2005 13:44:10 -0000 Mailing-List: contact glibc-bugs-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sources.redhat.com Received: (qmail 26381 invoked by uid 48); 23 Sep 2005 13:44:00 -0000 Date: Fri, 23 Sep 2005 13:44:00 -0000 Message-ID: <20050923134400.26380.qmail@sourceware.org> From: "simon at josefsson dot org" To: glibc-bugs@sources.redhat.com In-Reply-To: <20041110184141.538.simon@josefsson.org> References: <20041110184141.538.simon@josefsson.org> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/538] Improvement to getaddrinfo gai_strerror.c to make it usable in gnulib X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg00201.txt.bz2 List-Id: ------- Additional Comments From simon at josefsson dot org 2005-09-23 13:43 ------- (In reply to comment #2) > It is always wrong to use __USE_GNU in non-header files. The file must simply > be defined so that the definitions of the values are visible in the header. How about this patch? It sync with current gnulib CVS, and hide the non-POSIX EAI_* values inside a #if EAI_IDN_ENCODE test. Index: gai_strerror.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/posix/gai_strerror.c,v retrieving revision 1.7 diff -u -p -r1.7 gai_strerror.c --- gai_strerror.c 8 Mar 2004 22:21:13 -0000 1.7 +++ gai_strerror.c 23 Sep 2005 13:41:31 -0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001, 2002, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 1997. @@ -17,9 +17,24 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifndef _LIBC +# include "getaddrinfo.h" +#endif + #include #include -#include + +#ifdef _LIBC +# include +#else +# include "gettext.h" +# define _(String) gettext (String) +# define N_(String) String +#endif static struct { @@ -39,12 +54,14 @@ values[] = { EAI_SERVICE, N_("Servname not supported for ai_socktype") }, { EAI_SOCKTYPE, N_("ai_socktype not supported") }, { EAI_SYSTEM, N_("System error") }, +#ifdef EAI_IDN_ENCODE { EAI_INPROGRESS, N_("Processing request in progress") }, { EAI_CANCELED, N_("Request canceled") }, { EAI_NOTCANCELED, N_("Request not canceled") }, { EAI_ALLDONE, N_("All requests done") }, { EAI_INTR, N_("Interrupted by a signal") }, { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") } +#endif }; const char * @@ -57,4 +74,6 @@ gai_strerror (int code) return _("Unknown error"); } +#ifdef _LIBC libc_hidden_def (gai_strerror) +#endif -- http://sourceware.org/bugzilla/show_bug.cgi?id=538 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.