config.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // -----------------------------------------------------------
  2. //
  3. // Copyright (c) 2001-2002 Chuck Allison and Jeremy Siek
  4. // Copyright (c) 2003-2006, 2008 Gennaro Prota
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // -----------------------------------------------------------
  11. #ifndef BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
  12. #define BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
  13. #include "boost/config.hpp"
  14. #include "boost/detail/workaround.hpp"
  15. // support for pre 3.0 libstdc++ - thanks Phil Edwards!
  16. #if defined (__STL_CONFIG_H) && !defined (__STL_USE_NEW_IOSTREAMS)
  17. # define BOOST_OLD_IOSTREAMS
  18. #endif
  19. // no-op function to workaround gcc bug c++/8419
  20. //
  21. namespace boost { namespace detail {
  22. template <typename T> T make_non_const(T t) { return t; }
  23. }}
  24. #if defined(__GNUC__)
  25. # define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) \
  26. (boost::detail::make_non_const(expr))
  27. #else
  28. # define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) (expr)
  29. #endif
  30. //
  31. #if (defined BOOST_BORLANDC && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))) \
  32. || (defined BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
  33. #define BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS
  34. #endif
  35. // if we can't use friends then we simply expose private members
  36. //
  37. #if defined(BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS)
  38. #define BOOST_DYNAMIC_BITSET_PRIVATE public
  39. #else
  40. #define BOOST_DYNAMIC_BITSET_PRIVATE private
  41. #endif
  42. // A couple of macros to cope with libraries without locale
  43. // support. The first macro must be used to declare a reference
  44. // to a ctype facet. The second one to widen a char by using
  45. // that ctype object. If facets and locales aren't available
  46. // the first macro is a no-op and the second one just expands
  47. // to its parameter c.
  48. //
  49. #if defined (BOOST_USE_FACET)
  50. #define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) \
  51. const std::ctype<ch> & name = \
  52. BOOST_USE_FACET(std::ctype<ch>, loc) /**/
  53. #define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) \
  54. (fac.widen(c))
  55. #else
  56. #define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) /**/
  57. #define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) c
  58. #endif
  59. #endif // include guard