1 | // Boost config.hpp configuration header file ------------------------------//
|
---|
2 |
|
---|
3 | // Copyright (c) 2001-2003 John Maddock
|
---|
4 | // Copyright (c) 2001 Darin Adler
|
---|
5 | // Copyright (c) 2001 Peter Dimov
|
---|
6 | // Copyright (c) 2002 Bill Kempf
|
---|
7 | // Copyright (c) 2002 Jens Maurer
|
---|
8 | // Copyright (c) 2002-2003 David Abrahams
|
---|
9 | // Copyright (c) 2003 Gennaro Prota
|
---|
10 | // Copyright (c) 2003 Eric Friedman
|
---|
11 | //
|
---|
12 | // Distributed under the Boost Software License, Version 1.0. (See
|
---|
13 | // accompanying file LICENSE_1_0.txt or copy at
|
---|
14 | // http://www.boost.org/LICENSE_1_0.txt)
|
---|
15 |
|
---|
16 | // See http://www.boost.org/ for most recent version.
|
---|
17 |
|
---|
18 | // Boost config.hpp policy and rationale documentation has been moved to
|
---|
19 | // http://www.boost.org/libs/config/
|
---|
20 | //
|
---|
21 | // This file is intended to be stable, and relatively unchanging.
|
---|
22 | // It should contain boilerplate code only - no compiler specific
|
---|
23 | // code unless it is unavoidable - no changes unless unavoidable.
|
---|
24 |
|
---|
25 | #ifndef BOOST_CONFIG_SUFFIX_HPP
|
---|
26 | #define BOOST_CONFIG_SUFFIX_HPP
|
---|
27 |
|
---|
28 | //
|
---|
29 | // look for long long by looking for the appropriate macros in <limits.h>.
|
---|
30 | // Note that we use limits.h rather than climits for maximal portability,
|
---|
31 | // remember that since these just declare a bunch of macros, there should be
|
---|
32 | // no namespace issues from this.
|
---|
33 | //
|
---|
34 | #if !defined(BOOST_HAS_LONG_LONG) \
|
---|
35 | && !defined(BOOST_MSVC) && !defined(__BORLANDC__)
|
---|
36 | # include <limits.h>
|
---|
37 | # if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
|
---|
38 | # define BOOST_HAS_LONG_LONG
|
---|
39 | # endif
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | // GCC 3.x will clean up all of those nasty macro definitions that
|
---|
43 | // BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
|
---|
44 | // it under GCC 3.x.
|
---|
45 | #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
|
---|
46 | # undef BOOST_NO_CTYPE_FUNCTIONS
|
---|
47 | #endif
|
---|
48 |
|
---|
49 | //
|
---|
50 | // Assume any extensions are in namespace std:: unless stated otherwise:
|
---|
51 | //
|
---|
52 | # ifndef BOOST_STD_EXTENSION_NAMESPACE
|
---|
53 | # define BOOST_STD_EXTENSION_NAMESPACE std
|
---|
54 | # endif
|
---|
55 |
|
---|
56 | //
|
---|
57 | // If cv-qualified specializations are not allowed, then neither are cv-void ones:
|
---|
58 | //
|
---|
59 | # if defined(BOOST_NO_CV_SPECIALIZATIONS) \
|
---|
60 | && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
|
---|
61 | # define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
---|
62 | # endif
|
---|
63 |
|
---|
64 | //
|
---|
65 | // If there is no numeric_limits template, then it can't have any compile time
|
---|
66 | // constants either!
|
---|
67 | //
|
---|
68 | # if defined(BOOST_NO_LIMITS) \
|
---|
69 | && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
|
---|
70 | # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
---|
71 | # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
---|
72 | # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
|
---|
73 | # endif
|
---|
74 |
|
---|
75 | //
|
---|
76 | // if there is no long long then there is no specialisation
|
---|
77 | // for numeric_limits<long long> either:
|
---|
78 | //
|
---|
79 | #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
|
---|
80 | # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
|
---|
81 | #endif
|
---|
82 |
|
---|
83 | //
|
---|
84 | // if there is no __int64 then there is no specialisation
|
---|
85 | // for numeric_limits<__int64> either:
|
---|
86 | //
|
---|
87 | #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
|
---|
88 | # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | //
|
---|
92 | // if member templates are supported then so is the
|
---|
93 | // VC6 subset of member templates:
|
---|
94 | //
|
---|
95 | # if !defined(BOOST_NO_MEMBER_TEMPLATES) \
|
---|
96 | && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
---|
97 | # define BOOST_MSVC6_MEMBER_TEMPLATES
|
---|
98 | # endif
|
---|
99 |
|
---|
100 | //
|
---|
101 | // Without partial specialization, can't test for partial specialisation bugs:
|
---|
102 | //
|
---|
103 | # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
---|
104 | && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
|
---|
105 | # define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
|
---|
106 | # endif
|
---|
107 |
|
---|
108 | //
|
---|
109 | // Without partial specialization, we can't have array-type partial specialisations:
|
---|
110 | //
|
---|
111 | # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
---|
112 | && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
---|
113 | # define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
|
---|
114 | # endif
|
---|
115 |
|
---|
116 | //
|
---|
117 | // Without partial specialization, std::iterator_traits can't work:
|
---|
118 | //
|
---|
119 | # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
---|
120 | && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
---|
121 | # define BOOST_NO_STD_ITERATOR_TRAITS
|
---|
122 | # endif
|
---|
123 |
|
---|
124 | //
|
---|
125 | // Without partial specialization, partial
|
---|
126 | // specialization with default args won't work either:
|
---|
127 | //
|
---|
128 | # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
---|
129 | && !defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
|
---|
130 | # define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
|
---|
131 | # endif
|
---|
132 |
|
---|
133 | //
|
---|
134 | // Without member template support, we can't have template constructors
|
---|
135 | // in the standard library either:
|
---|
136 | //
|
---|
137 | # if defined(BOOST_NO_MEMBER_TEMPLATES) \
|
---|
138 | && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
|
---|
139 | && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
|
---|
140 | # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
|
---|
141 | # endif
|
---|
142 |
|
---|
143 | //
|
---|
144 | // Without member template support, we can't have a conforming
|
---|
145 | // std::allocator template either:
|
---|
146 | //
|
---|
147 | # if defined(BOOST_NO_MEMBER_TEMPLATES) \
|
---|
148 | && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
|
---|
149 | && !defined(BOOST_NO_STD_ALLOCATOR)
|
---|
150 | # define BOOST_NO_STD_ALLOCATOR
|
---|
151 | # endif
|
---|
152 |
|
---|
153 | //
|
---|
154 | // without ADL support then using declarations will break ADL as well:
|
---|
155 | //
|
---|
156 | #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
|
---|
157 | # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
---|
158 | #endif
|
---|
159 |
|
---|
160 | //
|
---|
161 | // Without typeid support we have no dynamic RTTI either:
|
---|
162 | //
|
---|
163 | #if defined(BOOST_NO_TYPEID) && !defined(BOOST_NO_RTTI)
|
---|
164 | # define BOOST_NO_RTTI
|
---|
165 | #endif
|
---|
166 |
|
---|
167 | //
|
---|
168 | // If we have a standard allocator, then we have a partial one as well:
|
---|
169 | //
|
---|
170 | #if !defined(BOOST_NO_STD_ALLOCATOR)
|
---|
171 | # define BOOST_HAS_PARTIAL_STD_ALLOCATOR
|
---|
172 | #endif
|
---|
173 |
|
---|
174 | //
|
---|
175 | // We can't have a working std::use_facet if there is no std::locale:
|
---|
176 | //
|
---|
177 | # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
|
---|
178 | # define BOOST_NO_STD_USE_FACET
|
---|
179 | # endif
|
---|
180 |
|
---|
181 | //
|
---|
182 | // We can't have a std::messages facet if there is no std::locale:
|
---|
183 | //
|
---|
184 | # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
|
---|
185 | # define BOOST_NO_STD_MESSAGES
|
---|
186 | # endif
|
---|
187 |
|
---|
188 | //
|
---|
189 | // We can't have a working std::wstreambuf if there is no std::locale:
|
---|
190 | //
|
---|
191 | # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
|
---|
192 | # define BOOST_NO_STD_WSTREAMBUF
|
---|
193 | # endif
|
---|
194 |
|
---|
195 | //
|
---|
196 | // We can't have a <cwctype> if there is no <cwchar>:
|
---|
197 | //
|
---|
198 | # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
|
---|
199 | # define BOOST_NO_CWCTYPE
|
---|
200 | # endif
|
---|
201 |
|
---|
202 | //
|
---|
203 | // We can't have a swprintf if there is no <cwchar>:
|
---|
204 | //
|
---|
205 | # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
|
---|
206 | # define BOOST_NO_SWPRINTF
|
---|
207 | # endif
|
---|
208 |
|
---|
209 | //
|
---|
210 | // If Win32 support is turned off, then we must turn off
|
---|
211 | // threading support also, unless there is some other
|
---|
212 | // thread API enabled:
|
---|
213 | //
|
---|
214 | #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
|
---|
215 | && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
|
---|
216 | # define BOOST_DISABLE_THREADS
|
---|
217 | #endif
|
---|
218 |
|
---|
219 | //
|
---|
220 | // Turn on threading support if the compiler thinks that it's in
|
---|
221 | // multithreaded mode. We put this here because there are only a
|
---|
222 | // limited number of macros that identify this (if there's any missing
|
---|
223 | // from here then add to the appropriate compiler section):
|
---|
224 | //
|
---|
225 | #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
|
---|
226 | || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
|
---|
227 | # define BOOST_HAS_THREADS
|
---|
228 | #endif
|
---|
229 |
|
---|
230 | //
|
---|
231 | // Turn threading support off if BOOST_DISABLE_THREADS is defined:
|
---|
232 | //
|
---|
233 | #if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
|
---|
234 | # undef BOOST_HAS_THREADS
|
---|
235 | #endif
|
---|
236 |
|
---|
237 | //
|
---|
238 | // Turn threading support off if we don't recognise the threading API:
|
---|
239 | //
|
---|
240 | #if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
|
---|
241 | && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
|
---|
242 | && !defined(BOOST_HAS_MPTASKS)
|
---|
243 | # undef BOOST_HAS_THREADS
|
---|
244 | #endif
|
---|
245 |
|
---|
246 | //
|
---|
247 | // Turn threading detail macros off if we don't (want to) use threading
|
---|
248 | //
|
---|
249 | #ifndef BOOST_HAS_THREADS
|
---|
250 | # undef BOOST_HAS_PTHREADS
|
---|
251 | # undef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
|
---|
252 | # undef BOOST_HAS_PTHREAD_YIELD
|
---|
253 | # undef BOOST_HAS_PTHREAD_DELAY_NP
|
---|
254 | # undef BOOST_HAS_WINTHREADS
|
---|
255 | # undef BOOST_HAS_BETHREADS
|
---|
256 | # undef BOOST_HAS_MPTASKS
|
---|
257 | #endif
|
---|
258 |
|
---|
259 | //
|
---|
260 | // If the compiler claims to be C99 conformant, then it had better
|
---|
261 | // have a <stdint.h>:
|
---|
262 | //
|
---|
263 | # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
---|
264 | # define BOOST_HAS_STDINT_H
|
---|
265 | # ifndef BOOST_HAS_LOG1P
|
---|
266 | # define BOOST_HAS_LOG1P
|
---|
267 | # endif
|
---|
268 | # ifndef BOOST_HAS_EXPM1
|
---|
269 | # define BOOST_HAS_EXPM1
|
---|
270 | # endif
|
---|
271 | # endif
|
---|
272 |
|
---|
273 | //
|
---|
274 | // Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
|
---|
275 | // Note that this is for backwards compatibility only.
|
---|
276 | //
|
---|
277 | # if !defined(BOOST_HAS_SLIST) && !defined(BOOST_NO_SLIST)
|
---|
278 | # define BOOST_NO_SLIST
|
---|
279 | # endif
|
---|
280 |
|
---|
281 | # if !defined(BOOST_HAS_HASH) && !defined(BOOST_NO_HASH)
|
---|
282 | # define BOOST_NO_HASH
|
---|
283 | # endif
|
---|
284 |
|
---|
285 | //
|
---|
286 | // Set BOOST_SLIST_HEADER if not set already:
|
---|
287 | //
|
---|
288 | #if defined(BOOST_HAS_SLIST) && !defined(BOOST_SLIST_HEADER)
|
---|
289 | # define BOOST_SLIST_HEADER <slist>
|
---|
290 | #endif
|
---|
291 |
|
---|
292 | //
|
---|
293 | // Set BOOST_HASH_SET_HEADER if not set already:
|
---|
294 | //
|
---|
295 | #if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_SET_HEADER)
|
---|
296 | # define BOOST_HASH_SET_HEADER <hash_set>
|
---|
297 | #endif
|
---|
298 |
|
---|
299 | //
|
---|
300 | // Set BOOST_HASH_MAP_HEADER if not set already:
|
---|
301 | //
|
---|
302 | #if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_MAP_HEADER)
|
---|
303 | # define BOOST_HASH_MAP_HEADER <hash_map>
|
---|
304 | #endif
|
---|
305 |
|
---|
306 | // BOOST_HAS_ABI_HEADERS
|
---|
307 | // This macro gets set if we have headers that fix the ABI,
|
---|
308 | // and prevent ODR violations when linking to external libraries:
|
---|
309 | #if defined(BOOST_ABI_PREFIX) && defined(BOOST_ABI_SUFFIX) && !defined(BOOST_HAS_ABI_HEADERS)
|
---|
310 | # define BOOST_HAS_ABI_HEADERS
|
---|
311 | #endif
|
---|
312 |
|
---|
313 | #if defined(BOOST_HAS_ABI_HEADERS) && defined(BOOST_DISABLE_ABI_HEADERS)
|
---|
314 | # undef BOOST_HAS_ABI_HEADERS
|
---|
315 | #endif
|
---|
316 |
|
---|
317 | // BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
|
---|
318 | // Because std::size_t usage is so common, even in boost headers which do not
|
---|
319 | // otherwise use the C library, the <cstddef> workaround is included here so
|
---|
320 | // that ugly workaround code need not appear in many other boost headers.
|
---|
321 | // NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
|
---|
322 | // must still be #included in the usual places so that <cstddef> inclusion
|
---|
323 | // works as expected with standard conforming compilers. The resulting
|
---|
324 | // double inclusion of <cstddef> is harmless.
|
---|
325 |
|
---|
326 | # ifdef BOOST_NO_STDC_NAMESPACE
|
---|
327 | # include <cstddef>
|
---|
328 | namespace std { using ::ptrdiff_t; using ::size_t; }
|
---|
329 | # endif
|
---|
330 |
|
---|
331 | // Workaround for the unfortunate min/max macros defined by some platform headers
|
---|
332 |
|
---|
333 | #define BOOST_PREVENT_MACRO_SUBSTITUTION
|
---|
334 |
|
---|
335 | #ifndef BOOST_USING_STD_MIN
|
---|
336 | # define BOOST_USING_STD_MIN() using std::min
|
---|
337 | #endif
|
---|
338 |
|
---|
339 | #ifndef BOOST_USING_STD_MAX
|
---|
340 | # define BOOST_USING_STD_MAX() using std::max
|
---|
341 | #endif
|
---|
342 |
|
---|
343 | // BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
|
---|
344 |
|
---|
345 | # ifdef BOOST_NO_STD_MIN_MAX
|
---|
346 |
|
---|
347 | namespace std {
|
---|
348 | template <class _Tp>
|
---|
349 | inline const _Tp& min BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
|
---|
350 | return __b < __a ? __b : __a;
|
---|
351 | }
|
---|
352 | template <class _Tp>
|
---|
353 | inline const _Tp& max BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
|
---|
354 | return __a < __b ? __b : __a;
|
---|
355 | }
|
---|
356 | }
|
---|
357 |
|
---|
358 | # endif
|
---|
359 |
|
---|
360 | // BOOST_STATIC_CONSTANT workaround --------------------------------------- //
|
---|
361 | // On compilers which don't allow in-class initialization of static integral
|
---|
362 | // constant members, we must use enums as a workaround if we want the constants
|
---|
363 | // to be available at compile-time. This macro gives us a convenient way to
|
---|
364 | // declare such constants.
|
---|
365 |
|
---|
366 | # ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
---|
367 | # define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
|
---|
368 | # else
|
---|
369 | # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
|
---|
370 | # endif
|
---|
371 |
|
---|
372 | // BOOST_USE_FACET / HAS_FACET workaround ----------------------------------//
|
---|
373 | // When the standard library does not have a conforming std::use_facet there
|
---|
374 | // are various workarounds available, but they differ from library to library.
|
---|
375 | // The same problem occurs with has_facet.
|
---|
376 | // These macros provide a consistent way to access a locale's facets.
|
---|
377 | // Usage:
|
---|
378 | // replace
|
---|
379 | // std::use_facet<Type>(loc);
|
---|
380 | // with
|
---|
381 | // BOOST_USE_FACET(Type, loc);
|
---|
382 | // Note do not add a std:: prefix to the front of BOOST_USE_FACET!
|
---|
383 | // Use for BOOST_HAS_FACET is analogous.
|
---|
384 |
|
---|
385 | #if defined(BOOST_NO_STD_USE_FACET)
|
---|
386 | # ifdef BOOST_HAS_TWO_ARG_USE_FACET
|
---|
387 | # define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
|
---|
388 | # define BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast<Type*>(0))
|
---|
389 | # elif defined(BOOST_HAS_MACRO_USE_FACET)
|
---|
390 | # define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
|
---|
391 | # define BOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type)
|
---|
392 | # elif defined(BOOST_HAS_STLP_USE_FACET)
|
---|
393 | # define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
|
---|
394 | # define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
|
---|
395 | # endif
|
---|
396 | #else
|
---|
397 | # define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
|
---|
398 | # define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
|
---|
399 | #endif
|
---|
400 |
|
---|
401 | // BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
|
---|
402 | // Member templates are supported by some compilers even though they can't use
|
---|
403 | // the A::template member<U> syntax, as a workaround replace:
|
---|
404 | //
|
---|
405 | // typedef typename A::template rebind<U> binder;
|
---|
406 | //
|
---|
407 | // with:
|
---|
408 | //
|
---|
409 | // typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
|
---|
410 |
|
---|
411 | #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
|
---|
412 | # define BOOST_NESTED_TEMPLATE template
|
---|
413 | #else
|
---|
414 | # define BOOST_NESTED_TEMPLATE
|
---|
415 | #endif
|
---|
416 |
|
---|
417 | // BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------//
|
---|
418 | // Normally evaluates to nothing, unless BOOST_NO_UNREACHABLE_RETURN_DETECTION
|
---|
419 | // is defined, in which case it evaluates to return x; Use when you have a return
|
---|
420 | // statement that can never be reached.
|
---|
421 |
|
---|
422 | #ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
|
---|
423 | # define BOOST_UNREACHABLE_RETURN(x) return x;
|
---|
424 | #else
|
---|
425 | # define BOOST_UNREACHABLE_RETURN(x)
|
---|
426 | #endif
|
---|
427 |
|
---|
428 | // BOOST_DEDUCED_TYPENAME workaround ------------------------------------------//
|
---|
429 | //
|
---|
430 | // Some compilers don't support the use of `typename' for dependent
|
---|
431 | // types in deduced contexts, e.g.
|
---|
432 | //
|
---|
433 | // template <class T> void f(T, typename T::type);
|
---|
434 | // ^^^^^^^^
|
---|
435 | // Replace these declarations with:
|
---|
436 | //
|
---|
437 | // template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);
|
---|
438 |
|
---|
439 | #ifndef BOOST_NO_DEDUCED_TYPENAME
|
---|
440 | # define BOOST_DEDUCED_TYPENAME typename
|
---|
441 | #else
|
---|
442 | # define BOOST_DEDUCED_TYPENAME
|
---|
443 | #endif
|
---|
444 |
|
---|
445 | #ifndef BOOST_NO_TYPENAME_WITH_CTOR
|
---|
446 | # define BOOST_CTOR_TYPENAME typename
|
---|
447 | #else
|
---|
448 | # define BOOST_CTOR_TYPENAME
|
---|
449 | #endif
|
---|
450 |
|
---|
451 | // long long workaround ------------------------------------------//
|
---|
452 | // On gcc (and maybe other compilers?) long long is alway supported
|
---|
453 | // but it's use may generate either warnings (with -ansi), or errors
|
---|
454 | // (with -pedantic -ansi) unless it's use is prefixed by __extension__
|
---|
455 | //
|
---|
456 | #if defined(BOOST_HAS_LONG_LONG)
|
---|
457 | namespace boost{
|
---|
458 | # ifdef __GNUC__
|
---|
459 | __extension__ typedef long long long_long_type;
|
---|
460 | __extension__ typedef unsigned long long ulong_long_type;
|
---|
461 | # else
|
---|
462 | typedef long long long_long_type;
|
---|
463 | typedef unsigned long long ulong_long_type;
|
---|
464 | # endif
|
---|
465 | }
|
---|
466 | #endif
|
---|
467 |
|
---|
468 | // BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
|
---|
469 | //
|
---|
470 | // Some compilers have problems with function templates whose template
|
---|
471 | // parameters don't appear in the function parameter list (basically
|
---|
472 | // they just link one instantiation of the template in the final
|
---|
473 | // executable). These macros provide a uniform way to cope with the
|
---|
474 | // problem with no effects on the calling syntax.
|
---|
475 |
|
---|
476 | // Example:
|
---|
477 | //
|
---|
478 | // #include <iostream>
|
---|
479 | // #include <ostream>
|
---|
480 | // #include <typeinfo>
|
---|
481 | //
|
---|
482 | // template <int n>
|
---|
483 | // void f() { std::cout << n << ' '; }
|
---|
484 | //
|
---|
485 | // template <typename T>
|
---|
486 | // void g() { std::cout << typeid(T).name() << ' '; }
|
---|
487 | //
|
---|
488 | // int main() {
|
---|
489 | // f<1>();
|
---|
490 | // f<2>();
|
---|
491 | //
|
---|
492 | // g<int>();
|
---|
493 | // g<double>();
|
---|
494 | // }
|
---|
495 | //
|
---|
496 | // With VC++ 6.0 the output is:
|
---|
497 | //
|
---|
498 | // 2 2 double double
|
---|
499 | //
|
---|
500 | // To fix it, write
|
---|
501 | //
|
---|
502 | // template <int n>
|
---|
503 | // void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
|
---|
504 | //
|
---|
505 | // template <typename T>
|
---|
506 | // void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }
|
---|
507 | //
|
---|
508 |
|
---|
509 |
|
---|
510 | #if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
---|
511 |
|
---|
512 | # include "boost/type.hpp"
|
---|
513 | # include "boost/non_type.hpp"
|
---|
514 |
|
---|
515 | # define BOOST_EXPLICIT_TEMPLATE_TYPE(t) boost::type<t>* = 0
|
---|
516 | # define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type<t>*
|
---|
517 | # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type<t, v>* = 0
|
---|
518 | # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type<t, v>*
|
---|
519 |
|
---|
520 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
|
---|
521 | , BOOST_EXPLICIT_TEMPLATE_TYPE(t)
|
---|
522 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
|
---|
523 | , BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
---|
524 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
|
---|
525 | , BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
---|
526 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
|
---|
527 | , BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
---|
528 |
|
---|
529 | #else
|
---|
530 |
|
---|
531 | // no workaround needed: expand to nothing
|
---|
532 |
|
---|
533 | # define BOOST_EXPLICIT_TEMPLATE_TYPE(t)
|
---|
534 | # define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
---|
535 | # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
---|
536 | # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
---|
537 |
|
---|
538 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
|
---|
539 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
---|
540 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
---|
541 | # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
---|
542 |
|
---|
543 |
|
---|
544 | #endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
---|
545 |
|
---|
546 |
|
---|
547 | // ---------------------------------------------------------------------------//
|
---|
548 |
|
---|
549 | //
|
---|
550 | // Helper macro BOOST_STRINGIZE:
|
---|
551 | // Converts the parameter X to a string after macro replacement
|
---|
552 | // on X has been performed.
|
---|
553 | //
|
---|
554 | #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
|
---|
555 | #define BOOST_DO_STRINGIZE(X) #X
|
---|
556 |
|
---|
557 | //
|
---|
558 | // Helper macro BOOST_JOIN:
|
---|
559 | // The following piece of macro magic joins the two
|
---|
560 | // arguments together, even when one of the arguments is
|
---|
561 | // itself a macro (see 16.3.1 in C++ standard). The key
|
---|
562 | // is that macro expansion of macro arguments does not
|
---|
563 | // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
|
---|
564 | //
|
---|
565 | #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
|
---|
566 | #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
|
---|
567 | #define BOOST_DO_JOIN2( X, Y ) X##Y
|
---|
568 |
|
---|
569 | //
|
---|
570 | // Set some default values for compiler/library/platform names.
|
---|
571 | // These are for debugging config setup only:
|
---|
572 | //
|
---|
573 | # ifndef BOOST_COMPILER
|
---|
574 | # define BOOST_COMPILER "Unknown ISO C++ Compiler"
|
---|
575 | # endif
|
---|
576 | # ifndef BOOST_STDLIB
|
---|
577 | # define BOOST_STDLIB "Unknown ISO standard library"
|
---|
578 | # endif
|
---|
579 | # ifndef BOOST_PLATFORM
|
---|
580 | # if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
|
---|
581 | || defined(_POSIX_SOURCE)
|
---|
582 | # define BOOST_PLATFORM "Generic Unix"
|
---|
583 | # else
|
---|
584 | # define BOOST_PLATFORM "Unknown"
|
---|
585 | # endif
|
---|
586 | # endif
|
---|
587 |
|
---|
588 | #endif
|
---|
589 |
|
---|
590 |
|
---|