Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:49

0001 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
0002 // (C) Copyright 2003-2007 Jonathan Turkanis
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
0005 
0006 // See http://www.boost.org/libs/iostreams for documentation.
0007 
0008 // Borrowed from <boost/archive/add_facet.hpp>
0009 
0010 #ifndef BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
0011 #define BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
0012 
0013 #if defined(_MSC_VER)
0014 # pragma once
0015 #endif
0016 
0017 #include <boost/config.hpp>  // BOOST_DINKUMWARE_STDLIB.
0018 #include <boost/detail/workaround.hpp>
0019 
0020 //------------------Definition of add_facet-----------------------------------//
0021 
0022 // Does STLport uses old Dinkumware locale?
0023 #if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && \
0024     defined(_STLP_NO_OWN_IOSTREAMS) \
0025     /**/
0026 #  if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
0027 #    define BOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE
0028 #  endif
0029 #endif
0030 
0031 namespace boost { namespace iostreams { namespace detail {
0032 
0033 template<class Facet>
0034 inline std::locale add_facet(const std::locale &l, Facet * f)
0035 {
0036     return
0037         #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) || \
0038             defined(BOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE) \
0039             /**/
0040             std::locale(std::_Addfac(l, f));
0041         #else
0042             // standard compatible
0043             std::locale(l, f);
0044         #endif
0045 }
0046 
0047 } } } // End namespaces detail, iostreams, boost.
0048 
0049 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED