This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: mbstate_t and EOF in sys/_types.h for Cygwin.
- From: Thomas Fitzsimmons <thomas dot fitzsimmons at utoronto dot ca>
- To: Kazuhiro Fujieda <fujieda at jaist dot ac dot jp>
- Cc: newlib at sources dot redhat dot com
- Date: 16 Sep 2002 12:03:16 -0400
- Subject: Re: mbstate_t and EOF in sys/_types.h for Cygwin.
- References: <s1sznuim2un.fsf@jaist.ac.jp>
On Mon, 2002-09-16 at 10:22, Kazuhiro Fujieda wrote:
> Why are mbstate_t and EOF defined as the following in
> sys/_types.h for only Cygwin?
>
> #ifdef __CYGWIN__
> # ifndef MBSTATE_T
> # define MBSTATE_T
> typedef _mbstate_t mbstate_t;
> # endif /* MBSTATE_T */
> # define WEOF (0xffffffffu)
> #endif /* __CYGWIN__ */
>
> `mbstate_t' and WEOF are standardized in ISO C. I can't
> understand why such standard definitions are defined in
> sys/_types.h.
>
This was done as a temporary hack to get around build conflicts arising
from the fact that cygwin provides its own wchar.h.
Now that newlib provides a wchar.h, cygwin should use it, and a
sys/wchar.h within newlib for its specific wchar requirements.
Tom
> BTW, MBSTATE_T is a incorrect macro name. ISO C requires
> implementation-specific macro names to begin with a underscore.
> ____
> | AIST Kazuhiro Fujieda <fujieda@jaist.ac.jp>
> | HOKURIKU Center for Information Science
> o_/ 1990 Japan Advanced Institute of Science and Technology
>