Chris@16: // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) Chris@16: // (C) Copyright 2003-2007 Jonathan Turkanis Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) Chris@16: Chris@16: // See http://www.boost.org/libs/iostreams for documentation. Chris@16: Chris@16: // Borrowed from Chris@16: Chris@16: #ifndef BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED Chris@16: #define BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1020) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: #include // BOOST_DINKUMWARE_STDLIB. Chris@16: #include Chris@16: Chris@16: //------------------Definition of add_facet-----------------------------------// Chris@16: Chris@16: // Does STLport uses old Dinkumware locale? Chris@16: #if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && \ Chris@16: defined(_STLP_NO_OWN_IOSTREAMS) \ Chris@16: /**/ Chris@16: # if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) Chris@16: # define BOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: namespace boost { namespace iostreams { namespace detail { Chris@16: Chris@16: template Chris@16: inline std::locale add_facet(const std::locale &l, Facet * f) Chris@16: { Chris@16: return Chris@16: #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) || \ Chris@16: defined(BOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE) \ Chris@16: /**/ Chris@16: std::locale(std::_Addfac(l, f)); Chris@16: #else Chris@16: // standard compatible Chris@16: std::locale(l, f); Chris@16: #endif Chris@16: } Chris@16: Chris@16: } } } // End namespaces detail, iostreams, boost. Chris@16: Chris@16: #endif // #ifndef BOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED