1 // Boost config.hpp configuration header file ------------------------------//
3 // (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and
4 // distribute this software is granted provided this copyright notice appears
5 // in all copies. This software is provided "as is" without express or implied
6 // warranty, and with no claim as to its suitability for any purpose.
8 // See http://www.boost.org for most recent version.
10 // Boost config.hpp policy and rationale documentation has been moved to
11 // http://www.boost.org/libs/config
13 // Revision History (excluding minor changes for specific compilers)
14 // 25 Sep 00 BOOST_NO_STD_ALLOCATOR (Jeremy Siek)
15 // 18 SEP 00 BOOST_NO_SLIST, BOOST_NO_HASH,
16 // BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
17 // BOOST_NO_LIMITS (Jeremy Siek)
18 // 1 Sep 00 BOOST_NO_PRIVATE_IN_AGGREGATE added. (Mark Rodgers)
19 // 23 Jul 00 Fixed spelling of BOOST_NO_INCLASS_MEMBER_INITIALIZATION in
20 // comment (Dave Abrahams).
21 // 10 Jul 00 BOOST_NO_POINTER_TO_MEMBER_CONST added (Mark Rodgers)
22 // 26 Jun 00 BOOST_NO_STD_ITERATOR, BOOST_MSVC_STD_ITERATOR,
23 // BOOST_NO_STD_ITERATOR_TRAITS, BOOST_NO_USING_TEMPLATE,
24 // added (Jeremy Siek)
25 // 20 Jun 00 BOOST_MSVC added (Aleksey Gurtovoy)
26 // 14 Jun 00 BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS (Jens M.)
27 // 22 Mar 00 BOOST_MSVC6_MEMBER_TEMPLATES added (Dave Abrahams)
28 // 18 Feb 00 BOOST_NO_INCLASS_MEMBER_INITIALIZATION added (Jens Maurer)
29 // 26 Jan 00 Borland compiler support added (John Maddock)
30 // 26 Jan 00 Sun compiler support added (Jörg Schaible)
31 // 30 Dec 99 BOOST_NMEMBER_TEMPLATES compatibility moved here from
32 // smart_ptr.hpp. (Dave Abrahams)
33 // 15 Nov 99 BOOST_NO_OPERATORS_IN_NAMESPACE,
34 // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION added (Beman Dawes)
35 // 11 Oct 99 BOOST_NO_STDC_NAMESPACE refined; <cstddef> supplied
36 // 29 Sep 99 BOOST_NO_STDC_NAMESPACE added (Ed Brey)
37 // 24 Sep 99 BOOST_DECL added (Ed Brey)
38 // 10 Aug 99 Endedness flags added, GNU CC support added
39 // 22 Jul 99 Initial version
42 #ifndef BOOST_CONFIG_HPP
43 #define BOOST_CONFIG_HPP
45 // Conformance Flag Macros -------------------------------------------------//
47 // Conformance flag macros should identify the absence of C++ Standard
48 // conformance rather than its presence. This ensures that standard conforming
49 // compilers do not require a lot of configuration flag macros. It places the
50 // burden where it should be, on non-conforming compilers. In the future,
51 // hopefully, less rather than more conformance flags will have to be defined.
53 // BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS: Template value
54 // parameters cannot have a dependent type, for example
55 // "template<class T, typename T::type value> class X { ... };"
57 // BOOST_NO_INCLASS_MEMBER_INITIALIZATION: Compiler violates std::9.4.2/4.
59 // BOOST_NO_MEMBER_TEMPLATES: Member template functions not fully supported.
60 // Also see BOOST_MSVC6_MEMBER_TEMPLATES in the Compiler Control section below.
62 // BOOST_NO_MEMBER_TEMPLATE_FRIENDS: Member template friend syntax
63 // ("template<class P> friend class frd;") described in the C++ Standard,
64 // 14.5.3, not supported.
66 // BOOST_NO_OPERATORS_IN_NAMESPACE: Compiler requires inherited operator
67 // friend functions to be defined at namespace scope, then using'ed to boost.
68 // Probably GCC specific. See boost/operators.hpp for example.
70 // BOOST_NO_POINTER_TO_MEMBER_CONST: The compiler does not correctly handle
71 // pointers to const member functions, preventing use of these in overloaded
72 // function templates. See boost/functional.hpp for example.
74 // BOOST_NO_PRIVATE_IN_AGGREGATE: The compiler misreads 8.5.1, treating classes
75 // as non-aggregate if they contain private or protected member functions.
77 // BOOST_NO_STD_ITERATOR: The C++ implementation fails to provide the
78 // std::iterator class.
80 // BOOST_NO_STD_ITERATOR_TRAITS: The compiler does not provide a standard
81 // compliant implementation of std::iterator_traits. Note that
82 // the compiler may still have a non-standard implementation.
84 // BOOST_NO_STDC_NAMESPACE: The contents of C++ standard headers for C library
85 // functions (the <c...> headers) have not been placed in namespace std.
86 // Because the use of std::size_t is so common, a specific workaround for
87 // <cstddef> (and thus std::size_t) is provided in this header (see below).
88 // For other <c...> headers, a workaround must be provided in the boost header:
90 // #include <cstdlib> // for abs
91 // #ifdef BOOST_NO_STDC_NAMESPACE
92 // namespace std { using ::abs; }
95 // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION. Class template partial
96 // specialization (14.5.4 [temp.class.spec]) not supported.
98 // BOOST_NO_USING_TEMPLATE: The compiler will not accept a using declaration
99 // that imports a template from the global namespace into a named namespace.
100 // Probably Borland specific.
102 // Compiler Control or Information Macros ----------------------------------//
104 // Compilers often supply features outside of the C++ Standard which need to be
105 // controlled or detected. As usual, reasonable default behavior should occur
106 // if any of these macros are not defined.
108 // BOOST_DECL: Certain compilers for Microsoft operating systems require
109 // non-standard class and function decoration if dynamic load library linking
110 // is desired. BOOST_DECL supplies that decoration, defaulting to a nul string
111 // so that it is harmless when not required. Boost does not encourage the use
112 // of BOOST_DECL - it is non-standard and to be avoided if practical to do so.
114 // BOOST_DECL_EXPORTS: User defined, BOOST_DECL_EXPORTS causes BOOST_DECL to
115 // be defined as __declspec(dllexport) rather than __declspec(dllimport).
117 // BOOST_MSVC6_MEMBER_TEMPLATES: Microsoft Visual C++ 6.0 has enough member
118 // template idiosyncrasies (being polite) that BOOST_NO_MEMBER_TEMPLATES is
119 // defined for this compiler. BOOST_MSVC6_MEMBER_TEMPLATES is defined to allow
120 // compiler specific workarounds.
122 // BOOST_MSVC: defined as _MSC_VER for the Microsoft compiler only. In general,
123 // boost headers should test for a specific conformance flag macro (for
124 // example, BOOST_NO_MEMBER_TEMPLATE_FRIENDS) rather than a specific compiler.
125 // VC++ is a special case, however, since many libraries try to support it yet
126 // it has so many conformance issues that sometimes it is just easier to test
127 // for it directly. On the other hand, the obvious way to do this doesn't work,
128 // as many non-Microsoft compilers define _MSC_VER. Thus BOOST_MSVC.
130 // BOOST_MSVC_STD_ITERATOR: Microsoft's broken version of std::iterator
133 // BOOST_SYSTEM_HAS_STDINT_H: There are no 1998 C++ Standard headers <stdint.h>
134 // or <cstdint>, although the 1999 C Standard does include <stdint.h>.
135 // If <stdint.h> is present, <boost/stdint.h> can make good use of it,
136 // so a flag is supplied (signalling presence; thus the default is not
137 // present, conforming to the current C++ standard).
139 // BOOST_NO_SLIST: The C++ implementation does not provide the slist class.
141 // BOOST_NO_HASH: The C++ implementation does not provide the hash_set
142 // or hash_map classes.
144 // BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS: The standard library does not provide
145 // templated iterator constructors for its containers.
147 // BOOST_NO_LIMITS: The C++ implementation does not provide the <limits> header.
149 // BOOST_NO_INTRINSIC_WCHAR_T: The C++ implementation does not provide wchar_t,
150 // or it is really a synonym for another integral type. Use this symbol to
151 // decide whether it is appropriate to explicitly specialize a template on
152 // wchar_t if there is already a specialization for other integer types.
154 // BOOST_NO_STD_ALLOCATOR: The C++ standard library does not provide
155 // a standards conforming std::allocator.
157 // Compilers are listed in alphabetic order (except VC++ last - see below)---//
159 // GNU CC (also known as GCC and G++) --------------------------------------//
161 # if defined __GNUC__
162 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
163 # include <iterator> // not sure this is the right way to do this -JGS
164 # if !defined(_CXXRT_STD) && !defined(__SGI_STL) // need to ask Dietmar about this -JGS
165 # define BOOST_NO_STD_ITERATOR
166 # define BOOST_NO_LIMITS
168 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
169 # define BOOST_NO_OPERATORS_IN_NAMESPACE
171 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 8
172 # define BOOST_NO_MEMBER_TEMPLATES
175 # if __GNUC__ == 2 && __GNUC_MINOR__ == 97
176 # define BOOST_NO_STDC_NAMESPACE
178 // Kai C++ ------------------------------------------------------------------//
181 # define BOOST_NO_SLIST
182 # define BOOST_NO_HASH
184 // Greenhills C++ -----------------------------------------------------------//
187 # define BOOST_NO_SLIST
188 # define BOOST_NO_HASH
190 // Borland ------------------------------------------------------------------//
192 #elif defined __BORLANDC__
193 # if __BORLANDC__ <= 0x0551
194 # define BOOST_NO_PRIVATE_IN_AGGREGATE
196 # if __BORLANDC__ <= 0x0550
197 // Borland C++ Builder 4 and 5:
198 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
199 # define BOOST_NO_USING_TEMPLATE
200 # if __BORLANDC__ == 0x0550
201 // Borland C++ Builder 5, command-line compiler 5.5:
202 # define BOOST_NO_OPERATORS_IN_NAMESPACE
205 # if defined BOOST_DECL_EXPORTS
206 # define BOOST_DECL __declspec(dllexport)
208 # define BOOST_DECL __declspec(dllimport)
211 // Intel -------------------------------------------------------------------//
214 # include <iterator> // not sure this is the right way to do this -JGS
215 # if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES)
216 // a perfectly good implementation of std::iterator is supplied
217 # elif defined(__SGI_STL_ITERATOR)
218 # define BOOST_NO_STD_ITERATOR // No std::iterator in this case
219 # else // assume using dinkumware's STL that comes with VC++ 6.0
220 # define BOOST_MSVC_STD_ITERATOR
221 # define BOOST_NO_STD_ITERATOR_TRAITS
222 # define BOOST_NO_STDC_NAMESPACE
223 # define BOOST_NO_SLIST
224 # define BOOST_NO_HASH
225 # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
226 # define BOOST_NO_STD_ALLOCATOR
230 // Metrowerks CodeWarrior --------------------------------------------------//
232 # elif defined __MWERKS__
233 # if __MWERKS__ <= 0x4000
234 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
236 # if __MWERKS__ <= 0x2301
237 # define BOOST_NO_POINTER_TO_MEMBER_CONST
239 # if __MWERKS__ >= 0x2300
240 # define BOOST_SYSTEM_HAS_STDINT_H
242 # if defined BOOST_DECL_EXPORTS
243 # define BOOST_DECL __declspec(dllexport)
245 # define BOOST_DECL __declspec(dllimport)
248 // Sun Workshop Compiler C++ ------------------------------------------------//
250 # elif defined __SUNPRO_CC
251 # if __SUNPRO_CC <= 0x500
252 # define BOOST_NO_MEMBER_TEMPLATES
253 # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
256 // Microsoft Visual C++ (excluding Intel/EDG front end) --------------------//
258 // Must remain the last #elif since some other vendors (Metrowerks, for
259 // example) also #define _MSC_VER
261 # elif defined _MSC_VER
262 # define BOOST_MSVC _MSC_VER
264 // turn off the warnings before we #include anything
265 # pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
266 # pragma warning( disable : 4503 ) // warning: decorated name length exceeded
268 # if _MSC_VER <= 1200 // 1200 == VC++ 6.0
269 # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
270 # define BOOST_NO_PRIVATE_IN_AGGREGATE
272 # define BOOST_NO_INTRINSIC_WCHAR_T
274 // VC++ 6.0 has member templates but they have numerous problems including
275 // cases of silent failure, so for safety we define:
276 # define BOOST_NO_MEMBER_TEMPLATES
277 // For VC++ experts wishing to attempt workarounds, we define:
278 # define BOOST_MSVC6_MEMBER_TEMPLATES
280 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
281 # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
282 # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
284 # include <iterator> // not sure this is the right way to do this -JGS
285 # if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES)
286 // a perfectly good implementation of std::iterator is supplied
287 # elif defined(__SGI_STL_ITERATOR)
288 # define BOOST_NO_STD_ITERATOR // No std::iterator in this case
290 # define BOOST_MSVC_STD_ITERATOR 1
291 # define BOOST_NO_SLIST
292 # define BOOST_NO_HASH
293 # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
294 # define BOOST_NO_STD_ALLOCATOR
296 # define BOOST_NO_STD_ITERATOR_TRAITS
299 // Make sure at least one standard library header is included so that library
300 // implementation detection will work, even if no standard headers have been
301 // included in front of a boost header. (Ed Brey 5 Jun 00)
304 // Determine if the standard library implementation is already pulling names
305 // into std. STLport defines the following if so. (Ed Brey 5 Jun 00)
306 # ifndef __STL_IMPORT_VENDOR_CSTD
307 # define BOOST_NO_STDC_NAMESPACE
312 # if defined BOOST_DECL_EXPORTS
313 # define BOOST_DECL __declspec(dllexport)
315 # define BOOST_DECL __declspec(dllimport)
318 # endif // Microsoft (excluding Intel/EDG frontend)
321 # define BOOST_DECL // default for compilers not needing this decoration.
324 // end of compiler specific portion ----------------------------------------//
326 // Check for old name "BOOST_NMEMBER_TEMPLATES" for compatibility -----------//
327 // Don't use BOOST_NMEMBER_TEMPLATES. It is deprecated and will be removed soon.
328 #if defined( BOOST_NMEMBER_TEMPLATES ) && !defined( BOOST_NO_MEMBER_TEMPLATES )
329 #define BOOST_NO_MEMBER_TEMPLATES
332 // BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
334 // Because std::size_t usage is so common, even in boost headers which do not
335 // otherwise use the C library, the <cstddef> workaround is included here so
336 // that ugly workaround code need not appear in many other boost headers.
337 // NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
338 // must still be #included in the usual places so that <cstddef> inclusion
339 // works as expected with standard conforming compilers. The resulting
340 // double inclusion of <cstddef> is harmless.
342 # ifdef BOOST_NO_STDC_NAMESPACE
344 namespace std { using ::ptrdiff_t; using ::size_t; }
345 // using ::wchar_t; removed since wchar_t is a C++ built-in type (Ed Brey)
349 #endif // BOOST_CONFIG_HPP