]> git.lyx.org Git - lyx.git/blob - boost/boost/config/suffix.hpp
update boost to pre-1.30.0
[lyx.git] / boost / boost / config / suffix.hpp
1 //  Boost config.hpp configuration header file  ------------------------------//
2
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.
7
8 //  See http://www.boost.org for most recent version.
9
10 //  Boost config.hpp policy and rationale documentation has been moved to
11 //  http://www.boost.org/libs/config
12 //
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.
16
17 #ifndef BOOST_CONFIG_SUFFIX_HPP
18 #define BOOST_CONFIG_SUFFIX_HPP
19
20 //
21 // look for long long by looking for the appropriate macros in <limits.h>.
22 // Note that we use limits.h rather than climits for maximal portability,
23 // remember that since these just declare a bunch of macros, there should be
24 // no namespace issues from this.
25 //
26 #include <limits.h>
27 # if !defined(BOOST_HAS_LONG_LONG)                                              \
28    && !(defined(BOOST_MSVC) && BOOST_MSVC <=1300) && !defined(__BORLANDC__)     \
29    && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
30 #  define BOOST_HAS_LONG_LONG
31 #endif
32 #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T)
33 #  define BOOST_NO_INTEGRAL_INT64_T
34 #endif
35
36 // GCC 3.x will clean up all of those nasty macro definitions that
37 // BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
38 // it under GCC 3.x.
39 #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
40 #  undef BOOST_NO_CTYPE_FUNCTIONS
41 #endif
42
43
44 //
45 // Assume any extensions are in namespace std:: unless stated otherwise:
46 //
47 #  ifndef BOOST_STD_EXTENSION_NAMESPACE
48 #    define BOOST_STD_EXTENSION_NAMESPACE std
49 #  endif
50
51 //
52 // If cv-qualified specializations are not allowed, then neither are cv-void ones:
53 //
54 #  if defined(BOOST_NO_CV_SPECIALIZATIONS) \
55       && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
56 #     define BOOST_NO_CV_VOID_SPECIALIZATIONS
57 #  endif
58
59 //
60 // If there is no numeric_limits template, then it can't have any compile time
61 // constants either!
62 //
63 #  if defined(BOOST_NO_LIMITS) \
64       && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
65 #     define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
66 #     define BOOST_NO_MS_INT64_NUMERIC_LIMITS
67 #     define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
68 #  endif
69
70 //
71 // if there is no long long then there is no specialisation
72 // for numeric_limits<long long> either:
73 //
74 #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
75 #  define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
76 #endif
77
78 //
79 // if there is no __int64 then there is no specialisation
80 // for numeric_limits<__int64> either:
81 //
82 #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
83 #  define BOOST_NO_MS_INT64_NUMERIC_LIMITS
84 #endif
85
86 //
87 // if member templates are supported then so is the
88 // VC6 subset of member templates:
89 //
90 #  if !defined(BOOST_NO_MEMBER_TEMPLATES) \
91        && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
92 #     define BOOST_MSVC6_MEMBER_TEMPLATES
93 #  endif
94
95 //
96 // Without partial specialization, can't test for partial specialisation bugs:
97 //
98 #  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
99       && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
100 #     define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
101 #  endif
102
103 //
104 // Without partial specialization, std::iterator_traits can't work:
105 //
106 #  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
107       && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
108 #     define BOOST_NO_STD_ITERATOR_TRAITS
109 #  endif
110
111 //
112 // Without member template support, we can't have template constructors
113 // in the standard library either:
114 //
115 #  if defined(BOOST_NO_MEMBER_TEMPLATES) \
116       && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
117       && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
118 #     define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
119 #  endif
120
121 //
122 // Without member template support, we can't have a conforming
123 // std::allocator template either:
124 //
125 #  if defined(BOOST_NO_MEMBER_TEMPLATES) \
126       && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
127       && !defined(BOOST_NO_STD_ALLOCATOR)
128 #     define BOOST_NO_STD_ALLOCATOR
129 #  endif
130
131 //
132 // If we have a standard allocator, then we have a partial one as well:
133 //
134 #if !defined(BOOST_NO_STD_ALLOCATOR)
135 #  define BOOST_HAS_PARTIAL_STD_ALLOCATOR
136 #endif
137
138 //
139 // We can't have a working std::use_facet if there is no std::locale:
140 //
141 #  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
142 #     define BOOST_NO_STD_USE_FACET
143 #  endif
144
145 //
146 // We can't have a std::messages facet if there is no std::locale:
147 //
148 #  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
149 #     define BOOST_NO_STD_MESSAGES
150 #  endif
151
152 //
153 // We can't have a working std::wstreambuf if there is no std::locale:
154 //
155 #  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
156 #     define BOOST_NO_STD_WSTREAMBUF
157 #  endif
158
159 //
160 // We can't have a <cwctype> if there is no <cwchar>:
161 //
162 #  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
163 #     define BOOST_NO_CWCTYPE
164 #  endif
165
166 //
167 // We can't have a swprintf if there is no <cwchar>:
168 //
169 #  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
170 #     define BOOST_NO_SWPRINTF
171 #  endif
172
173 //
174 // If Win32 support is turned off, then we must turn off
175 // threading support also, unless there is some other
176 // thread API enabled:
177 //
178 #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
179    && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
180 #  define BOOST_DISABLE_THREADS
181 #endif
182
183 //
184 // Turn on threading support if the compiler thinks that it's in
185 // multithreaded mode.  We put this here because there are only a
186 // limited number of macros that identify this (if there's any missing
187 // from here then add to the appropriate compiler section):
188 //
189 #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
190     || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
191 #  define BOOST_HAS_THREADS
192 #endif
193
194 //
195 // Turn threading support off if BOOST_DISABLE_THREADS is defined:
196 //
197 #if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
198 #  undef BOOST_HAS_THREADS
199 #endif
200
201 //
202 // Turn threading support off if we don't recognise the threading API:
203 //
204 #if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
205       && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
206       && !defined(BOOST_HAS_MPTASKS)
207 #  undef BOOST_HAS_THREADS
208 #endif
209
210 //
211 // If the compiler claims to be C99 conformant, then it had better
212 // have a <stdint.h>:
213 //
214 #  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
215 #     define BOOST_HAS_STDINT_H
216 #  endif
217
218 //
219 // Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
220 // Note that this is for backwards compatibility only.
221 //
222 #  ifndef BOOST_HAS_SLIST
223 #     define BOOST_NO_SLIST
224 #  endif
225
226 #  ifndef BOOST_HAS_HASH
227 #     define BOOST_NO_HASH
228 #  endif
229
230 //  BOOST_NO_STDC_NAMESPACE workaround  --------------------------------------//
231 //  Because std::size_t usage is so common, even in boost headers which do not
232 //  otherwise use the C library, the <cstddef> workaround is included here so
233 //  that ugly workaround code need not appear in many other boost headers.
234 //  NOTE WELL: This is a workaround for non-conforming compilers; <cstddef> 
235 //  must still be #included in the usual places so that <cstddef> inclusion
236 //  works as expected with standard conforming compilers.  The resulting
237 //  double inclusion of <cstddef> is harmless.
238
239 # ifdef BOOST_NO_STDC_NAMESPACE
240 #   include <cstddef>
241     namespace std { using ::ptrdiff_t; using ::size_t; }
242 # endif
243
244 //  BOOST_NO_STD_MIN_MAX workaround  -----------------------------------------//
245
246 #  ifdef BOOST_NO_STD_MIN_MAX
247
248 namespace std {
249   template <class _Tp>
250   inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
251     return __b < __a ? __b : __a;
252   }
253   template <class _Tp>
254   inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
255     return  __a < __b ? __b : __a;
256   }
257 }
258
259 #  endif
260
261 // BOOST_STATIC_CONSTANT workaround --------------------------------------- //
262 // On compilers which don't allow in-class initialization of static integral
263 // constant members, we must use enums as a workaround if we want the constants
264 // to be available at compile-time. This macro gives us a convenient way to
265 // declare such constants.
266
267 #  ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
268 #       define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
269 #  else
270 #     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
271 #  endif
272
273 // BOOST_USE_FACET workaround ----------------------------------------------//
274 // When the standard library does not have a conforming std::use_facet there
275 // are various workarounds available, but they differ from library to library.
276 // This macro provides a consistent way to access a locale's facets.
277 // Usage:
278 //    replace
279 //       std::use_facet<Type>(loc);
280 //    with
281 //       BOOST_USE_FACET(Type, loc);
282 //    Note do not add a std:: prefix to the front of BOOST_USE_FACET!
283
284 #if defined(BOOST_NO_STD_USE_FACET)
285 #  ifdef BOOST_HAS_TWO_ARG_USE_FACET
286 #     define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
287 #  elif defined(BOOST_HAS_MACRO_USE_FACET)
288 #     define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
289 #  elif defined(BOOST_HAS_STLP_USE_FACET)
290 #     define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
291 #  endif
292 #else
293 #  define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
294 #endif
295
296 // BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
297 // Member templates are supported by some compilers even though they can't use
298 // the A::template member<U> syntax, as a workaround replace:
299 //
300 // typedef typename A::template rebind<U> binder;
301 //
302 // with:
303 //
304 // typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
305
306 #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
307 #  define BOOST_NESTED_TEMPLATE template
308 #else
309 #  define BOOST_NESTED_TEMPLATE
310 #endif
311
312 // BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------//
313 // Normally evaluates to nothing, unless BOOST_NO_UNREACHABLE_RETURN_DETECTION
314 // is defined, in which case it evaluates to return x; Use when you have a return
315 // statement that can never be reached.
316
317 #ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
318 #  define BOOST_UNREACHABLE_RETURN(x) return x;
319 #else
320 #  define BOOST_UNREACHABLE_RETURN(x)
321 #endif
322
323 // BOOST_DEDUCED_TYPENAME workaround ------------------------------------------//
324 //
325 // Some compilers don't support the use of `typename' for dependent
326 // types in deduced contexts, e.g.
327 //
328 //     template <class T> void f(T, typename T::type);
329 //                                  ^^^^^^^^
330 // Replace these declarations with:
331 //
332 //     template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);
333
334 #ifndef BOOST_NO_DEDUCED_TYPENAME
335 #  define BOOST_DEDUCED_TYPENAME typename
336 #else 
337 #  define BOOST_DEDUCED_TYPENAME
338 #endif
339
340 // ---------------------------------------------------------------------------//
341
342 //
343 // Helper macro BOOST_STRINGIZE:
344 // Converts the parameter X to a string after macro replacement
345 // on X has been performed.
346 //
347 #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
348 #define BOOST_DO_STRINGIZE(X) #X
349
350 //
351 // Helper macro BOOST_JOIN:
352 // The following piece of macro magic joins the two 
353 // arguments together, even when one of the arguments is
354 // itself a macro (see 16.3.1 in C++ standard).  The key
355 // is that macro expansion of macro arguments does not
356 // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
357 //
358 #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
359 #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
360 #define BOOST_DO_JOIN2( X, Y ) X##Y
361
362 //
363 // Set some default values for compiler/library/platform names.
364 // These are for debugging config setup only:
365 //
366 #  ifndef BOOST_COMPILER
367 #     define BOOST_COMPILER "Unknown ISO C++ Compiler"
368 #  endif
369 #  ifndef BOOST_STDLIB
370 #     define BOOST_STDLIB "Unknown ISO standard library"
371 #  endif
372 #  ifndef BOOST_PLATFORM
373 #     if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
374          || defined(_POSIX_SOURCE)
375 #        define BOOST_PLATFORM "Generic Unix"
376 #     else
377 #        define BOOST_PLATFORM "Unknown"
378 #     endif
379 #  endif
380
381 #endif
382
383