Chris@16: // -*- C++ -*- Chris@16: // ---------------------------------------------------------------------------- Chris@16: // config_macros.hpp : configuration macros for the format library Chris@16: // only BOOST_IO_STD is absolutely needed (it should be 'std::' in general) Chris@16: // others are compiler-specific workaround macros used in #ifdef switches Chris@16: // ---------------------------------------------------------------------------- Chris@16: Chris@16: // Copyright Samuel Krempp 2003. Use, modification, and distribution are Chris@16: // subject to the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // see http://www.boost.org/libs/format for library home page Chris@16: Chris@16: Chris@16: // ---------------------------------------------------------------------------- Chris@16: Chris@16: #ifndef BOOST_FORMAT_CONFIG_MACROS_HPP Chris@16: #define BOOST_FORMAT_CONFIG_MACROS_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: // make sure our local macros wont override something : Chris@16: #if defined(BOOST_NO_LOCALE_ISDIGIT) || defined(BOOST_OVERLOAD_FOR_NON_CONST) \ Chris@16: || defined(BOOST_IO_STD) || defined( BOOST_IO_NEEDS_USING_DECLARATION ) \ Chris@16: || defined(BOOST_NO_TEMPLATE_STD_STREAM) \ Chris@16: || defined(BOOST_FORMAT_STREAMBUF_DEFINED) || defined(BOOST_FORMAT_OSTREAM_DEFINED) Chris@16: #error "boost::format uses a local macro that is already defined." Chris@16: #endif Chris@16: Chris@16: // specific workarounds. each header can define BOOS_IO_STD if it Chris@16: // needs. (e.g. because of IO_NEEDS_USING_DECLARATION) Chris@16: #include Chris@16: #include Chris@16: Chris@16: #ifndef BOOST_IO_STD Chris@16: # define BOOST_IO_STD ::std:: Chris@16: #endif Chris@16: Chris@16: #if defined(BOOST_NO_STD_LOCALE) || \ Chris@16: ( BOOST_WORKAROUND(__BORLANDC__, <= 0x564) \ Chris@16: || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) ) Chris@16: // some future __BORLANDC__ >0x564 versions might not need this Chris@16: // 0x570 is Borland's kylix branch Chris@16: #define BOOST_NO_LOCALE_ISDIGIT Chris@16: #endif Chris@16: Chris@16: #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) ) || BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1300)) Chris@16: #define BOOST_NO_OVERLOAD_FOR_NON_CONST Chris@16: #endif Chris@16: Chris@16: // **** Workaround for io streams, stlport and msvc. Chris@16: #ifdef BOOST_IO_NEEDS_USING_DECLARATION Chris@16: namespace boost { Chris@16: using std::char_traits; Chris@16: using std::basic_ostream; Chris@16: namespace io { Chris@16: using std::basic_ostream; Chris@16: namespace detail { Chris@16: using std::basic_ios; Chris@16: using std::basic_ostream; Chris@16: } Chris@16: } Chris@16: #if ! defined(BOOST_NO_STD_LOCALE) Chris@16: using std::locale; Chris@16: namespace io { Chris@16: using std::locale; Chris@16: namespace detail { Chris@16: using std::locale; Chris@16: } Chris@16: } Chris@16: #endif // locale Chris@16: } Chris@16: // -end N.S. boost Chris@16: #endif // needs_using_declaration Chris@16: Chris@101: #if ! defined(BOOST_NO_STD_LOCALE) Chris@101: #include Chris@101: #endif Chris@101: Chris@16: Chris@16: // *** hide std::locale if it doesnt exist. Chris@16: // this typedef is either std::locale or int, avoids placing ifdefs everywhere Chris@16: namespace boost { namespace io { namespace detail { Chris@16: #if ! defined(BOOST_NO_STD_LOCALE) Chris@16: typedef BOOST_IO_STD locale locale_t; Chris@16: #else Chris@16: typedef int locale_t; Chris@16: #endif Chris@16: } } } Chris@16: Chris@16: Chris@16: // ---------------------------------------------------------------------------- Chris@16: Chris@16: #endif // BOOST_FORMAT_MACROS_DEFAULT_HPP