Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Define EILSEQ if not defined by errno.h
@ 2009-04-11 19:05 Eli Zaretskii
  2009-04-11 19:26 ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2009-04-11 19:05 UTC (permalink / raw)
  To: gdb-patches

Any objections to the following patch?  DJGPP doesn't have EILSEQ
defined in its errno.h.


2009-04-11  Eli Zaretskii  <eliz@gnu.org>

	* charset.c (EILSEQ): Define if not defined by errno.h.

Index: gdb/charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.19
diff -u -r1.19 charset.c
--- gdb/charset.c	25 Mar 2009 00:58:34 -0000	1.19
+++ gdb/charset.c	11 Apr 2009 19:03:08 -0000
@@ -89,6 +89,12 @@
 #undef ICONV_CONST
 #define ICONV_CONST const
 
+/* Some systems, don't have EILSEQ.  But don't define it as EINVAL,
+   because callers of `iconv' want to distinguish EINVAL and EILSEQ.  */
+#ifndef EILSEQ
+#define EILSEQ ENOENT
+#endif
+
 iconv_t
 iconv_open (const char *to, const char *from)
 {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] Define EILSEQ if not defined by errno.h
  2009-04-11 19:05 [RFA] Define EILSEQ if not defined by errno.h Eli Zaretskii
@ 2009-04-11 19:26 ` Pedro Alves
  2009-04-11 21:27   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2009-04-11 19:26 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii

On Saturday 11 April 2009 20:05:26, Eli Zaretskii wrote:
> Any objections to the following patch?  DJGPP doesn't have EILSEQ
> defined in its errno.h.

No objections.  AFAICS, this is what gnu libiconv does.  EILSEQ can
also be defined in wchar.h, so as long as this is done after
including wchar.h, it is fine.

My first question when I read this, was if you had chosen ENOENT as
an arbitrary choice, and I was curious with what was libiconv doing
--- which made me have to go grep libiconv sources.

IMO, a comment mentioning that this is what GNU iconv does
would be good to spare such doubts for whoever reads this.

> 
> 
> 2009-04-11  Eli Zaretskii  <eliz@gnu.org>
> 
> 	* charset.c (EILSEQ): Define if not defined by errno.h.
> 
> Index: gdb/charset.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/charset.c,v
> retrieving revision 1.19
> diff -u -r1.19 charset.c
> --- gdb/charset.c	25 Mar 2009 00:58:34 -0000	1.19
> +++ gdb/charset.c	11 Apr 2009 19:03:08 -0000
> @@ -89,6 +89,12 @@
>  #undef ICONV_CONST
>  #define ICONV_CONST const
>  
> +/* Some systems, don't have EILSEQ.  But don't define it as EINVAL,
> +   because callers of `iconv' want to distinguish EINVAL and EILSEQ.  */
> +#ifndef EILSEQ
> +#define EILSEQ ENOENT
> +#endif
> +
>  iconv_t
>  iconv_open (const char *to, const char *from)
>  {
> 



-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] Define EILSEQ if not defined by errno.h
  2009-04-11 19:26 ` Pedro Alves
@ 2009-04-11 21:27   ` Eli Zaretskii
  2009-04-13 16:54     ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2009-04-11 21:27 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sat, 11 Apr 2009 20:26:46 +0100
> 
> On Saturday 11 April 2009 20:05:26, Eli Zaretskii wrote:
> > Any objections to the following patch?  DJGPP doesn't have EILSEQ
> > defined in its errno.h.
> 
> No objections.

Thanks.

I'd like to hear Tom's opinion as well.  Tom?

> IMO, a comment mentioning that this is what GNU iconv does
> would be good to spare such doubts for whoever reads this.

Will do, thanks for pointing this out.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] Define EILSEQ if not defined by errno.h
  2009-04-11 21:27   ` Eli Zaretskii
@ 2009-04-13 16:54     ` Tom Tromey
  2009-04-13 18:52       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2009-04-13 16:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Pedro Alves, gdb-patches

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> I'd like to hear Tom's opinion as well.  Tom?

I agree with all of Pedro's comments.

Tom


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] Define EILSEQ if not defined by errno.h
  2009-04-13 16:54     ` Tom Tromey
@ 2009-04-13 18:52       ` Eli Zaretskii
  2009-04-13 18:58         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2009-04-13 18:52 UTC (permalink / raw)
  To: tromey; +Cc: pedro, gdb-patches

> Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
> From: Tom Tromey <tromey@redhat.com>
> Date: Mon, 13 Apr 2009 10:52:30 -0600
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> 
> Eli> I'd like to hear Tom's opinion as well.  Tom?
> 
> I agree with all of Pedro's comments.

Thanks.  Here's what I actually committed:


2009-04-13  Eli Zaretskii  <eliz@gnu.org>

	* charset.c (EILSEQ): Define if not defined by system headers.

Index: gdb/charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.19
diff -u -r1.19 charset.c
--- gdb/charset.c	25 Mar 2009 00:58:34 -0000	1.19
+++ gdb/charset.c	13 Apr 2009 18:48:45 -0000
@@ -89,6 +89,15 @@
 #undef ICONV_CONST
 #define ICONV_CONST const
 
+/* Some systems, don't have EILSEQ, so we define it here, but not as
+   EINVAL, because callers of `iconv' want to distinguish EINVAL and
+   EILSEQ.  This is what iconv.h from libiconv does as well.  Note
+   that wchar.h may also define EILSEQ, so this needs to be after we
+   include wchar.h, which happens in defs.h through gdb_wchar.h.  */
+#ifndef EILSEQ
+#define EILSEQ ENOENT
+#endif
+
 iconv_t
 iconv_open (const char *to, const char *from)
 {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA] Define EILSEQ if not defined by errno.h
  2009-04-13 18:52       ` Eli Zaretskii
@ 2009-04-13 18:58         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2009-04-13 18:58 UTC (permalink / raw)
  To: tromey, pedro, gdb-patches

> Date: Mon, 13 Apr 2009 21:51:56 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: pedro@codesourcery.com, gdb-patches@sourceware.org
> 
> +/* Some systems, don't have EILSEQ, so we define it here, but not as
                  ^
I fixed this typo in a subsequent commit.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-13 18:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-11 19:05 [RFA] Define EILSEQ if not defined by errno.h Eli Zaretskii
2009-04-11 19:26 ` Pedro Alves
2009-04-11 21:27   ` Eli Zaretskii
2009-04-13 16:54     ` Tom Tromey
2009-04-13 18:52       ` Eli Zaretskii
2009-04-13 18:58         ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox