williamr@4
|
1 |
// --------------------------------------------------
|
williamr@4
|
2 |
//
|
williamr@4
|
3 |
// (C) Copyright Chuck Allison and Jeremy Siek 2001 - 2002.
|
williamr@4
|
4 |
// (C) Copyright Gennaro Prota 2003 - 2004.
|
williamr@4
|
5 |
//
|
williamr@4
|
6 |
// Distributed under the Boost Software License, Version 1.0.
|
williamr@4
|
7 |
// (See accompanying file LICENSE_1_0.txt or copy at
|
williamr@4
|
8 |
// http://www.boost.org/LICENSE_1_0.txt)
|
williamr@4
|
9 |
//
|
williamr@4
|
10 |
// -----------------------------------------------------------
|
williamr@4
|
11 |
|
williamr@4
|
12 |
// See http://www.boost.org/libs/dynamic_bitset for documentation.
|
williamr@4
|
13 |
|
williamr@4
|
14 |
|
williamr@4
|
15 |
#ifndef BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
|
williamr@4
|
16 |
#define BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
|
williamr@4
|
17 |
|
williamr@4
|
18 |
#include "boost/config.hpp"
|
williamr@4
|
19 |
#include "boost/detail/workaround.hpp"
|
williamr@4
|
20 |
|
williamr@4
|
21 |
// support for pre 3.0 libstdc++ - thanks Phil Edwards!
|
williamr@4
|
22 |
#if defined (__STL_CONFIG_H) && !defined (__STL_USE_NEW_IOSTREAMS)
|
williamr@4
|
23 |
# define BOOST_OLD_IOSTREAMS
|
williamr@4
|
24 |
#endif
|
williamr@4
|
25 |
|
williamr@4
|
26 |
// this should be in the config system some day
|
williamr@4
|
27 |
// see http://lists.boost.org/MailArchives/boost/msg62291.php
|
williamr@4
|
28 |
#define BOOST_DYNAMIC_BITSET_GNUC_VERSION ( __GNUC__ * 100 * 100 \
|
williamr@4
|
29 |
+ __GNUC_MINOR__ * 100)
|
williamr@4
|
30 |
|
williamr@4
|
31 |
// workaround for gcc bug c++/8419 - gps
|
williamr@4
|
32 |
|
williamr@4
|
33 |
namespace boost { namespace detail {
|
williamr@4
|
34 |
template <typename T> T make_non_const(T t) { return t; }
|
williamr@4
|
35 |
}}
|
williamr@4
|
36 |
|
williamr@4
|
37 |
#if defined(__GNUC__) && BOOST_WORKAROUND(BOOST_DYNAMIC_BITSET_GNUC_VERSION, \
|
williamr@4
|
38 |
BOOST_TESTED_AT(30300))
|
williamr@4
|
39 |
# define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) \
|
williamr@4
|
40 |
(boost::detail::make_non_const(expr))
|
williamr@4
|
41 |
#else
|
williamr@4
|
42 |
# define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) (expr)
|
williamr@4
|
43 |
#endif
|
williamr@4
|
44 |
|
williamr@4
|
45 |
//
|
williamr@4
|
46 |
#if (defined __BORLANDC__ && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))) \
|
williamr@4
|
47 |
|| (defined BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
williamr@4
|
48 |
#define BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS
|
williamr@4
|
49 |
#endif
|
williamr@4
|
50 |
|
williamr@4
|
51 |
// if we can't use friends then private members are exposed
|
williamr@4
|
52 |
//
|
williamr@4
|
53 |
#if defined(BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS)
|
williamr@4
|
54 |
#define BOOST_DYNAMIC_BITSET_PRIVATE public
|
williamr@4
|
55 |
#else
|
williamr@4
|
56 |
#define BOOST_DYNAMIC_BITSET_PRIVATE private
|
williamr@4
|
57 |
#endif
|
williamr@4
|
58 |
|
williamr@4
|
59 |
// A couple of macros to cope with libraries without locale
|
williamr@4
|
60 |
// support. The first macro must be used to declare a reference
|
williamr@4
|
61 |
// to a ctype facet. The second one to widen a char by using
|
williamr@4
|
62 |
// that ctype object. If facets and locales aren't available
|
williamr@4
|
63 |
// the first macro is a no-op and the second one just expands
|
williamr@4
|
64 |
// to its parameter c.
|
williamr@4
|
65 |
//
|
williamr@4
|
66 |
#if defined (BOOST_USE_FACET)
|
williamr@4
|
67 |
|
williamr@4
|
68 |
#define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) \
|
williamr@4
|
69 |
const std::ctype<ch> & name = \
|
williamr@4
|
70 |
BOOST_USE_FACET(std::ctype<ch>, loc) /**/
|
williamr@4
|
71 |
|
williamr@4
|
72 |
#define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) \
|
williamr@4
|
73 |
(fac.widen(c))
|
williamr@4
|
74 |
#else
|
williamr@4
|
75 |
|
williamr@4
|
76 |
#define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) /**/
|
williamr@4
|
77 |
#define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) c
|
williamr@4
|
78 |
|
williamr@4
|
79 |
#endif
|
williamr@4
|
80 |
|
williamr@4
|
81 |
#endif // include guard
|