]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/include/boost/log/detail/config.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / log / include / boost / log / detail / config.hpp
1 /*
2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
6 */
7 /*!
8 * \file config.hpp
9 * \author Andrey Semashev
10 * \date 08.03.2007
11 *
12 * \brief This header is the Boost.Log library implementation, see the library documentation
13 * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. In this file
14 * internal configuration macros are defined.
15 */
16
17 #ifndef BOOST_LOG_DETAIL_CONFIG_HPP_INCLUDED_
18 #define BOOST_LOG_DETAIL_CONFIG_HPP_INCLUDED_
19
20 // This check must be before any system headers are included, or __MSVCRT_VERSION__ may get defined to 0x0600
21 #if defined(__MINGW32__) && !defined(__MSVCRT_VERSION__)
22 // Target MinGW headers to at least MSVC 7.0 runtime by default. This will enable some useful functions.
23 #define __MSVCRT_VERSION__ 0x0700
24 #endif
25
26 #include <boost/predef/os.h>
27
28 // Try including WinAPI config as soon as possible so that any other headers don't include Windows SDK headers
29 #if defined(BOOST_OS_WINDOWS_AVAILABLE)
30 #include <boost/detail/winapi/config.hpp>
31 #endif
32
33 #include <limits.h> // To bring in libc macros
34 #include <boost/config.hpp>
35
36 // The library requires dynamic_cast in a few places
37 #if defined(BOOST_NO_RTTI)
38 # error Boost.Log: RTTI is required by the library
39 #endif
40
41 #if defined(_MSC_VER) && _MSC_VER >= 1600
42 # define BOOST_LOG_HAS_PRAGMA_DETECT_MISMATCH
43 #endif
44
45 #if defined(BOOST_LOG_HAS_PRAGMA_DETECT_MISMATCH)
46 #include <boost/preprocessor/stringize.hpp>
47 #endif
48
49 #if !defined(BOOST_WINDOWS)
50 # ifndef BOOST_LOG_WITHOUT_DEBUG_OUTPUT
51 # define BOOST_LOG_WITHOUT_DEBUG_OUTPUT
52 # endif
53 # ifndef BOOST_LOG_WITHOUT_EVENT_LOG
54 # define BOOST_LOG_WITHOUT_EVENT_LOG
55 # endif
56 #endif
57
58 #ifdef BOOST_HAS_PRAGMA_ONCE
59 #pragma once
60 #endif
61
62 #if defined(BOOST_MSVC)
63 // For some reason MSVC 9.0 fails to link the library if static integral constants are defined in cpp
64 # define BOOST_LOG_BROKEN_STATIC_CONSTANTS_LINKAGE
65 # if _MSC_VER <= 1310
66 // MSVC 7.1 sometimes fails to match out-of-class template function definitions with
67 // their declarations if the return type or arguments of the functions involve typename keyword
68 // and depend on the template parameters.
69 # define BOOST_LOG_BROKEN_TEMPLATE_DEFINITION_MATCHING
70 # endif
71 # if _MSC_VER <= 1400
72 // Older MSVC versions reject friend declarations for class template specializations
73 # define BOOST_LOG_BROKEN_FRIEND_TEMPLATE_SPECIALIZATIONS
74 # endif
75 # if _MSC_VER <= 1600
76 // MSVC up to 10.0 attempts to invoke copy constructor when initializing a const reference from rvalue returned from a function.
77 // This fails when the returned value cannot be copied (only moved):
78 //
79 // class base {};
80 // class derived : public base { BOOST_MOVABLE_BUT_NOT_COPYABLE(derived) };
81 // derived foo();
82 // base const& var = foo(); // attempts to call copy constructor of derived
83 # define BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT
84 # endif
85 # if !defined(_STLPORT_VERSION)
86 // MSVC 9.0 mandates packaging of STL classes, which apparently affects alignment and
87 // makes alignment_of< T >::value no longer be a power of 2 for types that derive from STL classes.
88 // This breaks type_with_alignment and everything that relies on it.
89 // This doesn't happen with non-native STLs, such as STLPort. Strangely, this doesn't show with
90 // STL classes themselves or most of the user-defined derived classes.
91 // Not sure if that happens with other MSVC versions.
92 // See: http://svn.boost.org/trac/boost/ticket/1946
93 # define BOOST_LOG_BROKEN_STL_ALIGNMENT
94 # endif
95 #endif
96
97 #if defined(BOOST_INTEL) || defined(__SUNPRO_CC)
98 // Intel compiler and Sun Studio 12.3 have problems with friend declarations for nested class templates
99 # define BOOST_LOG_NO_MEMBER_TEMPLATE_FRIENDS
100 #endif
101
102 #if defined(BOOST_MSVC) && BOOST_MSVC <= 1600
103 // MSVC cannot interpret constant expressions in certain contexts, such as non-type template parameters
104 # define BOOST_LOG_BROKEN_CONSTANT_EXPRESSIONS
105 #endif
106
107 #if defined(BOOST_NO_CXX11_HDR_CODECVT)
108 // The compiler does not support std::codecvt<char16_t> and std::codecvt<char32_t> specializations.
109 // The BOOST_NO_CXX11_HDR_CODECVT means there's no usable <codecvt>, which is slightly different from this macro.
110 // But in order for <codecvt> to be implemented the std::codecvt specializations have to be implemented as well.
111 # define BOOST_LOG_NO_CXX11_CODECVT_FACETS
112 #endif
113
114 #if defined(__CYGWIN__)
115 // Boost.ASIO is broken on Cygwin
116 # define BOOST_LOG_NO_ASIO
117 #endif
118
119 #if !defined(BOOST_LOG_USE_NATIVE_SYSLOG) && defined(BOOST_LOG_NO_ASIO)
120 # ifndef BOOST_LOG_WITHOUT_SYSLOG
121 # define BOOST_LOG_WITHOUT_SYSLOG
122 # endif
123 #endif
124
125 #if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 2)
126 // GCC 4.1 and 4.2 have buggy anonymous namespaces support, which interferes with symbol linkage
127 # define BOOST_LOG_ANONYMOUS_NAMESPACE namespace anonymous {} using namespace anonymous; namespace anonymous
128 #else
129 # define BOOST_LOG_ANONYMOUS_NAMESPACE namespace
130 #endif
131
132 #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || (defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 6))
133 // GCC up to 4.6 (inclusively) did not support expanding template argument packs into non-variadic template arguments
134 #define BOOST_LOG_NO_CXX11_ARG_PACKS_TO_NON_VARIADIC_ARGS_EXPANSION
135 #endif
136
137 #if defined(BOOST_NO_CXX11_CONSTEXPR) || (defined(BOOST_GCC) && ((BOOST_GCC+0) / 100) <= 406)
138 // GCC 4.6 does not support in-class brace initializers for static constexpr array members
139 #define BOOST_LOG_NO_CXX11_CONSTEXPR_DATA_MEMBER_BRACE_INITIALIZERS
140 #endif
141
142 #if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || (defined(BOOST_GCC) && ((BOOST_GCC+0) / 100) <= 406)
143 // GCC 4.6 cannot handle a defaulted function with noexcept specifier
144 #define BOOST_LOG_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
145 #endif
146
147 #if defined(_MSC_VER)
148 # define BOOST_LOG_NO_VTABLE __declspec(novtable)
149 #elif defined(__GNUC__)
150 # define BOOST_LOG_NO_VTABLE
151 #else
152 # define BOOST_LOG_NO_VTABLE
153 #endif
154
155 // An MS-like compilers' extension that allows to optimize away the needless code
156 #if defined(_MSC_VER)
157 # define BOOST_LOG_ASSUME(expr) __assume(expr)
158 #else
159 # define BOOST_LOG_ASSUME(expr)
160 #endif
161
162 // The statement marking unreachable branches of code to avoid warnings
163 #if defined(BOOST_CLANG)
164 # if __has_builtin(__builtin_unreachable)
165 # define BOOST_LOG_UNREACHABLE() __builtin_unreachable()
166 # endif
167 #elif defined(__GNUC__)
168 # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
169 # define BOOST_LOG_UNREACHABLE() __builtin_unreachable()
170 # endif
171 #elif defined(_MSC_VER)
172 # define BOOST_LOG_UNREACHABLE() __assume(0)
173 #endif
174 #if !defined(BOOST_LOG_UNREACHABLE)
175 # define BOOST_LOG_UNREACHABLE()
176 # define BOOST_LOG_UNREACHABLE_RETURN(r) return r
177 #else
178 # define BOOST_LOG_UNREACHABLE_RETURN(r) BOOST_LOG_UNREACHABLE()
179 #endif
180
181 // The macro efficiently returns a local lvalue from a function.
182 // It employs NRVO, if supported by compiler, or uses a move constructor otherwise.
183 #if defined(BOOST_HAS_NRVO)
184 #define BOOST_LOG_NRVO_RESULT(x) x
185 #else
186 #define BOOST_LOG_NRVO_RESULT(x) boost::move(x)
187 #endif
188
189 // Some compilers support a special attribute that shows that a function won't return
190 #if defined(__GNUC__) || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590)
191 // GCC and Sun Studio 12 support attribute syntax
192 # define BOOST_LOG_NORETURN __attribute__((noreturn))
193 #elif defined (_MSC_VER)
194 // Microsoft-compatible compilers go here
195 # define BOOST_LOG_NORETURN __declspec(noreturn)
196 #else
197 // The rest compilers might emit bogus warnings about missing return statements
198 // in functions with non-void return types when throw_exception is used.
199 # define BOOST_LOG_NORETURN
200 #endif
201
202 // GCC and compatible compilers may require marking types that may alias other types
203 #if defined(__GNUC__)
204 # define BOOST_LOG_MAY_ALIAS __attribute__ ((__may_alias__))
205 #else
206 # define BOOST_LOG_MAY_ALIAS
207 #endif
208
209 #if !defined(BOOST_LOG_BUILDING_THE_LIB)
210
211 // Detect if we're dealing with dll
212 # if defined(BOOST_LOG_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
213 # define BOOST_LOG_DLL
214 # endif
215
216 # if defined(BOOST_LOG_DLL)
217 # define BOOST_LOG_API BOOST_SYMBOL_IMPORT
218 # else
219 # define BOOST_LOG_API
220 # endif
221 //
222 // Automatically link to the correct build variant where possible.
223 //
224 # if !defined(BOOST_ALL_NO_LIB)
225 # if !defined(BOOST_LOG_NO_LIB)
226 # define BOOST_LIB_NAME boost_log
227 # if defined(BOOST_LOG_DLL)
228 # define BOOST_DYN_LINK
229 # endif
230 # include <boost/config/auto_link.hpp>
231 # endif
232 // In static-library builds compilers ignore auto-link comments from Boost.Log binary to
233 // other Boost libraries. We explicitly add comments here for other libraries.
234 // In dynamic-library builds this is not needed.
235 # if !defined(BOOST_LOG_DLL)
236 # include <boost/system/config.hpp>
237 # include <boost/filesystem/config.hpp>
238 # if !defined(BOOST_DATE_TIME_NO_LIB) && !defined(BOOST_DATE_TIME_SOURCE)
239 # define BOOST_LIB_NAME boost_date_time
240 # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
241 # define BOOST_DYN_LINK
242 # endif
243 # include <boost/config/auto_link.hpp>
244 # endif
245 // Boost.Thread's config is included below, if needed
246 # endif
247 # endif // auto-linking disabled
248
249 #else // !defined(BOOST_LOG_BUILDING_THE_LIB)
250
251 # if defined(BOOST_LOG_DLL)
252 # define BOOST_LOG_API BOOST_SYMBOL_EXPORT
253 # else
254 # define BOOST_LOG_API BOOST_SYMBOL_VISIBLE
255 # endif
256
257 #endif // !defined(BOOST_LOG_BUILDING_THE_LIB)
258
259 // By default we provide support for both char and wchar_t
260 #if !defined(BOOST_LOG_WITHOUT_CHAR)
261 # define BOOST_LOG_USE_CHAR
262 #endif
263 #if !defined(BOOST_LOG_WITHOUT_WCHAR_T)
264 # define BOOST_LOG_USE_WCHAR_T
265 #endif
266
267 #if !defined(BOOST_LOG_DOXYGEN_PASS)
268 // Check if multithreading is supported
269 # if !defined(BOOST_LOG_NO_THREADS) && !defined(BOOST_HAS_THREADS)
270 # define BOOST_LOG_NO_THREADS
271 # endif // !defined(BOOST_LOG_NO_THREADS) && !defined(BOOST_HAS_THREADS)
272 #endif // !defined(BOOST_LOG_DOXYGEN_PASS)
273
274 #if !defined(BOOST_LOG_NO_THREADS)
275 // We need this header to (i) enable auto-linking with Boost.Thread and
276 // (ii) to bring in configuration macros of Boost.Thread.
277 # include <boost/thread/detail/config.hpp>
278 #endif // !defined(BOOST_LOG_NO_THREADS)
279
280 #if !defined(BOOST_LOG_NO_THREADS)
281 # define BOOST_LOG_EXPR_IF_MT(expr) expr
282 #else
283 # undef BOOST_LOG_USE_COMPILER_TLS
284 # define BOOST_LOG_EXPR_IF_MT(expr)
285 #endif // !defined(BOOST_LOG_NO_THREADS)
286
287 #if defined(BOOST_LOG_USE_COMPILER_TLS)
288 # if defined(__GNUC__) || defined(__SUNPRO_CC)
289 # define BOOST_LOG_TLS __thread
290 # elif defined(BOOST_MSVC)
291 # define BOOST_LOG_TLS __declspec(thread)
292 # else
293 # undef BOOST_LOG_USE_COMPILER_TLS
294 # endif
295 #endif // defined(BOOST_LOG_USE_COMPILER_TLS)
296
297 #ifndef BOOST_LOG_CPU_CACHE_LINE_SIZE
298 //! The macro defines the CPU cache line size for the target architecture. This is mostly used for optimization.
299 #define BOOST_LOG_CPU_CACHE_LINE_SIZE 64
300 #endif
301
302 namespace boost {
303
304 // Setup namespace name
305 #if !defined(BOOST_LOG_DOXYGEN_PASS)
306 # if defined(BOOST_LOG_DLL)
307 # if defined(BOOST_LOG_NO_THREADS)
308 # define BOOST_LOG_VERSION_NAMESPACE v2_st
309 # else
310 # if defined(BOOST_THREAD_PLATFORM_PTHREAD)
311 # define BOOST_LOG_VERSION_NAMESPACE v2_mt_posix
312 # elif defined(BOOST_THREAD_PLATFORM_WIN32)
313 # if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
314 # define BOOST_LOG_VERSION_NAMESPACE v2_mt_nt6
315 # else
316 # define BOOST_LOG_VERSION_NAMESPACE v2_mt_nt5
317 # endif
318 # else
319 # define BOOST_LOG_VERSION_NAMESPACE v2_mt
320 # endif
321 # endif // defined(BOOST_LOG_NO_THREADS)
322 # else
323 # if defined(BOOST_LOG_NO_THREADS)
324 # define BOOST_LOG_VERSION_NAMESPACE v2s_st
325 # else
326 # if defined(BOOST_THREAD_PLATFORM_PTHREAD)
327 # define BOOST_LOG_VERSION_NAMESPACE v2s_mt_posix
328 # elif defined(BOOST_THREAD_PLATFORM_WIN32)
329 # if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
330 # define BOOST_LOG_VERSION_NAMESPACE v2s_mt_nt6
331 # else
332 # define BOOST_LOG_VERSION_NAMESPACE v2s_mt_nt5
333 # endif
334 # else
335 # define BOOST_LOG_VERSION_NAMESPACE v2s_mt
336 # endif
337 # endif // defined(BOOST_LOG_NO_THREADS)
338 # endif // defined(BOOST_LOG_DLL)
339
340
341 namespace log {
342
343 # if !defined(BOOST_NO_CXX11_INLINE_NAMESPACES)
344
345 inline namespace BOOST_LOG_VERSION_NAMESPACE {}
346 }
347
348 # define BOOST_LOG_OPEN_NAMESPACE namespace log { inline namespace BOOST_LOG_VERSION_NAMESPACE {
349 # define BOOST_LOG_CLOSE_NAMESPACE }}
350
351 # else
352
353 namespace BOOST_LOG_VERSION_NAMESPACE {}
354
355 using namespace BOOST_LOG_VERSION_NAMESPACE
356 # if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && !defined(__clang__)
357 __attribute__((__strong__))
358 # endif
359 ;
360
361 }
362
363 # define BOOST_LOG_OPEN_NAMESPACE namespace log { namespace BOOST_LOG_VERSION_NAMESPACE {
364 # define BOOST_LOG_CLOSE_NAMESPACE }}
365 # endif
366
367 #else // !defined(BOOST_LOG_DOXYGEN_PASS)
368
369 namespace log {}
370 # define BOOST_LOG_OPEN_NAMESPACE namespace log {
371 # define BOOST_LOG_CLOSE_NAMESPACE }
372
373 #endif // !defined(BOOST_LOG_DOXYGEN_PASS)
374
375 #if defined(BOOST_LOG_HAS_PRAGMA_DETECT_MISMATCH)
376 #pragma detect_mismatch("boost_log_abi", BOOST_PP_STRINGIZE(BOOST_LOG_VERSION_NAMESPACE))
377 #endif
378
379 } // namespace boost
380
381 #endif // BOOST_LOG_DETAIL_CONFIG_HPP_INCLUDED_