]> git.lyx.org Git - lyx.git/blob - boost/boost/config/suffix.hpp
update from Boost CVS
[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 # ifndef BOOST_DECL
21 #   define BOOST_DECL  // default for compilers not needing this decoration.
22 # endif
23
24 //
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.
29 //
30 #include <limits.h>
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
35 #endif
36 #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T)
37 #  define BOOST_NO_INTEGRAL_INT64_T
38 #endif
39
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
42 // it under GCC 3.x.
43 #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
44 #  undef BOOST_NO_CTYPE_FUNCTIONS
45 #endif
46
47
48 //
49 // Assume any extensions are in namespace std:: unless stated otherwise:
50 //
51 #  ifndef BOOST_STD_EXTENSION_NAMESPACE
52 #    define BOOST_STD_EXTENSION_NAMESPACE std
53 #  endif
54
55 //
56 // If cv-qualified specializations are not allowed, then neither are cv-void ones:
57 //
58 #  if defined(BOOST_NO_CV_SPECIALIZATIONS) \
59       && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
60 #     define BOOST_NO_CV_VOID_SPECIALIZATIONS
61 #  endif
62
63 //
64 // If there is no numeric_limits template, then it can't have any compile time
65 // constants either!
66 //
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
72 #  endif
73
74 //
75 // if there is no long long then there is no specialisation
76 // for numeric_limits<long long> either:
77 //
78 #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
79 #  define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
80 #endif
81
82 //
83 // if there is no __int64 then there is no specialisation
84 // for numeric_limits<__int64> either:
85 //
86 #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
87 #  define BOOST_NO_MS_INT64_NUMERIC_LIMITS
88 #endif
89
90 //
91 // if member templates are supported then so is the
92 // VC6 subset of member templates:
93 //
94 #  if !defined(BOOST_NO_MEMBER_TEMPLATES) \
95        && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
96 #     define BOOST_MSVC6_MEMBER_TEMPLATES
97 #  endif
98
99 //
100 // Without partial specialization, can't test for partial specialisation bugs:
101 //
102 #  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
103       && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
104 #     define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
105 #  endif
106
107 //
108 // Without partial specialization, std::iterator_traits can't work:
109 //
110 #  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
111       && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
112 #     define BOOST_NO_STD_ITERATOR_TRAITS
113 #  endif
114
115 //
116 // Without member template support, we can't have template constructors
117 // in the standard library either:
118 //
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
123 #  endif
124
125 //
126 // Without member template support, we can't have a conforming
127 // std::allocator template either:
128 //
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
133 #  endif
134
135 //
136 // We can't have a working std::use_facet if there is no std::locale:
137 //
138 #  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
139 #     define BOOST_NO_STD_USE_FACET
140 #  endif
141
142 //
143 // We can't have a std::messages facet if there is no std::locale:
144 //
145 #  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
146 #     define BOOST_NO_STD_MESSAGES
147 #  endif
148
149 //
150 // We can't have a working std::wstreambuf if there is no std::locale:
151 //
152 #  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
153 #     define BOOST_NO_STD_WSTREAMBUF
154 #  endif
155
156 //
157 // We can't have a <cwctype> if there is no <cwchar>:
158 //
159 #  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
160 #     define BOOST_NO_CWCTYPE
161 #  endif
162
163 //
164 // We can't have a swprintf if there is no <cwchar>:
165 //
166 #  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
167 #     define BOOST_NO_SWPRINTF
168 #  endif
169
170 //
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:
174 //
175 #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
176    && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
177 #  define BOOST_DISABLE_THREADS
178 #endif
179
180 //
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):
185 //
186 #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
187     || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
188 #  define BOOST_HAS_THREADS
189 #endif
190
191 //
192 // Turn threading support off if BOOST_DISABLE_THREADS is defined:
193 //
194 #if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
195 #  undef BOOST_HAS_THREADS
196 #endif
197
198 //
199 // Turn threading support off if we don't recognise the threading API:
200 //
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
205 #endif
206
207 //
208 // If the compiler claims to be C99 conformant, then it had better
209 // have a <stdint.h>:
210 //
211 #  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
212 #     define BOOST_HAS_STDINT_H
213 #  endif
214
215 //
216 // Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
217 // Note that this is for backwards compatibility only.
218 //
219 #  ifndef BOOST_HAS_SLIST
220 #     define BOOST_NO_SLIST
221 #  endif
222
223 #  ifndef BOOST_HAS_HASH
224 #     define BOOST_NO_HASH
225 #  endif
226
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.
235
236 # ifdef BOOST_NO_STDC_NAMESPACE
237 #   include <cstddef>
238     namespace std { using ::ptrdiff_t; using ::size_t; }
239 # endif
240
241 //  BOOST_NO_STD_MIN_MAX workaround  -----------------------------------------//
242
243 #  ifdef BOOST_NO_STD_MIN_MAX
244
245 namespace std {
246   template <class _Tp>
247   inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
248     return __b < __a ? __b : __a;
249   }
250   template <class _Tp>
251   inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
252     return  __a < __b ? __b : __a;
253   }
254 }
255
256 #  endif
257
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.
263
264 #  ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
265 #       define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
266 #  else
267 #     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
268 #  endif
269
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.
274 // Usage:
275 //    replace
276 //       std::use_facet<Type>(loc);
277 //    with
278 //       BOOST_USE_FACET(Type, loc);
279 //    Note do not add a std:: prefix to the front of BOOST_USE_FACET!
280
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))
288 #  endif
289 #else
290 #  define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
291 #endif
292
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:
296 //
297 // typedef typename A::template rebind<U> binder;
298 //
299 // with:
300 //
301 // typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
302
303 #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
304 #  define BOOST_NESTED_TEMPLATE template
305 #else
306 #  define BOOST_NESTED_TEMPLATE
307 #endif
308
309 // ---------------------------------------------------------------------------//
310
311 //
312 // Helper macro BOOST_STRINGIZE:
313 // Converts the parameter X to a string after macro replacement
314 // on X has been performed.
315 //
316 #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
317 #define BOOST_DO_STRINGIZE(X) #X
318
319 //
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.
326 //
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
330
331 //
332 // Set some default values for compiler/library/platform names.
333 // These are for debugging config setup only:
334 //
335 #  ifndef BOOST_COMPILER
336 #     define BOOST_COMPILER "Unknown ISO C++ Compiler"
337 #  endif
338 #  ifndef BOOST_STDLIB
339 #     define BOOST_STDLIB "Unknown ISO standard library"
340 #  endif
341 #  ifndef BOOST_PLATFORM
342 #     if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
343          || defined(_POSIX_SOURCE)
344 #        define BOOST_PLATFORM "Generic Unix"
345 #     else
346 #        define BOOST_PLATFORM "Unknown"
347 #     endif
348 #  endif
349
350 #endif
351
352