1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
2 // (C) Copyright 2003-2007 Jonathan Turkanis
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
6 // See http://www.boost.org/libs/iostreams for documentation.
8 // Borrowed from <boost/archive/add_facet.hpp>
10 #ifndef BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
11 #define BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
13 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
17 #include <boost/config.hpp> // BOOST_DINKUMWARE_STDLIB.
18 #include <boost/detail/workaround.hpp>
20 //------------------Definition of add_facet-----------------------------------//
22 // Does STLport uses old Dinkumware locale?
23 #if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && \
24 defined(_STLP_NO_OWN_IOSTREAMS) \
26 # if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
27 # define BOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE
31 namespace boost
{ namespace iostreams
{ namespace detail
{
34 inline std::locale
add_facet(const std::locale
&l
, Facet
* f
)
37 #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) || \
38 defined(BOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE) \
40 std::locale(std::_Addfac(l
, f
));
42 // standard compatible
47 } } } // End namespaces detail, iostreams, boost.
49 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED