From: Paul Eggert Date: Tue, 25 Sep 2001 18:17:36 +0000 (+0000) Subject: (EILSEQ): Include and if does not define X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=1ad624bbbc38cb07899152df9eafb7f5adde71b5;p=chaz%2Ftar (EILSEQ): Include and if does not define EILSEQ, because BSD/OS 4.1 defines EILSEQ in , which requires . Define a replacement EILSEQ to be ENOENT, not EINVAL, since callers may want to distinguish EINVAL and EILSEQ. --- diff --git a/lib/unicodeio.c b/lib/unicodeio.c index 37b69aa..35bb680 100644 --- a/lib/unicodeio.c +++ b/lib/unicodeio.c @@ -37,8 +37,25 @@ #ifndef errno extern int errno; #endif + +/* Define EILSEQ and ENOTSUP as portably as possible. Some + nonstandard systems, like SunOS 4, don't have EILSEQ. Others, like + BSD/OS 4.1, define it in . Callers that use EILSEQ and/or + ENOTSUP and that want to be portable to these nonstandard systems + should mimic the following includes and defines. */ + +/* BSD/OS 4.1 wchar.h defines EILSEQ, but it requires FILE (defined in + , included above) and struct tm (defined in ) to + be declared. */ +#if HAVE_WCHAR_H && ! defined EILSEQ +# include +# include +#endif + +/* Do not define EILSEQ to be EINVAL, since callers may want to + distinguish EINVAL and EILSEQ. */ #ifndef EILSEQ -# define EILSEQ EINVAL +# define EILSEQ ENOENT #endif #ifndef ENOTSUP # define ENOTSUP EINVAL