Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / iostreams / detail / config / codecvt.hpp
1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
2 // (C) Copyright 2003-2007 Jonathan Turkanis
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
5
6 // See http://www.boost.org/libs/iostreams for documentation.
7
8 #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
10
11 #include <boost/config.hpp>
12 #include <boost/detail/workaround.hpp>
13 #include <boost/iostreams/detail/config/wide_streams.hpp>
14 #include <cstddef>
15
16 #if defined(_MSC_VER)
17 # pragma once
18 #endif       
19
20 //------------------Support for codecvt with user-defined state types---------//
21
22 #if defined(__MSL_CPP__) || defined(__LIBCOMO__) || \
23     BOOST_WORKAROUND(_STLPORT_VERSION, <= 0x450) || \
24     defined(_LIBCPP_VERSION) \
25     /**/
26 # define BOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION
27 #endif
28
29 #if defined(__GLIBCPP__) || defined(__GLIBCXX__) || \
30     BOOST_WORKAROUND(_STLPORT_VERSION, > 0x450) \
31     /**/
32 # define BOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION
33 #endif
34
35 //------------------Check for codecvt ctor taking a reference count-----------//
36
37 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) || \
38     BOOST_WORKAROUND(_STLPORT_VERSION, < 0x461) \
39     /**/
40 # define BOOST_IOSTREAMS_NO_CODECVT_CTOR_FROM_SIZE_T
41 #endif
42
43 //------------------Normalize codecvt::length---------------------------------//
44
45 #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) && \
46     (!defined(BOOST_RWSTD_VER) || BOOST_RWSTD_VER < 0x04010300) && \
47     (!defined(__MACH__) || !defined(__INTEL_COMPILER))
48     /**/
49 # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER const
50 #else
51 # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER
52 #endif
53
54 //------------------Check for codecvt::max_length-----------------------------//
55
56 #if BOOST_WORKAROUND(_STLPORT_VERSION, < 0x461)
57 # define BOOST_IOSTREAMS_NO_CODECVT_MAX_LENGTH
58 #endif
59                     
60 //------------------Put mbstate_t and codecvt in std--------------------------//
61
62 #ifndef BOOST_IOSTREAMS_NO_LOCALE
63 # include <locale>
64 #endif
65
66 // From Robert Ramey's version of utf8_codecvt_facet.
67 namespace std { 
68
69 #if defined(__LIBCOMO__)
70     using ::mbstate_t;
71 #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
72     using ::mbstate_t;
73 #elif defined(__SGI_STL_PORT)
74 #elif defined(BOOST_NO_STDC_NAMESPACE)
75     using ::codecvt;
76     using ::mbstate_t;
77 #endif
78
79 } // End namespace std.
80
81 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED