update boost on linux

This commit is contained in:
Bassem Girgis
2019-08-10 16:06:25 -05:00
parent 76ad52be58
commit 861b918727
5363 changed files with 483306 additions and 116507 deletions

View File

@@ -19,8 +19,8 @@
#include <boost/move/core.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/detail/header.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE

View File

@@ -19,8 +19,8 @@
#include <string>
#include <boost/assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/detail/header.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
@@ -53,21 +53,21 @@ public:
typedef uint32_t id_type;
private:
enum { uninitialized = 0xFFFFFFFFu };
class repository;
friend class repository;
private:
//! Associated identifier
id_type m_id;
//! A special identifier value indicating unassigned attribute name
static BOOST_CONSTEXPR_OR_CONST id_type uninitialized = ~static_cast< id_type >(0u);
#endif
public:
/*!
* Default constructor. Creates an object that does not refer to any attribute name.
*/
BOOST_CONSTEXPR attribute_name() BOOST_NOEXCEPT : m_id(static_cast< id_type >(uninitialized))
BOOST_CONSTEXPR attribute_name() BOOST_NOEXCEPT : m_id(uninitialized)
{
}
/*!
@@ -111,7 +111,7 @@ public:
* \return \c true if <tt>*this</tt> and \c that refer to the same attribute name,
* and \c false otherwise.
*/
bool operator== (const char* that) const { return (m_id != static_cast< id_type >(uninitialized)) && (this->string() == that); }
bool operator== (const char* that) const { return (m_id != uninitialized) && (this->string() == that); }
/*!
* Compares the attribute names
*
@@ -126,7 +126,7 @@ public:
* \return \c true if <tt>*this</tt> and \c that refer to the same attribute name,
* and \c false otherwise.
*/
bool operator== (string_type const& that) const { return (m_id != static_cast< id_type >(uninitialized)) && (this->string() == that); }
bool operator== (string_type const& that) const { return (m_id != uninitialized) && (this->string() == that); }
/*!
* Compares the attribute names
*
@@ -147,7 +147,7 @@ public:
* \return \c true if <tt>*this</tt> was default-constructed and does not refer to any attribute name,
* \c false otherwise
*/
bool operator! () const BOOST_NOEXCEPT { return (m_id == static_cast< id_type >(uninitialized)); }
bool operator! () const BOOST_NOEXCEPT { return (m_id == uninitialized); }
/*!
* \return The associated id value
@@ -155,7 +155,7 @@ public:
*/
id_type id() const BOOST_NOEXCEPT
{
BOOST_ASSERT(m_id != static_cast< id_type >(uninitialized));
BOOST_ASSERT(m_id != uninitialized);
return m_id;
}
/*!

View File

@@ -18,8 +18,8 @@
#include <boost/type_index.hpp>
#include <boost/move/core.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/utility/type_dispatch/type_dispatcher.hpp>
#include <boost/log/attributes/attribute.hpp>
#include <boost/log/attributes/value_extraction_fwd.hpp>

View File

@@ -16,6 +16,7 @@
#ifndef BOOST_LOG_ATTRIBUTES_VALUE_VISITATION_HPP_INCLUDED_
#define BOOST_LOG_ATTRIBUTES_VALUE_VISITATION_HPP_INCLUDED_
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/exceptions.hpp>
#include <boost/log/core/record.hpp>
@@ -26,7 +27,6 @@
#include <boost/log/attributes/value_visitation_fwd.hpp>
#include <boost/log/attributes/fallback_policy.hpp>
#include <boost/log/expressions/keyword_fwd.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/utility/type_dispatch/static_type_dispatcher.hpp>
#include <boost/log/detail/header.hpp>

View File

@@ -16,8 +16,8 @@
#define BOOST_LOG_CORE_RECORD_HPP_INCLUDED_
#include <boost/move/core.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/attributes/attribute_value_set.hpp>
#include <boost/log/expressions/keyword_fwd.hpp>
#include <boost/log/core/record_view.hpp>

View File

@@ -18,8 +18,8 @@
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/attributes/attribute_value_set.hpp>
#include <boost/log/expressions/keyword_fwd.hpp>
#ifndef BOOST_LOG_NO_THREADS
@@ -110,7 +110,7 @@ public:
* \post <tt>!*this == true</tt>
*/
BOOST_CONSTEXPR record_view() BOOST_NOEXCEPT
#if !defined(BOOST_LOG_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS)
#if !defined(BOOST_LOG_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS) && !defined(BOOST_LOG_NO_CXX11_DEFAULTED_CONSTEXPR_CONSTRUCTORS)
= default;
#else
{}

View File

@@ -38,8 +38,8 @@
#if defined(BOOST_LOG_ADAPTIVE_MUTEX_USE_WINAPI)
#include <boost/log/detail/pause.hpp>
#include <boost/winapi/thread.hpp>
#include <boost/detail/interlocked.hpp>
#include <boost/detail/winapi/thread.hpp>
#if defined(__INTEL_COMPILER) || defined(_MSC_VER)
# if defined(__INTEL_COMPILER)
@@ -103,10 +103,10 @@ public:
{
// Restart spinning after waking up this thread
pause_count = initial_pause;
SwitchToThread();
boost::winapi::SwitchToThread();
}
#else
SwitchToThread();
boost::winapi::SwitchToThread();
#endif
}
}

View File

@@ -0,0 +1,77 @@
/*
* Copyright Andrey Semashev 2018.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file allocator_traits.hpp
* \author Andrey Semashev
* \date 03.01.2018
*
* \brief This header is the Boost.Log library implementation, see the library documentation
* at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
*/
#ifndef BOOST_LOG_ALLOCATOR_TRAITS_HPP_INCLUDED_
#define BOOST_LOG_ALLOCATOR_TRAITS_HPP_INCLUDED_
#include <memory>
#include <boost/log/detail/config.hpp>
#if defined(BOOST_NO_CXX11_ALLOCATOR)
#include <boost/container/allocator_traits.hpp>
#endif
#include <boost/log/detail/header.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
namespace aux {
// A portable name for allocator traits
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
using std::allocator_traits;
#else
using boost::container::allocator_traits;
#endif
/*!
* \brief A standalone trait to rebind an allocator to another type.
*
* The important difference from <tt>std::allocator_traits&lt;Alloc&gt;::rebind_alloc&lt;U&gt;</tt> is that this
* trait does not require template aliases and thus is compatible with C++03. There is
* <tt>boost::container::allocator_traits&lt;Alloc&gt;::portable_rebind_alloc&lt;U&gt;</tt>, but it is not present in <tt>std::allocator_traits</tt>.
* It will also attempt to instantiate the allocator type to test if it provides the nested <tt>rebind</tt> template. We don't want
* that to happen because it prohibits using <tt>std::allocator&lt;void&gt;</tt> in C++17 and later, which deprecated
* this allocator specialization. This standalone trait does not use the nested <tt>rebind</tt> template in this case.
*/
template< typename Allocator, typename U >
struct rebind_alloc
{
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
typedef typename std::allocator_traits< Allocator >::BOOST_NESTED_TEMPLATE rebind_alloc< U > type;
#else
typedef typename boost::container::allocator_traits< Allocator >::BOOST_NESTED_TEMPLATE portable_rebind_alloc< U >::type type;
#endif
};
template< typename U >
struct rebind_alloc< std::allocator< void >, U >
{
typedef std::allocator< U > type;
};
} // namespace aux
BOOST_LOG_CLOSE_NAMESPACE // namespace log
} // namespace boost
#include <boost/log/detail/footer.hpp>
#endif // BOOST_LOG_ALLOCATOR_TRAITS_HPP_INCLUDED_

View File

@@ -22,7 +22,7 @@
#include <string>
#include <streambuf>
#include <boost/assert.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/locale/utf.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/header.hpp>
@@ -277,11 +277,13 @@ protected:
//! Finds the string length so that it includes only complete characters, and does not exceed \a max_size
size_type length_until_boundary(const char_type* s, size_type n, size_type max_size) const
{
return length_until_boundary(s, n, max_size, mpl::bool_< sizeof(char_type) == 1u >());;
BOOST_ASSERT(max_size <= n);
return length_until_boundary(s, n, max_size, boost::integral_constant< bool, sizeof(char_type) == 1u >());
}
private:
//! Finds the string length so that it includes only complete characters, and does not exceed \a max_size
size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, mpl::true_) const
size_type length_until_boundary(const char_type* s, size_type, size_type max_size, boost::true_type) const
{
std::locale loc = this->getloc();
std::codecvt< wchar_t, char, std::mbstate_t > const& fac = std::use_facet< std::codecvt< wchar_t, char, std::mbstate_t > >(loc);
@@ -290,12 +292,12 @@ protected:
}
//! Finds the string length so that it includes only complete characters, and does not exceed \a max_size
static size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, mpl::false_)
static size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, boost::false_type)
{
// Note: Although it's not required to be true for wchar_t, here we assume that the string has Unicode encoding.
// Compilers use some version of Unicode for wchar_t on all tested platforms, and std::locale doesn't offer a way
// to find the character boundary for character types other than char anyway.
typedef boost::locale::utf::utf_traits< CharT > utf_traits;
typedef boost::locale::utf::utf_traits< char_type > utf_traits;
size_type pos = max_size;
while (pos > 0u)

View File

@@ -27,7 +27,7 @@
// Try including WinAPI config as soon as possible so that any other headers don't include Windows SDK headers
#if defined(BOOST_OS_WINDOWS_AVAILABLE)
#include <boost/detail/winapi/config.hpp>
#include <boost/winapi/config.hpp>
#endif
#include <limits.h> // To bring in libc macros
@@ -116,6 +116,19 @@
# define BOOST_LOG_NO_ASIO
#endif
#if defined(__VXWORKS__)
# define BOOST_LOG_NO_GETPGRP
# define BOOST_LOG_NO_GETSID
// for _WRS_CONFIG_USER_MANAGEMENT used below
# include <vsbConfig.h>
#endif
#if (!defined(__CRYSTAX__) && defined(__ANDROID__) && (__ANDROID_API__+0) < 21) \
|| (defined(__VXWORKS__) && !defined(_WRS_CONFIG_USER_MANAGEMENT))
// Until Android API version 21 Google NDK does not provide getpwuid_r
# define BOOST_LOG_NO_GETPWUID_R
#endif
#if !defined(BOOST_LOG_USE_NATIVE_SYSLOG) && defined(BOOST_LOG_NO_ASIO)
# ifndef BOOST_LOG_WITHOUT_SYSLOG
# define BOOST_LOG_WITHOUT_SYSLOG
@@ -144,10 +157,13 @@
#define BOOST_LOG_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
#endif
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || (defined(BOOST_CLANG) && (((__clang_major__+0) == 3) && ((__clang_minor__+0) <= 1)))
// Clang 3.1 cannot handle a defaulted constexpr constructor in some cases (presumably, if the class contains a member with a constexpr constructor)
#define BOOST_LOG_NO_CXX11_DEFAULTED_CONSTEXPR_CONSTRUCTORS
#endif
#if defined(_MSC_VER)
# define BOOST_LOG_NO_VTABLE __declspec(novtable)
#elif defined(__GNUC__)
# define BOOST_LOG_NO_VTABLE
#else
# define BOOST_LOG_NO_VTABLE
#endif
@@ -199,18 +215,14 @@
# define BOOST_LOG_NORETURN
#endif
// GCC and compatible compilers may require marking types that may alias other types
#if defined(__GNUC__)
# define BOOST_LOG_MAY_ALIAS __attribute__ ((__may_alias__))
#else
# define BOOST_LOG_MAY_ALIAS
#endif
// Some compilers may require marking types that may alias other types
#define BOOST_LOG_MAY_ALIAS BOOST_MAY_ALIAS
#if !defined(BOOST_LOG_BUILDING_THE_LIB)
// Detect if we're dealing with dll
# if defined(BOOST_LOG_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
# define BOOST_LOG_DLL
# define BOOST_LOG_DLL
# endif
# if defined(BOOST_LOG_DLL)
@@ -296,8 +308,14 @@
#ifndef BOOST_LOG_CPU_CACHE_LINE_SIZE
//! The macro defines the CPU cache line size for the target architecture. This is mostly used for optimization.
#if defined(__s390__) || defined(__s390x__)
#define BOOST_LOG_CPU_CACHE_LINE_SIZE 256
#elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__)
#define BOOST_LOG_CPU_CACHE_LINE_SIZE 128
#else
#define BOOST_LOG_CPU_CACHE_LINE_SIZE 64
#endif
#endif
namespace boost {
@@ -343,11 +361,18 @@ namespace log {
# if !defined(BOOST_NO_CXX11_INLINE_NAMESPACES)
inline namespace BOOST_LOG_VERSION_NAMESPACE {}
}
# define BOOST_LOG_OPEN_NAMESPACE namespace log { inline namespace BOOST_LOG_VERSION_NAMESPACE {
# define BOOST_LOG_CLOSE_NAMESPACE }}
# elif defined(BOOST_GCC) && (BOOST_GCC+0) >= 40400
// GCC 7 deprecated strong using directives but allows inline namespaces in C++03 mode since GCC 4.4.
__extension__ inline namespace BOOST_LOG_VERSION_NAMESPACE {}
# define BOOST_LOG_OPEN_NAMESPACE namespace log { __extension__ inline namespace BOOST_LOG_VERSION_NAMESPACE {
# define BOOST_LOG_CLOSE_NAMESPACE }}
# else
namespace BOOST_LOG_VERSION_NAMESPACE {}
@@ -358,12 +383,12 @@ __attribute__((__strong__))
# endif
;
}
# define BOOST_LOG_OPEN_NAMESPACE namespace log { namespace BOOST_LOG_VERSION_NAMESPACE {
# define BOOST_LOG_CLOSE_NAMESPACE }}
# endif
} // namespace log
#else // !defined(BOOST_LOG_DOXYGEN_PASS)
namespace log {}

View File

@@ -16,14 +16,15 @@
#ifndef BOOST_LOG_DETAIL_FORMAT_HPP_INCLUDED_
#define BOOST_LOG_DETAIL_FORMAT_HPP_INCLUDED_
#include <cstddef>
#include <string>
#include <vector>
#include <iosfwd>
#include <boost/assert.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/core/uncaught_exceptions.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/unhandled_exception_count.hpp>
#include <boost/log/detail/cleanup_scope_guard.hpp>
#include <boost/log/utility/formatting_ostream.hpp>
#include <boost/log/detail/header.hpp>
@@ -276,7 +277,7 @@ private:
public:
//! Initializing constructor
pump(basic_format& owner, stream_type& strm) BOOST_NOEXCEPT : m_owner(&owner), m_stream(&strm), m_exception_count(unhandled_exception_count())
pump(basic_format& owner, stream_type& strm) BOOST_NOEXCEPT : m_owner(&owner), m_stream(&strm), m_exception_count(boost::core::uncaught_exceptions())
{
}
@@ -296,7 +297,7 @@ public:
boost::log::aux::cleanup_guard< basic_format< char_type > > cleanup1(*m_owner);
BOOST_ASSERT(m_stream != NULL);
if (m_exception_count >= unhandled_exception_count())
if (m_exception_count >= boost::core::uncaught_exceptions())
{
// Compose the final string in the stream buffer
m_stream->flush();

View File

@@ -22,8 +22,8 @@
#include <cstddef>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/type_traits/remove_cv.hpp>
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#include <boost/preprocessor/iteration/iterate.hpp>

View File

@@ -36,7 +36,7 @@
#if defined(BOOST_LOG_LWRWMUTEX_USE_SRWLOCK)
#include <boost/detail/winapi/srw_lock.hpp>
#include <boost/winapi/srw_lock.hpp>
namespace boost {
@@ -47,28 +47,28 @@ namespace aux {
//! A light read/write mutex that uses WinNT 6 and later APIs
class light_rw_mutex
{
boost::detail::winapi::SRWLOCK_ m_Mutex;
boost::winapi::SRWLOCK_ m_Mutex;
public:
light_rw_mutex()
{
boost::detail::winapi::InitializeSRWLock(&m_Mutex);
boost::winapi::InitializeSRWLock(&m_Mutex);
}
void lock_shared()
{
boost::detail::winapi::AcquireSRWLockShared(&m_Mutex);
boost::winapi::AcquireSRWLockShared(&m_Mutex);
}
void unlock_shared()
{
boost::detail::winapi::ReleaseSRWLockShared(&m_Mutex);
boost::winapi::ReleaseSRWLockShared(&m_Mutex);
}
void lock()
{
boost::detail::winapi::AcquireSRWLockExclusive(&m_Mutex);
boost::winapi::AcquireSRWLockExclusive(&m_Mutex);
}
void unlock()
{
boost::detail::winapi::ReleaseSRWLockExclusive(&m_Mutex);
boost::winapi::ReleaseSRWLockExclusive(&m_Mutex);
}
// Noncopyable

View File

@@ -20,8 +20,8 @@
#include <boost/move/core.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/thread/lock_options.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/detail/header.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE

View File

@@ -16,7 +16,10 @@
#ifndef BOOST_LOG_DETAIL_PARAMETER_TOOLS_HPP_INCLUDED_
#define BOOST_LOG_DETAIL_PARAMETER_TOOLS_HPP_INCLUDED_
#include <boost/mpl/or.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/parameter/keyword.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
@@ -121,26 +124,20 @@ struct make_arg_list< ArgT0, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(BOOST_LOG_MAX_PAR
#endif
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template< typename T, typename R >
struct enable_if_named_parameters {};
using enable_if_named_parameters = boost::enable_if_c< boost::mpl::or_< boost::is_base_of< boost::parameter::aux::tagged_argument_base, T >, boost::is_base_of< empty_arg_list, T > >::value, R >;
template< typename R >
struct enable_if_named_parameters< empty_arg_list, R >
#else // !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template< typename T, typename R >
struct enable_if_named_parameters :
public boost::enable_if_c< boost::mpl::or_< boost::is_base_of< boost::parameter::aux::tagged_argument_base, T >, boost::is_base_of< empty_arg_list, T > >::value, R >
{
typedef R type;
};
template< typename Keyword, typename Arg, typename R >
struct enable_if_named_parameters< boost::parameter::aux::tagged_argument< Keyword, Arg >, R >
{
typedef R type;
};
template< typename TaggedArg, typename Next, typename R >
struct enable_if_named_parameters< boost::parameter::aux::arg_list< TaggedArg, Next >, R >
{
typedef R type;
};
#endif // !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
} // namespace aux

View File

@@ -32,6 +32,7 @@
#include <boost/move/utility_core.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/log/detail/allocator_traits.hpp>
#include <boost/log/detail/header.hpp>
namespace boost {
@@ -69,23 +70,22 @@ struct threadsafe_queue_impl
virtual bool try_pop(node_base*& node_to_free, node_base*& node_with_value) = 0;
};
//! A helper class to compose some of the types used by the queue
template< typename T, typename AllocatorT >
struct threadsafe_queue_types
//! Thread-safe queue node type
template< typename T >
struct threadsafe_queue_node :
public threadsafe_queue_impl::node_base
{
struct node :
public threadsafe_queue_impl::node_base
{
typedef typename aligned_storage< sizeof(T), alignment_of< T >::value >::type storage_type;
storage_type storage;
typedef typename aligned_storage< sizeof(T), alignment_of< T >::value >::type storage_type;
storage_type storage;
node() {}
explicit node(T const& val) { new (storage.address()) T(val); }
T& value() { return *static_cast< T* >(storage.address()); }
void destroy() { static_cast< T* >(storage.address())->~T(); }
};
BOOST_DEFAULTED_FUNCTION(threadsafe_queue_node(), {})
explicit threadsafe_queue_node(T const& val) { new (storage.address()) T(val); }
T& value() BOOST_NOEXCEPT { return *static_cast< T* >(storage.address()); }
void destroy() BOOST_NOEXCEPT { static_cast< T* >(storage.address())->~T(); }
typedef typename AllocatorT::BOOST_NESTED_TEMPLATE rebind< node >::other allocator_type;
// Copying and assignment is prohibited
BOOST_DELETED_FUNCTION(threadsafe_queue_node(threadsafe_queue_node const&))
BOOST_DELETED_FUNCTION(threadsafe_queue_node& operator= (threadsafe_queue_node const&))
};
/*!
@@ -108,36 +108,13 @@ struct threadsafe_queue_types
*/
template< typename T, typename AllocatorT = std::allocator< void > >
class threadsafe_queue :
private threadsafe_queue_types< T, AllocatorT >::allocator_type
private boost::log::aux::rebind_alloc< AllocatorT, threadsafe_queue_node< T > >::type
{
private:
typedef typename threadsafe_queue_types< T, AllocatorT >::allocator_type base_type;
typedef typename threadsafe_queue_types< T, AllocatorT >::node node;
//! A simple scope guard to automate memory reclaiming
struct auto_deallocate;
friend struct auto_deallocate;
struct auto_deallocate
{
auto_deallocate(base_type* alloc, node* dealloc, node* destr) :
m_pAllocator(alloc),
m_pDeallocate(dealloc),
m_pDestroy(destr)
{
}
~auto_deallocate()
{
m_pAllocator->deallocate(m_pDeallocate, 1);
m_pDestroy->destroy();
}
private:
base_type* m_pAllocator;
node* m_pDeallocate;
node* m_pDestroy;
};
typedef threadsafe_queue_node< T > node;
public:
typedef typename boost::log::aux::rebind_alloc< AllocatorT, node >::type allocator_type;
typedef T value_type;
typedef T& reference;
typedef T const& const_reference;
@@ -145,7 +122,33 @@ public:
typedef T const* const_pointer;
typedef std::ptrdiff_t difference_type;
typedef std::size_t size_type;
typedef AllocatorT allocator_type;
private:
typedef boost::log::aux::allocator_traits< allocator_type > alloc_traits;
//! A simple scope guard to automate memory reclaiming
struct auto_deallocate;
friend struct auto_deallocate;
struct auto_deallocate
{
auto_deallocate(allocator_type* alloc, node* dealloc, node* destr) BOOST_NOEXCEPT :
m_pAllocator(alloc),
m_pDeallocate(dealloc),
m_pDestroy(destr)
{
}
~auto_deallocate() BOOST_NOEXCEPT
{
alloc_traits::destroy(*m_pAllocator, m_pDeallocate);
alloc_traits::deallocate(*m_pAllocator, m_pDeallocate, 1);
m_pDestroy->destroy();
}
private:
allocator_type* m_pAllocator;
node* m_pDeallocate;
node* m_pDestroy;
};
public:
/*!
@@ -154,28 +157,28 @@ public:
*
* \throw std::bad_alloc if there is not sufficient memory
*/
threadsafe_queue(base_type const& alloc = base_type()) :
base_type(alloc)
threadsafe_queue(allocator_type const& alloc = allocator_type()) :
allocator_type(alloc)
{
node* p = base_type::allocate(1);
node* p = alloc_traits::allocate(get_allocator(), 1);
if (p)
{
try
{
new (p) node();
alloc_traits::construct(get_allocator(), p);
try
{
m_pImpl = threadsafe_queue_impl::create(p);
}
catch (...)
{
p->~node();
alloc_traits::destroy(get_allocator(), p);
throw;
}
}
catch (...)
{
base_type::deallocate(p, 1);
alloc_traits::deallocate(get_allocator(), p, 1);
throw;
}
}
@@ -185,7 +188,7 @@ public:
/*!
* Destructor
*/
~threadsafe_queue()
~threadsafe_queue() BOOST_NOEXCEPT
{
// Clear the queue
if (!unsafe_empty())
@@ -196,8 +199,8 @@ public:
// Remove the last dummy node
node* p = static_cast< node* >(m_pImpl->reset_last_node());
p->~node();
base_type::deallocate(p, 1);
alloc_traits::destroy(get_allocator(), p);
alloc_traits::deallocate(get_allocator(), p, 1);
delete m_pImpl;
}
@@ -213,16 +216,16 @@ public:
*/
void push(const_reference value)
{
node* p = base_type::allocate(1);
node* p = alloc_traits::allocate(get_allocator(), 1);
if (p)
{
try
{
new (p) node(value);
alloc_traits::construct(get_allocator(), p, value);
}
catch (...)
{
base_type::deallocate(p, 1);
alloc_traits::deallocate(get_allocator(), p, 1);
throw;
}
m_pImpl->push(p);
@@ -242,7 +245,7 @@ public:
if (m_pImpl->try_pop(dealloc, destr))
{
node* p = static_cast< node* >(destr);
auto_deallocate guard(static_cast< base_type* >(this), static_cast< node* >(dealloc), p);
auto_deallocate guard(static_cast< allocator_type* >(this), static_cast< node* >(dealloc), p);
value = boost::move(p->value());
return true;
}
@@ -254,6 +257,10 @@ public:
BOOST_DELETED_FUNCTION(threadsafe_queue(threadsafe_queue const&))
BOOST_DELETED_FUNCTION(threadsafe_queue& operator= (threadsafe_queue const&))
private:
//! Returns the allocator instance
allocator_type& get_allocator() BOOST_NOEXCEPT { return *static_cast< allocator_type* >(this); }
private:
//! Pointer to the implementation
threadsafe_queue_impl* m_pImpl;

View File

@@ -19,7 +19,7 @@
#include <boost/cstdint.hpp>
#include <boost/log/detail/config.hpp>
#if defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/winapi/basic_types.hpp>
#endif
#include <boost/log/detail/header.hpp>
@@ -76,7 +76,7 @@ public:
*/
#if defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
typedef uint64_t (WINAPI* get_tick_count_t)();
typedef uint64_t (BOOST_WINAPI_WINAPI_CC* get_tick_count_t)();
extern BOOST_LOG_API get_tick_count_t get_tick_count;
inline timestamp get_timestamp()

View File

@@ -1,40 +0,0 @@
/*
* Copyright Andrey Semashev 2007 - 2015.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file unhandled_exception_count.hpp
* \author Andrey Semashev
* \date 05.11.2012
*
* \brief This header is the Boost.Log library implementation, see the library documentation
* at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
*/
#ifndef BOOST_LOG_DETAIL_UNHANDLED_EXCEPTION_COUNT_HPP_INCLUDED_
#define BOOST_LOG_DETAIL_UNHANDLED_EXCEPTION_COUNT_HPP_INCLUDED_
#include <boost/log/detail/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
namespace aux {
//! Returns the number of currently pending exceptions
BOOST_LOG_API unsigned int unhandled_exception_count() BOOST_NOEXCEPT;
} // namespace aux
BOOST_LOG_CLOSE_NAMESPACE // namespace log
} // namespace boost
#endif // BOOST_LOG_DETAIL_UNHANDLED_EXCEPTION_COUNT_HPP_INCLUDED_

View File

@@ -26,6 +26,7 @@
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/allocator_traits.hpp>
#include <boost/log/detail/custom_terminal_spec.hpp>
#include <boost/log/attributes/attribute_name.hpp>
#include <boost/log/attributes/fallback_policy.hpp>
@@ -80,7 +81,7 @@ private:
channel_value_type,
severity_value_type,
ChannelOrderT,
typename AllocatorT::BOOST_NESTED_TEMPLATE rebind< std::pair< const channel_value_type, severity_value_type > >::other
typename boost::log::aux::rebind_alloc< AllocatorT, std::pair< const channel_value_type, severity_value_type > >::type
> mapping_type;
//! Attribute value visitor invoker for channel
typedef value_visitor_invoker< channel_value_type, channel_fallback_policy > channel_visitor_invoker_type;

View File

@@ -0,0 +1,40 @@
/*
* Copyright Andrey Semashev 2019.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file keywords/target.hpp
* \author Andrey Semashev
* \date 05.01.2019
*
* The header contains the \c target_file_name keyword declaration.
*/
#ifndef BOOST_LOG_KEYWORDS_TARGET_FILE_NAME_HPP_INCLUDED_
#define BOOST_LOG_KEYWORDS_TARGET_FILE_NAME_HPP_INCLUDED_
#include <boost/parameter/keyword.hpp>
#include <boost/log/detail/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
namespace keywords {
//! The keyword allows to pass the target file name for file sink
BOOST_PARAMETER_KEYWORD(tag, target_file_name)
} // namespace keywords
BOOST_LOG_CLOSE_NAMESPACE // namespace log
} // namespace boost
#endif // BOOST_LOG_KEYWORDS_TARGET_FILE_NAME_HPP_INCLUDED_

View File

@@ -30,6 +30,7 @@
#include <boost/log/keywords/max_files.hpp>
#include <boost/log/keywords/min_free_space.hpp>
#include <boost/log/keywords/target.hpp>
#include <boost/log/keywords/target_file_name.hpp>
#include <boost/log/keywords/file_name.hpp>
#include <boost/log/keywords/open_mode.hpp>
#include <boost/log/keywords/auto_flush.hpp>
@@ -371,7 +372,7 @@ public:
* Constructor. Creates a sink backend with the specified named parameters.
* The following named parameters are supported:
*
* \li \c file_name - Specifies the file name pattern where logs are actually written to. The pattern may
* \li \c file_name - Specifies the active file name pattern where logs are actually written to. The pattern may
* contain directory and file name portions, but only the file name may contain
* placeholders. The backend supports Boost.DateTime placeholders for injecting
* current time and date into the file name. Also, an additional %N placeholder is
@@ -379,6 +380,10 @@ public:
* may also contain width specification in the printf-compatible form (e.g. %5N). The
* printed file counter will always be zero-filled. If \c file_name is not specified,
* pattern "%5N.log" will be used.
* \li \c target_file_name - Specifies the target file name pattern to use to rename the log file on rotation,
* before passing it to the file collector. The pattern may contain the same
* placeholders as the \c file_name parameter. By default, no renaming is done,
* i.e. the written log file keeps its name according to \c file_name.
* \li \c open_mode - File open mode. The mode should be presented in form of mask compatible to
* <tt>std::ios_base::openmode</tt>. If not specified, <tt>trunc | out</tt> will be used.
* \li \c rotation_size - Specifies the approximate size, in characters written, of the temporary file
@@ -409,7 +414,7 @@ public:
BOOST_LOG_API ~text_file_backend();
/*!
* The method sets file name wildcard for the files being written. The wildcard supports
* The method sets the active file name wildcard for the files being written. The wildcard supports
* date and time injection into the file name.
*
* \param pattern The name pattern for the file being written.
@@ -420,6 +425,22 @@ public:
set_file_name_pattern_internal(filesystem::path(pattern));
}
/*!
* The method sets the target file name wildcard for the files being rotated. The wildcard supports
* date and time injection into the file name.
*
* This pattern will be used when the log file is being rotated, to rename the just written
* log file (which has the name according to the pattern in the \c file_name constructor parameter or
* set by a call to \c set_file_name_pattern), just before passing the file to the file collector.
*
* \param pattern The name pattern for the file being rotated.
*/
template< typename PathT >
void set_target_file_name_pattern(PathT const& pattern)
{
set_target_file_name_pattern_internal(filesystem::path(pattern));
}
/*!
* The method sets the file open mode
*
@@ -502,7 +523,7 @@ public:
* as if they were rotated.
*
* The file scan can be performed in two ways: either all files in the target directory will
* be considered as log files, or only those files that satisfy the file name pattern.
* be considered as log files, or only those files that satisfy the target file name pattern.
* See documentation on <tt>sinks::file::collector::scan_for_files</tt> for more information.
*
* \pre File collector and the proper file name pattern have already been set.
@@ -541,6 +562,7 @@ private:
{
construct(
filesystem::path(args[keywords::file_name | filesystem::path()]),
filesystem::path(args[keywords::target_file_name | filesystem::path()]),
args[keywords::open_mode | (std::ios_base::trunc | std::ios_base::out)],
args[keywords::rotation_size | (std::numeric_limits< uintmax_t >::max)()],
args[keywords::time_based_rotation | time_based_rotation_predicate()],
@@ -550,14 +572,17 @@ private:
//! Constructor implementation
BOOST_LOG_API void construct(
filesystem::path const& pattern,
filesystem::path const& target_file_name,
std::ios_base::openmode mode,
uintmax_t rotation_size,
time_based_rotation_predicate const& time_based_rotation,
bool auto_flush,
bool enable_final_rotation);
//! The method sets file name mask
//! The method sets file name pattern
BOOST_LOG_API void set_file_name_pattern_internal(filesystem::path const& pattern);
//! The method sets target file name pattern
BOOST_LOG_API void set_target_file_name_pattern_internal(filesystem::path const& pattern);
//! Closes the currently open file
void close_file();

View File

@@ -27,12 +27,12 @@
#include <boost/type_traits/remove_cv.hpp>
#include <boost/core/addressof.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/core/uncaught_exceptions.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/native_typeof.hpp>
#include <boost/log/detail/unhandled_exception_count.hpp>
#include <boost/log/core/record.hpp>
#include <boost/log/utility/unique_identifier_name.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/utility/formatting_ostream.hpp>
#include <boost/log/detail/header.hpp>
@@ -504,7 +504,7 @@ public:
explicit record_pump(logger_type& lg, record& rec) :
m_pLogger(boost::addressof(lg)),
m_pStreamCompound(stream_provider_type::allocate_compound(rec)),
m_ExceptionCount(unhandled_exception_count())
m_ExceptionCount(boost::core::uncaught_exceptions())
{
}
//! Move constructor
@@ -523,7 +523,7 @@ public:
{
auto_release cleanup(m_pStreamCompound); // destructor doesn't throw
// Only push the record if no exception has been thrown in the streaming expression (if possible)
if (m_ExceptionCount >= unhandled_exception_count())
if (m_ExceptionCount >= boost::core::uncaught_exceptions())
m_pLogger->push_record(boost::move(m_pStreamCompound->stream.get_record()));
}
}

View File

@@ -55,17 +55,17 @@ inline void decompose_date(DateT const& d, boost::log::aux::decomposed_time_wrap
{
typedef typename DateT::ymd_type ymd_type;
ymd_type ymd = d.year_month_day();
v.year = ymd.year;
v.month = ymd.month;
v.day = ymd.day;
v.year = static_cast< uint32_t >(ymd.year);
v.month = static_cast< uint32_t >(ymd.month);
v.day = static_cast< uint32_t >(ymd.day);
}
template< typename TimeDurationT, typename ValueT >
inline void decompose_time_of_day(TimeDurationT const& tod, boost::log::aux::decomposed_time_wrapper< ValueT >& v)
{
v.hours = tod.hours();
v.minutes = tod.minutes();
v.seconds = tod.seconds();
v.hours = static_cast< uint32_t >(tod.hours());
v.minutes = static_cast< uint32_t >(tod.minutes());
v.seconds = static_cast< uint32_t >(tod.seconds());
typedef typename TimeDurationT::traits_type traits_type;
enum
@@ -96,10 +96,10 @@ inline void decompose_date_duration(DateDurationT const& dur, boost::log::aux::d
if (dur.is_negative())
{
v.negative = true;
v.day = (-dur).days();
v.day = static_cast< uint32_t >((-dur).days());
}
else
v.day = dur.days();
v.day = static_cast< uint32_t >(dur.days());
}
template< typename TimeT, typename ValueT >

View File

@@ -544,14 +544,14 @@ public:
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream& strm, std::basic_string< OtherCharT, OtherTraitsT, OtherAllocatorT > const& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream& strm, basic_string_literal< OtherCharT, OtherTraitsT > const& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
@@ -573,14 +573,14 @@ public:
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream& strm, std::basic_string< OtherCharT, OtherTraitsT, OtherAllocatorT >& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream& strm, basic_string_literal< OtherCharT, OtherTraitsT >& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
@@ -603,14 +603,14 @@ public:
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream&& strm, std::basic_string< OtherCharT, OtherTraitsT, OtherAllocatorT > const& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream&& strm, basic_string_literal< OtherCharT, OtherTraitsT > const& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
@@ -632,14 +632,14 @@ public:
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream&& strm, std::basic_string< OtherCharT, OtherTraitsT, OtherAllocatorT >& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
operator<< (basic_formatting_ostream&& strm, basic_string_literal< OtherCharT, OtherTraitsT >& str)
{
return strm.formatted_write(str.c_str(), static_cast< std::streamsize >(str.size()));
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
}
template< typename OtherCharT, typename OtherTraitsT >

View File

@@ -429,7 +429,7 @@ public:
/*!
* The method wakes up all threads that are blocked in calls to <tt>send()</tt> or
* <tt>receive()</tt>. Those calls would then return \c false with \c errno \c EINTR.
* <tt>receive()</tt>. Those calls would then return <tt>operation_result::aborted</tt>.
* Note that, the method does not block until the woken-up threads have actually
* returned from <tt>send()</tt> or <tt>receive()</tt>. Other means is needed to ensure
* that calls to <tt>send()</tt> or <tt>receive()</tt> have returned, e.g., joining the
@@ -437,7 +437,7 @@ public:
*
* The method also puts the object in stopped state. When in stopped state, calls to
* <tt>send()</tt> or <tt>receive()</tt> will return immediately with return value
* \c false and \c errno \c EINTR when they would otherwise block in running state.
* <tt>operation_result::aborted</tt> when they would otherwise block in running state.
*
* Concurrent calls to this method, <tt>send()</tt>, <tt>try_send()</tt>, <tt>receive()</tt>,
* <tt>try_receive()</tt>, and <tt>clear()</tt> are allowed.

View File

@@ -33,11 +33,9 @@ struct _SECURITY_ATTRIBUTES;
namespace boost {
#ifdef BOOST_WINDOWS
namespace detail {
namespace winapi {
struct BOOST_LOG_MAY_ALIAS _SECURITY_ATTRIBUTES;
}
}
#endif
namespace interprocess {
@@ -108,7 +106,7 @@ public:
}
#ifdef BOOST_WINDOWS
permissions(boost::detail::winapi::_SECURITY_ATTRIBUTES* perms) BOOST_NOEXCEPT : m_perms(reinterpret_cast< native_type >(perms))
permissions(boost::winapi::_SECURITY_ATTRIBUTES* perms) BOOST_NOEXCEPT : m_perms(reinterpret_cast< native_type >(perms))
{
}
#endif

View File

@@ -15,9 +15,11 @@
#ifndef BOOST_LOG_UTILITY_SETUP_FILE_HPP_INCLUDED_
#define BOOST_LOG_UTILITY_SETUP_FILE_HPP_INCLUDED_
#include <boost/type_traits/is_void.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/make_shared_object.hpp>
#include <boost/parameter/parameters.hpp> // for is_named_argument
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/comparison/greater.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
@@ -96,18 +98,36 @@ shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > >
return pSink;
}
//! The function wraps the argument into a file_name named argument, if needed
template< typename T >
inline T const& wrap_file_name(T const& arg, mpl::true_)
//! The trait wraps the argument into a file_name named argument, if needed
template< typename T, bool IsNamedArgument = parameter::aux::is_named_argument< T >::value >
struct file_name_param_traits
{
return arg;
}
static shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > wrap_add_file_log(T const& file_name_arg)
{
return aux::add_file_log(file_name_arg);
}
template< typename ArgsT >
static shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > wrap_add_file_log(T const& file_name_arg, ArgsT const& args)
{
return aux::add_file_log((args, file_name_arg));
}
};
template< typename T >
inline typename parameter::aux::tag< keywords::tag::file_name, T const >::type
wrap_file_name(T const& arg, mpl::false_)
struct file_name_param_traits< T, false >
{
return keywords::file_name = arg;
}
static shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > wrap_add_file_log(T const& file_name_arg)
{
return aux::add_file_log(keywords::file_name = file_name_arg);
}
template< typename ArgsT >
static shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > wrap_add_file_log(T const& file_name_arg, ArgsT const& args)
{
return aux::add_file_log((args, (keywords::file_name = file_name_arg)));
}
};
} // namespace aux
@@ -117,11 +137,11 @@ wrap_file_name(T const& arg, mpl::false_)
template< BOOST_PP_ENUM_PARAMS(n, typename T) >\
inline shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > add_file_log(BOOST_PP_ENUM_BINARY_PARAMS(n, T, const& arg))\
{\
return aux::add_file_log((\
aux::wrap_file_name(arg0, typename parameter::aux::is_named_argument< T0 >::type())\
return aux::file_name_param_traits< T0 >::wrap_add_file_log(\
arg0\
BOOST_PP_COMMA_IF(BOOST_PP_GREATER(n, 1))\
BOOST_PP_ENUM_SHIFTED_PARAMS(n, arg)\
));\
BOOST_PP_EXPR_IF(BOOST_PP_GREATER(n, 1), (BOOST_PP_ENUM_SHIFTED_PARAMS(n, arg)))\
);\
}
BOOST_PP_REPEAT_FROM_TO(1, BOOST_LOG_MAX_PARAMETER_ARGS, BOOST_LOG_INIT_LOG_TO_FILE_INTERNAL, ~)
@@ -134,7 +154,11 @@ BOOST_PP_REPEAT_FROM_TO(1, BOOST_LOG_MAX_PARAMETER_ARGS, BOOST_LOG_INIT_LOG_TO_F
* The function initializes the logging library to write logs to a file stream.
*
* \param args A number of named arguments. The following parameters are supported:
* \li \c file_name The file name or its pattern. This parameter is mandatory.
* \li \c file_name The active file name or its pattern. This parameter is mandatory.
* \li \c target_file_name - Specifies the target file name pattern to use to rename the log file on rotation,
* before passing it to the file collector. The pattern may contain the same
* placeholders as the \c file_name parameter. By default, no renaming is done,
* i.e. the written log file keeps its name according to \c file_name.
* \li \c open_mode The mask that describes the open mode for the file. See <tt>std::ios_base::openmode</tt>.
* \li \c rotation_size The size of the file at which rotation should occur. See <tt>basic_text_file_backend</tt>.
* \li \c time_based_rotation The predicate for time-based file rotations. See <tt>basic_text_file_backend</tt>.

View File

@@ -24,9 +24,9 @@
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/optional/optional.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/setup_config.hpp>
#include <boost/log/detail/native_typeof.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#if !defined(BOOST_LOG_TYPEOF)
#include <boost/core/enable_if.hpp>
#endif

View File

@@ -17,8 +17,8 @@
#include <boost/type_index.hpp>
#include <boost/static_assert.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/detail/header.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE