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