sl@0
|
1 |
#ifndef BOOST_ARCHIVE_ADD_FACET_HPP
|
sl@0
|
2 |
#define BOOST_ARCHIVE_ADD_FACET_HPP
|
sl@0
|
3 |
|
sl@0
|
4 |
// MS compatible compilers support #pragma once
|
sl@0
|
5 |
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
sl@0
|
6 |
# pragma once
|
sl@0
|
7 |
#endif
|
sl@0
|
8 |
|
sl@0
|
9 |
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
sl@0
|
10 |
// add_facet.hpp
|
sl@0
|
11 |
|
sl@0
|
12 |
// (C) Copyright 2003 Robert Ramey - http://www.rrsd.com .
|
sl@0
|
13 |
// Use, modification and distribution is subject to the Boost Software
|
sl@0
|
14 |
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
15 |
// http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
16 |
|
sl@0
|
17 |
// See http://www.boost.org for updates, documentation, and revision history.
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <locale>
|
sl@0
|
20 |
#include <boost/config.hpp>
|
sl@0
|
21 |
#include <boost/detail/workaround.hpp>
|
sl@0
|
22 |
|
sl@0
|
23 |
// does STLport uses native STL for locales?
|
sl@0
|
24 |
#if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS))
|
sl@0
|
25 |
// and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER)
|
sl@0
|
26 |
# if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER)
|
sl@0
|
27 |
# define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
|
sl@0
|
28 |
# endif
|
sl@0
|
29 |
#endif
|
sl@0
|
30 |
|
sl@0
|
31 |
namespace boost {
|
sl@0
|
32 |
namespace archive {
|
sl@0
|
33 |
|
sl@0
|
34 |
template<class Facet>
|
sl@0
|
35 |
inline std::locale *
|
sl@0
|
36 |
add_facet(const std::locale &l, Facet * f){
|
sl@0
|
37 |
return
|
sl@0
|
38 |
#if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
|
sl@0
|
39 |
// std namespace used for native locale
|
sl@0
|
40 |
new std::locale(std::_Addfac(l, f));
|
sl@0
|
41 |
#elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar
|
sl@0
|
42 |
// std namespace used for native locale
|
sl@0
|
43 |
new std::locale(std::_Addfac(l, f));
|
sl@0
|
44 |
#else
|
sl@0
|
45 |
// standard compatible
|
sl@0
|
46 |
new std::locale(l, f);
|
sl@0
|
47 |
#endif
|
sl@0
|
48 |
}
|
sl@0
|
49 |
|
sl@0
|
50 |
} // namespace archive
|
sl@0
|
51 |
} // namespace boost
|
sl@0
|
52 |
|
sl@0
|
53 |
#undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
|
sl@0
|
54 |
|
sl@0
|
55 |
#endif // BOOST_ARCHIVE_ADD_FACET_HPP
|