epoc32/include/stdapis/boost/config/stdlib/stlport.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
//  (C) Copyright John Maddock 2001 - 2002. 
williamr@2
     2
//  (C) Copyright Darin Adler 2001. 
williamr@2
     3
//  (C) Copyright Jens Maurer 2001. 
williamr@2
     4
//  Use, modification and distribution are subject to the 
williamr@2
     5
//  Boost Software License, Version 1.0. (See accompanying file 
williamr@2
     6
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
williamr@2
     7
williamr@2
     8
//  See http://www.boost.org for most recent version.
williamr@2
     9
williamr@2
    10
//  STLPort standard library config:
williamr@2
    11
williamr@2
    12
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
williamr@2
    13
#  include <boost/config/no_tr1/utility.hpp>
williamr@2
    14
#  if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
williamr@2
    15
#      error "This is not STLPort!"
williamr@2
    16
#  endif
williamr@2
    17
#endif
williamr@2
    18
williamr@2
    19
//
williamr@2
    20
// __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
williamr@2
    21
// for versions prior to 4.1(beta)
williamr@2
    22
//
williamr@2
    23
#if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400)
williamr@2
    24
#  define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
williamr@2
    25
#endif
williamr@2
    26
williamr@2
    27
//
williamr@2
    28
// If STLport thinks that there is no partial specialisation, then there is no
williamr@2
    29
// std::iterator traits:
williamr@2
    30
//
williamr@2
    31
#if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION))
williamr@2
    32
#  define BOOST_NO_STD_ITERATOR_TRAITS
williamr@2
    33
#endif
williamr@2
    34
williamr@2
    35
//
williamr@2
    36
// No new style iostreams on GCC without STLport's iostreams enabled:
williamr@2
    37
//
williamr@2
    38
#if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS))
williamr@2
    39
#  define BOOST_NO_STRINGSTREAM
williamr@2
    40
#endif
williamr@2
    41
williamr@2
    42
//
williamr@2
    43
// No new iostreams implies no std::locale, and no std::stringstream:
williamr@2
    44
//
williamr@2
    45
#if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS)
williamr@2
    46
#  define BOOST_NO_STD_LOCALE
williamr@2
    47
#  define BOOST_NO_STRINGSTREAM
williamr@2
    48
#endif
williamr@2
    49
williamr@2
    50
//
williamr@2
    51
// If the streams are not native, and we have a "using ::x" compiler bug
williamr@2
    52
// then the io stream facets are not available in namespace std::
williamr@2
    53
//
williamr@2
    54
#ifdef _STLPORT_VERSION
williamr@2
    55
#  if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
williamr@2
    56
#     define BOOST_NO_STD_LOCALE
williamr@2
    57
#  endif
williamr@2
    58
#else
williamr@2
    59
#  if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
williamr@2
    60
#     define BOOST_NO_STD_LOCALE
williamr@2
    61
#  endif
williamr@2
    62
#endif
williamr@2
    63
williamr@2
    64
//
williamr@2
    65
// Without member template support enabled, their are no template
williamr@2
    66
// iterate constructors, and no std::allocator:
williamr@2
    67
//
williamr@2
    68
#if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES))
williamr@2
    69
#  define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
williamr@2
    70
#  define BOOST_NO_STD_ALLOCATOR
williamr@2
    71
#endif
williamr@2
    72
//
williamr@2
    73
// however we always have at least a partial allocator:
williamr@2
    74
//
williamr@2
    75
#define BOOST_HAS_PARTIAL_STD_ALLOCATOR
williamr@2
    76
williamr@2
    77
#if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
williamr@2
    78
#  define BOOST_NO_STD_ALLOCATOR
williamr@2
    79
#endif
williamr@2
    80
williamr@2
    81
#if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
williamr@2
    82
#  define BOOST_NO_STD_ALLOCATOR
williamr@2
    83
#endif
williamr@2
    84
williamr@2
    85
//
williamr@2
    86
// If STLport thinks there is no wchar_t at all, then we have to disable
williamr@2
    87
// the support for the relevant specilazations of std:: templates.
williamr@2
    88
//
williamr@2
    89
#if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT)
williamr@2
    90
#  ifndef  BOOST_NO_STD_WSTRING
williamr@2
    91
#     define BOOST_NO_STD_WSTRING
williamr@2
    92
#  endif
williamr@2
    93
#  ifndef  BOOST_NO_STD_WSTREAMBUF
williamr@2
    94
#     define BOOST_NO_STD_WSTREAMBUF
williamr@2
    95
#  endif
williamr@2
    96
#endif
williamr@2
    97
williamr@2
    98
//
williamr@2
    99
// We always have SGI style hash_set, hash_map, and slist:
williamr@2
   100
//
williamr@2
   101
#define BOOST_HAS_HASH
williamr@2
   102
#define BOOST_HAS_SLIST
williamr@2
   103
williamr@2
   104
//
williamr@2
   105
// STLport does a good job of importing names into namespace std::,
williamr@2
   106
// but doesn't always get them all, define BOOST_NO_STDC_NAMESPACE, since our
williamr@2
   107
// workaround does not conflict with STLports:
williamr@2
   108
//
williamr@2
   109
//
williamr@2
   110
// Harold Howe says:
williamr@2
   111
// Borland switched to STLport in BCB6. Defining BOOST_NO_STDC_NAMESPACE with
williamr@2
   112
// BCB6 does cause problems. If we detect C++ Builder, then don't define 
williamr@2
   113
// BOOST_NO_STDC_NAMESPACE
williamr@2
   114
//
williamr@2
   115
#if !defined(__BORLANDC__) && !defined(__DMC__)
williamr@2
   116
//
williamr@2
   117
// If STLport is using it's own namespace, and the real names are in
williamr@2
   118
// the global namespace, then we duplicate STLport's using declarations
williamr@2
   119
// (by defining BOOST_NO_STDC_NAMESPACE), we do this because STLport doesn't
williamr@2
   120
// necessarily import all the names we need into namespace std::
williamr@2
   121
// 
williamr@2
   122
#  if (defined(__STL_IMPORT_VENDOR_CSTD) \
williamr@2
   123
         || defined(__STL_USE_OWN_NAMESPACE) \
williamr@2
   124
         || defined(_STLP_IMPORT_VENDOR_CSTD) \
williamr@2
   125
         || defined(_STLP_USE_OWN_NAMESPACE)) \
williamr@2
   126
      && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD))
williamr@2
   127
#     define BOOST_NO_STDC_NAMESPACE
williamr@2
   128
#     define BOOST_NO_EXCEPTION_STD_NAMESPACE
williamr@2
   129
#  endif
williamr@2
   130
#elif defined(__BORLANDC__) && __BORLANDC__ < 0x560
williamr@2
   131
// STLport doesn't import std::abs correctly:
williamr@2
   132
#include <stdlib.h>
williamr@2
   133
namespace std { using ::abs; }
williamr@2
   134
// and strcmp/strcpy don't get imported either ('cos they are macros)
williamr@2
   135
#include <string.h>
williamr@2
   136
#ifdef strcpy
williamr@2
   137
#  undef strcpy
williamr@2
   138
#endif
williamr@2
   139
#ifdef strcmp
williamr@2
   140
#  undef strcmp
williamr@2
   141
#endif
williamr@2
   142
#ifdef _STLP_VENDOR_CSTD
williamr@2
   143
namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; }
williamr@2
   144
#endif
williamr@2
   145
#endif
williamr@2
   146
williamr@2
   147
//
williamr@2
   148
// std::use_facet may be non-standard, uses a class instead:
williamr@2
   149
//
williamr@2
   150
#if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)
williamr@2
   151
#  define BOOST_NO_STD_USE_FACET
williamr@2
   152
#  define BOOST_HAS_STLP_USE_FACET
williamr@2
   153
#endif
williamr@2
   154
williamr@2
   155
//
williamr@2
   156
// If STLport thinks there are no wide functions, <cwchar> etc. is not working; but
williamr@2
   157
// only if BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import 
williamr@2
   158
// into std:: ourselves).
williamr@2
   159
//
williamr@2
   160
#if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE)
williamr@2
   161
#  define BOOST_NO_CWCHAR
williamr@2
   162
#  define BOOST_NO_CWCTYPE
williamr@2
   163
#endif
williamr@2
   164
williamr@2
   165
//
williamr@2
   166
// If STLport for some reason was configured so that it thinks that wchar_t
williamr@2
   167
// is not an intrinsic type, then we have to disable the support for it as
williamr@2
   168
// well (we would be missing required specializations otherwise).
williamr@2
   169
//
williamr@2
   170
#if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT)
williamr@2
   171
#  undef  BOOST_NO_INTRINSIC_WCHAR_T
williamr@2
   172
#  define BOOST_NO_INTRINSIC_WCHAR_T
williamr@2
   173
#endif
williamr@2
   174
williamr@2
   175
//
williamr@2
   176
// Borland ships a version of STLport with C++ Builder 6 that lacks
williamr@2
   177
// hashtables and the like:
williamr@2
   178
//
williamr@2
   179
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x560)
williamr@2
   180
#  undef BOOST_HAS_HASH
williamr@2
   181
#endif
williamr@2
   182
williamr@2
   183
//
williamr@2
   184
// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
williamr@2
   185
//
williamr@2
   186
#if defined(__GNUC__) && (__GNUC__ < 3)
williamr@2
   187
#  include <algorithm> // for std::min and std::max
williamr@2
   188
#  define BOOST_USING_STD_MIN() ((void)0)
williamr@2
   189
#  define BOOST_USING_STD_MAX() ((void)0)
williamr@2
   190
namespace boost { using std::min; using std::max; }
williamr@2
   191
#endif
williamr@2
   192
williamr@2
   193
#define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)
williamr@2
   194
williamr@2
   195
williamr@2
   196
williamr@2
   197
williamr@2
   198
williamr@2
   199
williamr@2
   200
williamr@2
   201