codecvt.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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) && (_MSC_VER >= 1020)
  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. /**/
  19. # define BOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION
  20. #endif
  21. #if defined(__GLIBCPP__) || defined(__GLIBCXX__) || \
  22. BOOST_WORKAROUND(_STLPORT_VERSION, > 0x450) \
  23. /**/
  24. # define BOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION
  25. #endif
  26. //------------------Check for codecvt ctor taking a reference count-----------//
  27. #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) || \
  28. BOOST_WORKAROUND(_STLPORT_VERSION, < 0x461) \
  29. /**/
  30. # define BOOST_IOSTREAMS_NO_CODECVT_CTOR_FROM_SIZE_T
  31. #endif
  32. //------------------Normalize codecvt::length---------------------------------//
  33. #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) && \
  34. (!defined(BOOST_RWSTD_VER) || BOOST_RWSTD_VER < 0x04010300) && \
  35. (!defined(__MACH__) || !defined(__INTEL_COMPILER))
  36. /**/
  37. # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER const
  38. #else
  39. # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER
  40. #endif
  41. //------------------Check for codecvt::max_length-----------------------------//
  42. #if BOOST_WORKAROUND(_STLPORT_VERSION, < 0x461)
  43. # define BOOST_IOSTREAMS_NO_CODECVT_MAX_LENGTH
  44. #endif
  45. //------------------Put mbstate_t and codecvt in std--------------------------//
  46. #ifndef BOOST_IOSTREAMS_NO_LOCALE
  47. # include <locale>
  48. #endif
  49. // From Robert Ramey's version of utf8_codecvt_facet.
  50. namespace std {
  51. #if defined(__LIBCOMO__)
  52. using ::mbstate_t;
  53. #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
  54. using ::mbstate_t;
  55. #elif defined(__SGI_STL_PORT)
  56. #elif defined(BOOST_NO_STDC_NAMESPACE)
  57. using ::codecvt;
  58. using ::mbstate_t;
  59. #endif
  60. } // End namespace std.
  61. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED