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