blob: 05dd7191fc84e157dbf80c158d741cf218a18458 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (C) Copyright John Maddock 2001 - 2002.
2// (C) Copyright Darin Adler 2001.
3// (C) Copyright Jens Maurer 2001.
4// Use, modification and distribution are subject to the
5// Boost Software License, Version 1.0. (See accompanying file
6// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
8// See http://www.boost.org for most recent version.
9
10// STLPort standard library config:
11
12#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
13# include <cstddef>
14# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
15# error "This is not STLPort!"
16# endif
17#endif
18
19// Apple doesn't seem to reliably defined a *unix* macro
20#if !defined(CYGWIN) && ( defined(__unix__) \
21 || defined(__unix) \
22 || defined(unix) \
23 || defined(__APPLE__) \
24 || defined(__APPLE) \
25 || defined(APPLE))
26# include <unistd.h>
27#endif
28
29//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030// __STL_STATIC_CONST_INIT_BUG implies NDNBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070031// for versions prior to 4.1(beta)
32//
33#if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070034# define NDNBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070035#endif
36
37//
38// If STLport thinks that there is no partial specialisation, then there is no
39// std::iterator traits:
40//
41#if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION))
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042# define NDNBOOST_NO_STD_ITERATOR_TRAITS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070043#endif
44
45//
46// No new style iostreams on GCC without STLport's iostreams enabled:
47//
48#if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS))
Jeff Thompson3d613fd2013-10-15 15:39:04 -070049# define NDNBOOST_NO_STRINGSTREAM
Jeff Thompsonf7d49942013-08-01 16:47:40 -070050#endif
51
52//
53// No new iostreams implies no std::locale, and no std::stringstream:
54//
55#if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070056# define NDNBOOST_NO_STD_LOCALE
57# define NDNBOOST_NO_STRINGSTREAM
Jeff Thompsonf7d49942013-08-01 16:47:40 -070058#endif
59
60//
61// If the streams are not native, and we have a "using ::x" compiler bug
62// then the io stream facets are not available in namespace std::
63//
64#ifdef _STLPORT_VERSION
Jeff Thompson3d613fd2013-10-15 15:39:04 -070065# if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(NDNBOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
66# define NDNBOOST_NO_STD_LOCALE
Jeff Thompsonf7d49942013-08-01 16:47:40 -070067# endif
68#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070069# if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(NDNBOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
70# define NDNBOOST_NO_STD_LOCALE
Jeff Thompsonf7d49942013-08-01 16:47:40 -070071# endif
72#endif
73
74#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070075# define NDNBOOST_HAS_TR1_UNORDERED_SET
76# define NDNBOOST_HAS_TR1_UNORDERED_MAP
Jeff Thompsonf7d49942013-08-01 16:47:40 -070077#endif
78//
79// Without member template support enabled, their are no template
80// iterate constructors, and no std::allocator:
81//
82#if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES))
Jeff Thompson3d613fd2013-10-15 15:39:04 -070083# define NDNBOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
84# define NDNBOOST_NO_STD_ALLOCATOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -070085#endif
86//
87// however we always have at least a partial allocator:
88//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070089#define NDNBOOST_HAS_PARTIAL_STD_ALLOCATOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -070090
91#if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070092# define NDNBOOST_NO_STD_ALLOCATOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -070093#endif
94
Jeff Thompson3d613fd2013-10-15 15:39:04 -070095#if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC <= 1300)
96# define NDNBOOST_NO_STD_ALLOCATOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -070097#endif
98
99//
100// If STLport thinks there is no wchar_t at all, then we have to disable
101// the support for the relevant specilazations of std:: templates.
102//
103#if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700104# ifndef NDNBOOST_NO_STD_WSTRING
105# define NDNBOOST_NO_STD_WSTRING
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700106# endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700107# ifndef NDNBOOST_NO_STD_WSTREAMBUF
108# define NDNBOOST_NO_STD_WSTREAMBUF
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700109# endif
110#endif
111
112//
113// We always have SGI style hash_set, hash_map, and slist:
114//
115#ifndef _STLP_NO_EXTENSIONS
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700116#define NDNBOOST_HAS_HASH
117#define NDNBOOST_HAS_SLIST
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700118#endif
119
120//
121// STLport does a good job of importing names into namespace std::,
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700122// but doesn't always get them all, define NDNBOOST_NO_STDC_NAMESPACE, since our
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700123// workaround does not conflict with STLports:
124//
125//
126// Harold Howe says:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700127// Borland switched to STLport in BCB6. Defining NDNBOOST_NO_STDC_NAMESPACE with
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700128// BCB6 does cause problems. If we detect C++ Builder, then don't define
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700129// NDNBOOST_NO_STDC_NAMESPACE
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700130//
131#if !defined(__BORLANDC__) && !defined(__DMC__)
132//
133// If STLport is using it's own namespace, and the real names are in
134// the global namespace, then we duplicate STLport's using declarations
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700135// (by defining NDNBOOST_NO_STDC_NAMESPACE), we do this because STLport doesn't
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700136// necessarily import all the names we need into namespace std::
137//
138# if (defined(__STL_IMPORT_VENDOR_CSTD) \
139 || defined(__STL_USE_OWN_NAMESPACE) \
140 || defined(_STLP_IMPORT_VENDOR_CSTD) \
141 || defined(_STLP_USE_OWN_NAMESPACE)) \
142 && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD))
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700143# define NDNBOOST_NO_STDC_NAMESPACE
144# define NDNBOOST_NO_EXCEPTION_STD_NAMESPACE
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700145# endif
146#elif defined(__BORLANDC__) && __BORLANDC__ < 0x560
147// STLport doesn't import std::abs correctly:
148#include <stdlib.h>
149namespace std { using ::abs; }
150// and strcmp/strcpy don't get imported either ('cos they are macros)
151#include <string.h>
152#ifdef strcpy
153# undef strcpy
154#endif
155#ifdef strcmp
156# undef strcmp
157#endif
158#ifdef _STLP_VENDOR_CSTD
159namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; }
160#endif
161#endif
162
163//
164// std::use_facet may be non-standard, uses a class instead:
165//
166#if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700167# define NDNBOOST_NO_STD_USE_FACET
168# define NDNBOOST_HAS_STLP_USE_FACET
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700169#endif
170
171//
172// If STLport thinks there are no wide functions, <cwchar> etc. is not working; but
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700173// only if NDNBOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700174// into std:: ourselves).
175//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700176#if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(NDNBOOST_NO_STDC_NAMESPACE)
177# define NDNBOOST_NO_CWCHAR
178# define NDNBOOST_NO_CWCTYPE
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700179#endif
180
181//
182// If STLport for some reason was configured so that it thinks that wchar_t
183// is not an intrinsic type, then we have to disable the support for it as
184// well (we would be missing required specializations otherwise).
185//
186#if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700187# undef NDNBOOST_NO_INTRINSIC_WCHAR_T
188# define NDNBOOST_NO_INTRINSIC_WCHAR_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700189#endif
190
191//
192// Borland ships a version of STLport with C++ Builder 6 that lacks
193// hashtables and the like:
194//
195#if defined(__BORLANDC__) && (__BORLANDC__ == 0x560)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700196# undef NDNBOOST_HAS_HASH
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700197#endif
198
199//
200// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
201//
202#if defined(__GNUC__) && (__GNUC__ < 3)
203# include <algorithm> // for std::min and std::max
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700204# define NDNBOOST_USING_STD_MIN() ((void)0)
205# define NDNBOOST_USING_STD_MAX() ((void)0)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700206namespace ndnboost { using std::min; using std::max; }
207#endif
208
209// C++0x headers not yet implemented
210//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700211# define NDNBOOST_NO_CXX11_HDR_ARRAY
212# define NDNBOOST_NO_CXX11_HDR_CHRONO
213# define NDNBOOST_NO_CXX11_HDR_CODECVT
214# define NDNBOOST_NO_CXX11_HDR_CONDITION_VARIABLE
215# define NDNBOOST_NO_CXX11_HDR_FORWARD_LIST
216# define NDNBOOST_NO_CXX11_HDR_FUTURE
217# define NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST
218# define NDNBOOST_NO_CXX11_HDR_MUTEX
219# define NDNBOOST_NO_CXX11_HDR_RANDOM
220# define NDNBOOST_NO_CXX11_HDR_RATIO
221# define NDNBOOST_NO_CXX11_HDR_REGEX
222# define NDNBOOST_NO_CXX11_HDR_SYSTEM_ERROR
223# define NDNBOOST_NO_CXX11_HDR_THREAD
224# define NDNBOOST_NO_CXX11_HDR_TUPLE
225# define NDNBOOST_NO_CXX11_HDR_TYPE_TRAITS
226# define NDNBOOST_NO_CXX11_HDR_TYPEINDEX
227# define NDNBOOST_NO_CXX11_HDR_UNORDERED_MAP
228# define NDNBOOST_NO_CXX11_HDR_UNORDERED_SET
229# define NDNBOOST_NO_CXX11_NUMERIC_LIMITS
230# define NDNBOOST_NO_CXX11_ALLOCATOR
231# define NDNBOOST_NO_CXX11_ATOMIC_SMART_PTR
232# define NDNBOOST_NO_CXX11_SMART_PTR
233# define NDNBOOST_NO_CXX11_HDR_FUNCTIONAL
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700234
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700235#define NDNBOOST_STDLIB "STLPort standard library version " NDNBOOST_STRINGIZE(__SGI_STL_PORT)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700236
237
238
239
240
241
242
243