Chris@16: #ifndef BOOST_ARCHIVE_ADD_FACET_HPP Chris@16: #define BOOST_ARCHIVE_ADD_FACET_HPP Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 Chris@16: // add_facet.hpp Chris@16: Chris@16: // (C) Copyright 2003 Robert Ramey - http://www.rrsd.com . Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for updates, documentation, and revision history. Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: // does STLport uses native STL for locales? Chris@16: #if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS)) Chris@16: // and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER) Chris@16: # if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER) Chris@16: # define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: namespace archive { Chris@16: Chris@16: template Chris@16: inline std::locale * Chris@16: add_facet(const std::locale &l, Facet * f){ Chris@16: return Chris@16: #if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT Chris@16: // std namespace used for native locale Chris@16: new std::locale(std::_Addfac(l, f)); Chris@16: #elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar Chris@16: // std namespace used for native locale Chris@16: new std::locale(std::_Addfac(l, f)); Chris@16: #else Chris@16: // standard compatible Chris@16: new std::locale(l, f); Chris@16: #endif Chris@16: } Chris@16: Chris@16: } // namespace archive Chris@16: } // namespace boost Chris@16: Chris@16: #undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT Chris@16: Chris@16: #endif // BOOST_ARCHIVE_ADD_FACET_HPP