mbstate_t and EOF in sys/_types.h for Cygwin.

Thomas Fitzsimmons thomas.fitzsimmons@utoronto.ca
Mon Sep 16 09:03:00 GMT 2002


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
> 




More information about the Newlib mailing list