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 // ----------------------------------------------------------------------------
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)
12 // see http://www.boost.org/libs/format for library home page
15 // ----------------------------------------------------------------------------
17 #ifndef BOOST_FORMAT_CONFIG_MACROS_HPP
18 #define BOOST_FORMAT_CONFIG_MACROS_HPP
20 #include <boost/config.hpp>
21 #include <boost/detail/workaround.hpp>
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."
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>
37 # define BOOST_IO_STD ::std::
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
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
52 // **** Workaround for io streams, stlport and msvc.
53 #ifdef BOOST_IO_NEEDS_USING_DECLARATION
55 using std::char_traits;
56 using std::basic_ostream;
58 using std::basic_ostream;
61 using std::basic_ostream;
64 #if ! defined(BOOST_NO_STD_LOCALE)
75 #endif // needs_using_declaration
77 #if ! defined(BOOST_NO_STD_LOCALE)
82 // *** hide std::locale if it doesnt exist.
83 // this typedef is either std::locale or int, avoids placing ifdefs everywhere
84 namespace boost { namespace io { namespace detail {
85 #if ! defined(BOOST_NO_STD_LOCALE)
86 typedef BOOST_IO_STD locale locale_t;
93 // ----------------------------------------------------------------------------
95 #endif // BOOST_FORMAT_MACROS_DEFAULT_HPP