public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "simon@josefsson.org" <sourceware-bugzilla@sources.redhat.com>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/538] New: Improvement to getaddrinfo gai_strerror.c to make it usable in gnulib
Date: Wed, 10 Nov 2004 18:42:00 -0000	[thread overview]
Message-ID: <20041110184141.538.simon@josefsson.org> (raw)

Gnulib contain a getaddrinfo.c re-implementation.  While the core implementation
is not the same as the one in libc (the glibc one is not GPL), I'd like for
gai_strerror.c to be shared.  What do you think of the following patch?

(Btw, the anonymous CVS pserver seem down at the moment.)

Thanks.

2004-11-10  Simon Josefsson  <jas@extundo.com>

	* sysdeps/posix/gai_strerror.c [_LIBC]: Make #include <libintl.h>
	conditional on _LIBC.
	[!_LIBC]: Include getaddrinfo.h, gettext.h and define _ and N_,
	for when the file is used in gnulib.
	[__USE_GNU]: Only use EAI_INPROGRESS, EAI_CANCELED,
	EAI_NOTCANCELED, EAI_ALLDONE, EAI_INTR, and EAI_IDN_ENCODE when
	__USE_GNU, to align with netdb.h.
	[_LIBC]: Make libc_hidden_def conditional on _LIBC.

--- gai_strerror.c.orig	2004-11-10 19:36:32.000000000 +0100
+++ gai_strerror.c	2004-11-10 19:30:29.000000000 +0100
@@ -19,7 +19,15 @@
 
 #include <stdio.h>
 #include <netdb.h>
-#include <libintl.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "getaddrinfo.h"
+# include "gettext.h"
+# define _(String) gettext (String)
+# define N_(String) String
+#endif
 
 static struct
   {
@@ -39,12 +47,14 @@
     { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
     { EAI_SOCKTYPE, N_("ai_socktype not supported") },
     { EAI_SYSTEM, N_("System error") },
+#ifdef __USE_GNU
     { 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 +67,6 @@
 
   return _("Unknown error");
 }
+#ifdef _LIBC
 libc_hidden_def (gai_strerror)
+#endif

-- 
           Summary: Improvement to getaddrinfo gai_strerror.c to make it
                    usable in gnulib
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: simon at josefsson dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/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.


             reply	other threads:[~2004-11-10 18:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 18:42 simon@josefsson.org [this message]
2004-12-03  1:50 ` [Bug libc/538] " gotom at debian dot or dot jp
2005-09-23  0:53 ` drepper at redhat dot com
2005-09-23 13:44 ` simon at josefsson dot org
2005-09-23 13:47 ` simon at josefsson dot org
2005-10-15  5:16 ` drepper at redhat dot com
2006-04-25 18:13 ` drepper at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041110184141.538.simon@josefsson.org \
    --to=sourceware-bugzilla@sources.redhat.com \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).