1 // Boost config.hpp configuration header file ------------------------------//
3 // (C) Copyright Boost.org 2001. 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 // This file is intended to be stable, and relatively unchanging.
14 // It should contain boilerplate code only - no compiler specific
15 // code unless it is unavoidable - no changes unless unavoidable.
17 #ifndef BOOST_CONFIG_SUFFIX_HPP
18 #define BOOST_CONFIG_SUFFIX_HPP
21 # define BOOST_DECL // default for compilers not needing this decoration.
25 // look for long long by looking for the appropriate macros in <limits.h>.
26 // Note that we use limits.h rather than climits for maximal portability,
27 // remember that since these just declare a bunch of macros, there should be
28 // no namespace issues from this.
31 # if !defined(BOOST_HAS_LONG_LONG) \
32 && !(defined(BOOST_MSVC) && BOOST_MSVC <=1300) && !defined(__BORLANDC__) \
33 && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
34 # define BOOST_HAS_LONG_LONG
36 #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T)
37 # define BOOST_NO_INTEGRAL_INT64_T
40 // GCC 3.x will clean up all of those nasty macro definitions that
41 // BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
43 #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
44 # undef BOOST_NO_CTYPE_FUNCTIONS
49 // Assume any extensions are in namespace std:: unless stated otherwise:
51 # ifndef BOOST_STD_EXTENSION_NAMESPACE
52 # define BOOST_STD_EXTENSION_NAMESPACE std
56 // If cv-qualified specializations are not allowed, then neither are cv-void ones:
58 # if defined(BOOST_NO_CV_SPECIALIZATIONS) \
59 && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
60 # define BOOST_NO_CV_VOID_SPECIALIZATIONS
64 // If there is no numeric_limits template, then it can't have any compile time
67 # if defined(BOOST_NO_LIMITS) \
68 && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
69 # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
70 # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
71 # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
75 // if there is no long long then there is no specialisation
76 // for numeric_limits<long long> either:
78 #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
79 # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
83 // if there is no __int64 then there is no specialisation
84 // for numeric_limits<__int64> either:
86 #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
87 # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
91 // if member templates are supported then so is the
92 // VC6 subset of member templates:
94 # if !defined(BOOST_NO_MEMBER_TEMPLATES) \
95 && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
96 # define BOOST_MSVC6_MEMBER_TEMPLATES
100 // Without partial specialization, can't test for partial specialisation bugs:
102 # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
103 && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
104 # define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
108 // Without partial specialization, std::iterator_traits can't work:
110 # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
111 && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
112 # define BOOST_NO_STD_ITERATOR_TRAITS
116 // Without member template support, we can't have template constructors
117 // in the standard library either:
119 # if defined(BOOST_NO_MEMBER_TEMPLATES) \
120 && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
121 && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
122 # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
126 // Without member template support, we can't have a conforming
127 // std::allocator template either:
129 # if defined(BOOST_NO_MEMBER_TEMPLATES) \
130 && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
131 && !defined(BOOST_NO_STD_ALLOCATOR)
132 # define BOOST_NO_STD_ALLOCATOR
136 // We can't have a working std::use_facet if there is no std::locale:
138 # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
139 # define BOOST_NO_STD_USE_FACET
143 // We can't have a std::messages facet if there is no std::locale:
145 # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
146 # define BOOST_NO_STD_MESSAGES
150 // We can't have a working std::wstreambuf if there is no std::locale:
152 # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
153 # define BOOST_NO_STD_WSTREAMBUF
157 // We can't have a <cwctype> if there is no <cwchar>:
159 # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
160 # define BOOST_NO_CWCTYPE
164 // We can't have a swprintf if there is no <cwchar>:
166 # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
167 # define BOOST_NO_SWPRINTF
171 // If Win32 support is turned off, then we must turn off
172 // threading support also, unless there is some other
173 // thread API enabled:
175 #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
176 && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
177 # define BOOST_DISABLE_THREADS
181 // Turn on threading support if the compiler thinks that it's in
182 // multithreaded mode. We put this here because there are only a
183 // limited number of macros that identify this (if there's any missing
184 // from here then add to the appropriate compiler section):
186 #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
187 || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
188 # define BOOST_HAS_THREADS
192 // Turn threading support off if BOOST_DISABLE_THREADS is defined:
194 #if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
195 # undef BOOST_HAS_THREADS
199 // Turn threading support off if we don't recognise the threading API:
201 #if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
202 && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
203 && !defined(BOOST_HAS_MPTASKS)
204 # undef BOOST_HAS_THREADS
208 // If the compiler claims to be C99 conformant, then it had better
209 // have a <stdint.h>:
211 # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
212 # define BOOST_HAS_STDINT_H
216 // Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
217 // Note that this is for backwards compatibility only.
219 # ifndef BOOST_HAS_SLIST
220 # define BOOST_NO_SLIST
223 # ifndef BOOST_HAS_HASH
224 # define BOOST_NO_HASH
227 // BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
228 // Because std::size_t usage is so common, even in boost headers which do not
229 // otherwise use the C library, the <cstddef> workaround is included here so
230 // that ugly workaround code need not appear in many other boost headers.
231 // NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
232 // must still be #included in the usual places so that <cstddef> inclusion
233 // works as expected with standard conforming compilers. The resulting
234 // double inclusion of <cstddef> is harmless.
236 # ifdef BOOST_NO_STDC_NAMESPACE
238 namespace std { using ::ptrdiff_t; using ::size_t; }
241 // BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
243 # ifdef BOOST_NO_STD_MIN_MAX
247 inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
248 return __b < __a ? __b : __a;
251 inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
252 return __a < __b ? __b : __a;
258 // BOOST_STATIC_CONSTANT workaround --------------------------------------- //
259 // On compilers which don't allow in-class initialization of static integral
260 // constant members, we must use enums as a workaround if we want the constants
261 // to be available at compile-time. This macro gives us a convenient way to
262 // declare such constants.
264 # ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
265 # define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
267 # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
270 // BOOST_USE_FACET workaround ----------------------------------------------//
271 // When the standard library does not have a conforming std::use_facet there
272 // are various workarounds available, but they differ from library to library.
273 // This macro provides a consistent way to access a locale's facets.
276 // std::use_facet<Type>(loc);
278 // BOOST_USE_FACET(Type, loc);
279 // Note do not add a std:: prefix to the front of BOOST_USE_FACET!
281 #if defined(BOOST_NO_STD_USE_FACET)
282 # ifdef BOOST_HAS_TWO_ARG_USE_FACET
283 # define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
284 # elif defined(BOOST_HAS_MACRO_USE_FACET)
285 # define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
286 # elif defined(BOOST_HAS_STLP_USE_FACET)
287 # define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
290 # define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
293 // BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
294 // Member templates are supported by some compilers even though they can't use
295 // the A::template member<U> syntax, as a workaround replace:
297 // typedef typename A::template rebind<U> binder;
301 // typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
303 #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
304 # define BOOST_NESTED_TEMPLATE template
306 # define BOOST_NESTED_TEMPLATE
309 // ---------------------------------------------------------------------------//
312 // Helper macro BOOST_STRINGIZE:
313 // Converts the parameter X to a string after macro replacement
314 // on X has been performed.
316 #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
317 #define BOOST_DO_STRINGIZE(X) #X
320 // Helper macro BOOST_JOIN:
321 // The following piece of macro magic joins the two
322 // arguments together, even when one of the arguments is
323 // itself a macro (see 16.3.1 in C++ standard). The key
324 // is that macro expansion of macro arguments does not
325 // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
327 #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
328 #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
329 #define BOOST_DO_JOIN2( X, Y ) X##Y
332 // Set some default values for compiler/library/platform names.
333 // These are for debugging config setup only:
335 # ifndef BOOST_COMPILER
336 # define BOOST_COMPILER "Unknown ISO C++ Compiler"
338 # ifndef BOOST_STDLIB
339 # define BOOST_STDLIB "Unknown ISO standard library"
341 # ifndef BOOST_PLATFORM
342 # if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
343 || defined(_POSIX_SOURCE)
344 # define BOOST_PLATFORM "Generic Unix"
346 # define BOOST_PLATFORM "Unknown"