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
12#ifndef BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
13#define BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
14
15#include "boost/config.hpp"
16#include "boost/detail/workaround.hpp"
17
18// support for pre 3.0 libstdc++ - thanks Phil Edwards!
19#if defined (__STL_CONFIG_H) && !defined (__STL_USE_NEW_IOSTREAMS)
20# define BOOST_OLD_IOSTREAMS
21#endif
22
23// no-op function to workaround gcc bug c++/8419
24//
25namespace boost { namespace detail {
26 template <typename T> T make_non_const(T t) { return t; }
27}}
28
29#if defined(__GNUC__)
30# define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) \
31 (boost::detail::make_non_const(expr))
32#else
33# define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) (expr)
34#endif
35
36//
37#if (defined BOOST_BORLANDC && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))) \
38 || (defined BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
39#define BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS
40#endif
41
42// if we can't use friends then we simply expose private members
43//
44#if defined(BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS)
45#define BOOST_DYNAMIC_BITSET_PRIVATE public
46#else
47#define BOOST_DYNAMIC_BITSET_PRIVATE private
48#endif
49
50// A couple of macros to cope with libraries without locale
51// support. The first macro must be used to declare a reference
52// to a ctype facet. The second one to widen a char by using
53// that ctype object. If facets and locales aren't available
54// the first macro is a no-op and the second one just expands
55// to its parameter c.
56//
57#if defined (BOOST_USE_FACET)
58
59#define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) \
60 const std::ctype<ch> & name = \
61 BOOST_USE_FACET(std::ctype<ch>, loc) /**/
62
63#define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) \
64 (fac.widen(c))
65#else
66
67#define BOOST_DYNAMIC_BITSET_CTYPE_FACET(ch, name, loc) /**/
68#define BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, c) c
69
70#endif
71
72#endif // include guard
73

source code of include/boost/dynamic_bitset/config.hpp