1 // --------------------------------------------------
3 // (C) Copyright Chuck Allison and Jeremy Siek 2001 - 2002.
4 // (C) Copyright Gennaro Prota 2003 - 2004.
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)
10 // -----------------------------------------------------------
12 // See http://www.boost.org/libs/dynamic_bitset for documentation.
15 #ifndef BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
16 #define BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
18 #include "boost/config.hpp"
19 #include "boost/detail/workaround.hpp"
21 // support for pre 3.0 libstdc++ - thanks Phil Edwards!
22 #if defined (__STL_CONFIG_H) && !defined (__STL_USE_NEW_IOSTREAMS)
23 # define BOOST_OLD_IOSTREAMS
26 // this should be in the config system some day
27 // see http://lists.boost.org/MailArchives/boost/msg62291.php
28 #define BOOST_DYNAMIC_BITSET_GNUC_VERSION ( __GNUC__ * 100 * 100 \
29 + __GNUC_MINOR__ * 100)
31 // workaround for gcc bug c++/8419 - gps
33 namespace boost { namespace detail {
34 template <typename T> T make_non_const(T t) { return t; }
37 #if defined(__GNUC__) && BOOST_WORKAROUND(BOOST_DYNAMIC_BITSET_GNUC_VERSION, \
38 BOOST_TESTED_AT(30300))
39 # define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) \
40 (boost::detail::make_non_const(expr))
42 # define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) (expr)
46 #if (defined __BORLANDC__ && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))) \
47 || (defined BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
48 #define BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS
51 // if we can't use friends then private members are exposed
53 #if defined(BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS)
54 #define BOOST_DYNAMIC_BITSET_PRIVATE public
56 #define BOOST_DYNAMIC_BITSET_PRIVATE private
59 // A couple of macros to cope with libraries without locale
60 // support. The first macro must be used to declare a reference
61 // to a ctype facet. The second one to widen a char by using
62 // that ctype object. If facets and locales aren't available
63 // the first macro is a no-op and the second one just expands
64 // to its parameter c.
66 #if defined (BOOST_USE_FACET)
68 #define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) \
69 const std::ctype<ch> & name = \
70 BOOST_USE_FACET(std::ctype<ch>, loc) /**/
72 #define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) \
76 #define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) /**/
77 #define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) c
81 #endif // include guard