[RFA] Define EILSEQ if not defined by errno.h

Pedro Alves pedro@codesourcery.com
Sat Apr 11 19:26:00 GMT 2009


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



More information about the Gdb-patches mailing list