libstdc++/4145: codecvt<char, char, mbstate_t>::id on solaris, others

bkoz@gcc.gnu.org bkoz@gcc.gnu.org
Fri Apr 5 11:54:00 GMT 2002


Synopsis: codecvt<char, char, mbstate_t>::id on solaris, others

Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Fri Apr  5 11:49:43 2002
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->closed
State-Changed-By: bkoz
State-Changed-When: Fri Apr  5 11:49:43 2002
State-Changed-Why:
    I don't think this is a bug in the C++ library. ISO C++ requires mbstate_t to be defined in cwchar: it's not in Solaris 2.7, __mbstate_t is. That's the heart of your problem.
    
    Note that Sun fixed their headers for Solaris 2.8:
    
    #if !defined(_MBSTATE_T) || __cplusplus >= 199711L
    #define _MBSTATE_T
    typedef __mbstate_t     mbstate_t;
    #endif  /* _MBSTATE_T */
    
    Because this type isn't defined, libstdc++ defines its own, replacement type. This, while not optimal, is acceptable.
    
    You see to want to use the native type. That's cool, but hack the Solaris wchar.h header instead of libstdc++. I believe the linkage problems you have are all of your own devising. 
    
    Note that wide character support is not turned on by default on Solaris 2.7 for precisely these reasons, so the issue is kind of moot (as codecvt<char, char, mbstate_t> is a no-op)
    
    best,
    benjamin

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4145



More information about the Gcc-bugs mailing list