incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: Boost + stdcxx (status)
Date Tue, 20 Mar 2007 15:35:14 GMT
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Tuesday, March 20, 2007 6:23 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: Boost + stdcxx (status)
> 
> Farid Zaripov wrote:
> > Hi All.
> > 
> >   I have been working on adding support of the stdcxx 
> library to the 
> > boost build system.
> > I have created the .jam files to build boost library with 
> stdcxx using 
> > MSVC 7.1 and 8.0.
> > There are some errors during build process.
> > 
> >   The mostly error is: error C2039: 'mbstate_t' : is not a 
> member of 
> > 'std'. And the same error, but with ptrdiff_t instead of mbstate_t.
> > 
> >   I will check where the problem is.
> 
> I suspect the problem is with Boost code making the common 
> but incorrect assumption about which headers the C types are 
> defined in. They are only required to be defined in the 
> following headers:
> 
>    mbstate_t: <cwchar>
>    ptrdiff_t: <cstddef>
>    size_t: <cstddef>, <cstdio>, <cstdlib>, <cstring>, <ctime>
> 
> (in addition to their traditional .c counterparts). While 
> most other implementations #include many of these headers in 
> most others, stdcxx conforms strictly to these requirements 
> in order not to pollute the user namespace with additional symbols.

  You're right. For example the file utf8_codecvt_facet.hpp:

#include <locale>
// for mbstate_t
#include <wchar.h>
// for std::size_t
#include <cstddef>

#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>

namespace std {
    #if defined(__LIBCOMO__)
        using ::mbstate_t;
    #elif defined(BOOST_DINKUMWARE_STDLIB)
        using ::mbstate_t;
    #elif defined(__SGI_STL_PORT)
    #elif defined(BOOST_NO_STDC_NAMESPACE)
        using ::mbstate_t;
        using ::codecvt;
    #endif
} // namespace std

[...]

struct BOOST_UTF8_DECL utf8_codecvt_facet :
    public std::codecvt<wchar_t, char, std::mbstate_t>  
{

[...]


  Here #included wchar.h header file and then mbstate_t introduced into
namespace std for some implementations.

Farid.

Mime
View raw message