source: NonGTP/Boost/boost/format/detail/config_macros.hpp @ 857

Revision 857, 3.3 KB checked in by igarcia, 19 years ago (diff)
Line 
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(__BORLANDC__, <= 0x564) \
42   || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) )  )
43// some future __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(__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// gcc-2.95's native stringstream is not usable
53#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
54#define BOOST_FORMAT_IGNORE_STRINGSTREAM 
55#endif
56
57
58// **** Workaround for io streams, stlport and msvc.
59#ifdef BOOST_IO_NEEDS_USING_DECLARATION
60namespace boost {
61  using std::char_traits;
62  using std::basic_ostream;
63  namespace io {
64    using std::basic_ostream;
65    namespace detail {
66      using std::basic_ios;
67      using std::basic_ostream;
68    }
69  }
70#if ! defined(BOOST_NO_STD_LOCALE)
71    using std::locale;
72    namespace io {
73        using std::locale;
74        namespace detail {
75            using std::locale;
76        }
77    }
78#endif // locale
79}
80  // -end N.S. boost
81#endif // needs_using_declaration
82
83
84// ***  hide std::locale if it doesnt exist.
85// this typedef is either std::locale or int, avoids placing ifdefs everywhere
86namespace boost { namespace io { namespace detail {
87#if ! defined(BOOST_NO_STD_LOCALE)
88    typedef BOOST_IO_STD locale locale_t;
89#else
90    typedef int          locale_t;
91#endif
92} } }
93
94
95// ----------------------------------------------------------------------------
96
97#endif // BOOST_FORMAT_MACROS_DEFAULT_HPP
Note: See TracBrowser for help on using the repository browser.