1// -*- C++ -*-
2// ----------------------------------------------------------------------------
3// config_macros.hpp : configuration macros for the format library
4// only BOOST_IO_STD is absolutely needed (it should be 'std::' in general)
5// others are compiler-specific workaround macros used in #ifdef switches
6// ----------------------------------------------------------------------------
7
8// Copyright Samuel Krempp 2003. Use, modification, and distribution are
9// subject to the Boost Software License, Version 1.0. (See accompanying
10// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11
12// see http://www.boost.org/libs/format for library home page
13
14
15// ----------------------------------------------------------------------------
16
17#ifndef BOOST_FORMAT_CONFIG_MACROS_HPP
18#define BOOST_FORMAT_CONFIG_MACROS_HPP
19
20#include <boost/config.hpp>
21#include <boost/detail/workaround.hpp>
22
23// make sure our local macros wont override something :
24#if defined(BOOST_NO_LOCALE_ISDIGIT) || defined(BOOST_OVERLOAD_FOR_NON_CONST) \
25 || defined(BOOST_IO_STD) || defined( BOOST_IO_NEEDS_USING_DECLARATION ) \
26 || defined(BOOST_NO_TEMPLATE_STD_STREAM) \
27 || defined(BOOST_FORMAT_STREAMBUF_DEFINED) || defined(BOOST_FORMAT_OSTREAM_DEFINED)
28#error "boost::format uses a local macro that is already defined."
29#endif
30
31// specific workarounds. each header can define BOOS_IO_STD if it
32// needs. (e.g. because of IO_NEEDS_USING_DECLARATION)
33#include <boost/format/detail/workarounds_gcc-2_95.hpp>
34#include <boost/format/detail/workarounds_stlport.hpp>
35
36#ifndef BOOST_IO_STD
37# define BOOST_IO_STD ::std::
38#endif
39
40#if defined(BOOST_NO_STD_LOCALE) || \
41 ( BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x564) \
42 || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT( 0x570 ) ) )
43// some future BOOST_BORLANDC >0x564 versions might not need this
44// 0x570 is Borland's kylix branch
45#define BOOST_NO_LOCALE_ISDIGIT
46#endif
47
48#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570) ) || BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1300))
49#define BOOST_NO_OVERLOAD_FOR_NON_CONST
50#endif
51
52// **** Workaround for io streams, stlport and msvc.
53#ifdef BOOST_IO_NEEDS_USING_DECLARATION
54namespace boost {
55 using std::char_traits;
56 using std::basic_ostream;
57 namespace io {
58 using std::basic_ostream;
59 namespace detail {
60 using std::basic_ios;
61 using std::basic_ostream;
62 }
63 }
64#if ! defined(BOOST_NO_STD_LOCALE)
65 using std::locale;
66 namespace io {
67 using std::locale;
68 namespace detail {
69 using std::locale;
70 }
71 }
72#endif // locale
73}
74 // -end N.S. boost
75#endif // needs_using_declaration
76
77#if ! defined(BOOST_NO_STD_LOCALE)
78#include <locale>
79#endif
80
81
82// *** hide std::locale if it doesnt exist.
83// this typedef is either std::locale or int, avoids placing ifdefs everywhere
84namespace boost { namespace io { namespace detail {
85#if ! defined(BOOST_NO_STD_LOCALE)
86 typedef BOOST_IO_STD locale locale_t;
87#else
88 typedef int locale_t;
89#endif
90} } }
91
92
93// ----------------------------------------------------------------------------
94
95#endif // BOOST_FORMAT_MACROS_DEFAULT_HPP
96

source code of include/boost/format/detail/config_macros.hpp