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