codecvt.hpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. // See http://www.boost.org/libs/iostreams for documentation.
  6. #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
  7. #define BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
  8. #include <boost/config.hpp>
  9. #include <boost/detail/workaround.hpp>
  10. #include <boost/iostreams/detail/config/wide_streams.hpp>
  11. #include <cstddef>
  12. #if defined(_MSC_VER)
  13. # pragma once
  14. #endif
  15. //------------------Support for codecvt with user-defined state types---------//
  16. #if defined(__MSL_CPP__) || defined(__LIBCOMO__) || \
  17. BOOST_WORKAROUND(_STLPORT_VERSION, <= 0x450) || \
  18. defined(_LIBCPP_VERSION) \
  19. /**/
  20. # define BOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION
  21. #endif
  22. #if defined(__GLIBCPP__) || defined(__GLIBCXX__) || \
  23. BOOST_WORKAROUND(_STLPORT_VERSION, > 0x450) \
  24. /**/
  25. # define BOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION
  26. #endif
  27. //------------------Check for codecvt ctor taking a reference count-----------//
  28. #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) || \
  29. BOOST_WORKAROUND(_STLPORT_VERSION, < 0x461) \
  30. /**/
  31. # define BOOST_IOSTREAMS_NO_CODECVT_CTOR_FROM_SIZE_T
  32. #endif
  33. //------------------Normalize codecvt::length---------------------------------//
  34. #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) && !defined(__clang__) && \
  35. (!defined(BOOST_RWSTD_VER) || BOOST_RWSTD_VER < 0x04010300) && \
  36. (!defined(__MACH__) || !defined(__INTEL_COMPILER))
  37. /**/
  38. # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER const
  39. #else
  40. # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER
  41. #endif
  42. //------------------Check for codecvt::max_length-----------------------------//
  43. #if BOOST_WORKAROUND(_STLPORT_VERSION, < 0x461)
  44. # define BOOST_IOSTREAMS_NO_CODECVT_MAX_LENGTH
  45. #endif
  46. //------------------Put mbstate_t and codecvt in std--------------------------//
  47. #ifndef BOOST_IOSTREAMS_NO_LOCALE
  48. # include <locale>
  49. #endif
  50. // From Robert Ramey's version of utf8_codecvt_facet.
  51. namespace std {
  52. #if defined(__LIBCOMO__)
  53. using ::mbstate_t;
  54. #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
  55. using ::mbstate_t;
  56. #elif defined(__SGI_STL_PORT)
  57. #elif defined(BOOST_NO_STDC_NAMESPACE)
  58. using ::codecvt;
  59. using ::mbstate_t;
  60. #endif
  61. } // End namespace std.
  62. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED