config_macros.hpp 3.1 KB

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