annotate DEPENDENCIES/generic/include/boost/log/detail/config.hpp @ 133:4acb5d8d80b6 tip

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