[libstdc++] Don't access fpos_t.__state on uClibc w/o wchar support

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Sep 22 20:13:00 GMT 2003


Bernardo Innocenti <bernie@develer.com> writes:

| Gabriel Dos Reis wrote:
| > Bernardo Innocenti <bernie@develer.com> writes:
| > | Don't access __state member of fpos_t when building on uClibc with
| > | wchar support disabled.
| > |  +#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__)
| > Why can't you use the standard idiom
| >   #if _GLIBCXX_USE_WCHAR_T
| > ?
| 
| You're most probably right. I'm not sure what specific feature
| I need to check for.
| 
| On uClibc, the fpos_t structure has an __mbstate member only
| if __STDIO_MBSTATE is defined, which in turn depends on
| __STDIO_WIDE, which depends on __UCLIBC_HAS_WCHAR__.
| 
| glibc always has the __state member in fpos_t regardless of
| the configuration.
| 
| In my configuration I use neither wchar nor mbstate support,
| so it's fine for me to use _GLIBCXX_USE_WCHAR_T, but is that
| really appropriate?

yes please.  see comment in acconfig.h

-- Gaby



More information about the Gcc-patches mailing list