diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 4919232..486e660 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -104,6 +104,7 @@ project boost/log msvc:_CRT_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_DEPRECATE msvc:/bigobj + msvc:/wd4503 # decorated name length exceeded, name was truncated intel-win:_SCL_SECURE_NO_WARNINGS intel-win:_SCL_SECURE_NO_DEPRECATE intel-win:_CRT_SECURE_NO_WARNINGS @@ -344,6 +345,7 @@ local BOOST_LOG_SETUP_COMMON_SRC = filter_parser.cpp formatter_parser.cpp default_filter_factory.cpp + matches_relation_factory.cpp default_formatter_factory.cpp ; diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 0790be7..685a0af 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -45,8 +45,8 @@ local doxygen_params = # EXCLUDE_SYMBOLS="aux aux::*" "PREDEFINED=BOOST_LOG_DOXYGEN_PASS \\ BOOST_LOG_NO_VTABLE= \\ - BOOST_LOG_VISIBLE= \\ - BOOST_LOG_FORCEINLINE=inline \\ + BOOST_SYMBOL_VISIBLE= \\ + BOOST_FORCEINLINE=inline \\ BOOST_STATIC_ASSERT(x)= \\ BOOST_STATIC_ASSERT_MSG(x,y)= \\ BOOST_RV_REF(x)=\"x&&\" \\ @@ -67,8 +67,8 @@ local doxygen_params = BOOST_LOG_NAMESPACE=log \\ BOOST_LOG_OPEN_NAMESPACE=\"namespace log {\" \\ BOOST_LOG_CLOSE_NAMESPACE=\"}\" \\ - BOOST_LOG_DEFAULTED_FUNCTION(x,y)=\"x = default;\" \\ - BOOST_LOG_DELETED_FUNCTION(x)=\"x = delete;\" \\ + BOOST_DEFAULTED_FUNCTION(x,y)=\"x = default;\" \\ + BOOST_DELETED_FUNCTION(x)=\"x = delete;\" \\ BOOST_LOG_USE_CHAR \\ BOOST_LOG_USE_WCHAR_T \\ BOOST_LOG_API= \\ diff --git a/doc/changelog.qbk b/doc/changelog.qbk index f37bc0e..b522cd5 100644 --- a/doc/changelog.qbk +++ b/doc/changelog.qbk @@ -14,6 +14,13 @@ [*General changes:] * Added a new configuration macro `BOOST_LOG_WITHOUT_DEFAULT_FACTORIES`. By defining this macro the user can disable compilation of the default filter and formatter factories used by settings parsers. This can substantially reduce binary sizes while still retaining support for settings parsers. Note that when this macro is defined the user will have to register _all_ attributes in the library. +* Rewritten some of the parsers to reduce the compiled binary size. + +[*Bug fixes:] + +* Fixed [link log.detailed.attributes.timer `timer`] attribute generating incorrect time readings on Windows on heavy thread contention when `QueryPerformanceCounter` API was used. +* Fixed a bug in the filter parser that prevented using parsed filters with some attributes. For example, parsed filters didn't work with a string-typed attribute value, if the value was compared to a numeric operand. +* Closed tickets: [ticket 8815], [ticket 8819], [ticket 8915], [ticket 8917]. [heading 2.1, Boost 1.54] diff --git a/doc/log.qbk b/doc/log.qbk index f2bb6ad..273a2a4 100644 --- a/doc/log.qbk +++ b/doc/log.qbk @@ -48,6 +48,8 @@ [def __boost_locale__ [@http://www.boost.org/doc/libs/release/libs/locale/doc/html/index.html Boost.Locale]] [def __boost_quickbook__ [@http://www.boost.org/doc/libs/release/doc/html/quickbook.html Boost.Quickbook]] +[template ticket[key] '''#'''[key]''''''] + [/ Auto-generated macros that refer to Reference sections /] [include top_level_reference.qbk] [include core_reference.qbk] diff --git a/example/doc/tutorial_fmt_stream.cpp b/example/doc/tutorial_fmt_stream.cpp index 43e3252..f77c87e 100644 --- a/example/doc/tutorial_fmt_stream.cpp +++ b/example/doc/tutorial_fmt_stream.cpp @@ -5,18 +5,22 @@ * http://www.boost.org/LICENSE_1_0.txt) */ +#include #include #include #include #include #include #include +#include namespace logging = boost::log; namespace src = boost::log::sources; namespace expr = boost::log::expressions; namespace keywords = boost::log::keywords; +#if 1 + //[ example_tutorial_formatters_stream void init() { @@ -37,7 +41,7 @@ void init() } //] -#if 0 +#else //[ example_tutorial_formatters_stream_date_time void init() diff --git a/include/boost/log/attributes.hpp b/include/boost/log/attributes.hpp index 1e3c028..9eb82b9 100644 --- a/include/boost/log/attributes.hpp +++ b/include/boost/log/attributes.hpp @@ -31,7 +31,7 @@ #include #endif -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/attribute.hpp b/include/boost/log/attributes/attribute.hpp index 44ac98e..905739f 100644 --- a/include/boost/log/attributes/attribute.hpp +++ b/include/boost/log/attributes/attribute.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -66,7 +66,7 @@ public: * * All attributes must derive their implementation from this class. */ - struct BOOST_LOG_NO_VTABLE BOOST_LOG_VISIBLE impl : + struct BOOST_LOG_NO_VTABLE BOOST_SYMBOL_VISIBLE impl : public intrusive_ref_counter { /*! @@ -88,7 +88,7 @@ public: * Default constructor. Creates an empty attribute value factory, which is not usable until * \c set_impl is called. */ - BOOST_LOG_DEFAULTED_FUNCTION(attribute(), {}) + BOOST_DEFAULTED_FUNCTION(attribute(), {}) /*! * Copy constructor diff --git a/include/boost/log/attributes/attribute_cast.hpp b/include/boost/log/attributes/attribute_cast.hpp index 26e0cfd..356395f 100644 --- a/include/boost/log/attributes/attribute_cast.hpp +++ b/include/boost/log/attributes/attribute_cast.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/attribute_name.hpp b/include/boost/log/attributes/attribute_name.hpp index ee4b9a5..f69ee2c 100644 --- a/include/boost/log/attributes/attribute_name.hpp +++ b/include/boost/log/attributes/attribute_name.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/attribute_set.hpp b/include/boost/log/attributes/attribute_set.hpp index 819269a..3a56f02 100644 --- a/include/boost/log/attributes/attribute_set.hpp +++ b/include/boost/log/attributes/attribute_set.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -120,8 +120,8 @@ private: node_base(); - BOOST_LOG_DELETED_FUNCTION(node_base(node_base const&)) - BOOST_LOG_DELETED_FUNCTION(node_base& operator= (node_base const&)) + BOOST_DELETED_FUNCTION(node_base(node_base const&)) + BOOST_DELETED_FUNCTION(node_base& operator= (node_base const&)) }; //! Container elements diff --git a/include/boost/log/attributes/attribute_value.hpp b/include/boost/log/attributes/attribute_value.hpp index 031028c..81e1a26 100644 --- a/include/boost/log/attributes/attribute_value.hpp +++ b/include/boost/log/attributes/attribute_value.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -115,7 +115,7 @@ public: /*! * Default constructor. Creates an empty (absent) attribute value. */ - BOOST_LOG_DEFAULTED_FUNCTION(attribute_value(), {}) + BOOST_DEFAULTED_FUNCTION(attribute_value(), {}) /*! * Copy constructor diff --git a/include/boost/log/attributes/attribute_value_impl.hpp b/include/boost/log/attributes/attribute_value_impl.hpp index 6ea4161..a17daf5 100644 --- a/include/boost/log/attributes/attribute_value_impl.hpp +++ b/include/boost/log/attributes/attribute_value_impl.hpp @@ -26,7 +26,7 @@ #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/attribute_value_set.hpp b/include/boost/log/attributes/attribute_value_set.hpp index 87dccc3..ad9bde5 100644 --- a/include/boost/log/attributes/attribute_value_set.hpp +++ b/include/boost/log/attributes/attribute_value_set.hpp @@ -29,7 +29,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -104,8 +104,8 @@ private: node_base(); - BOOST_LOG_DELETED_FUNCTION(node_base(node_base const&)) - BOOST_LOG_DELETED_FUNCTION(node_base& operator= (node_base const&)) + BOOST_DELETED_FUNCTION(node_base(node_base const&)) + BOOST_DELETED_FUNCTION(node_base& operator= (node_base const&)) }; //! Container elements diff --git a/include/boost/log/attributes/clock.hpp b/include/boost/log/attributes/clock.hpp index 9e39b24..38cc706 100644 --- a/include/boost/log/attributes/clock.hpp +++ b/include/boost/log/attributes/clock.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -54,7 +54,7 @@ public: protected: //! Attribute factory implementation - struct BOOST_LOG_VISIBLE impl : + struct BOOST_SYMBOL_VISIBLE impl : public attribute::impl { attribute_value get_value() diff --git a/include/boost/log/attributes/constant.hpp b/include/boost/log/attributes/constant.hpp index 6156f09..a900c71 100644 --- a/include/boost/log/attributes/constant.hpp +++ b/include/boost/log/attributes/constant.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -52,7 +52,7 @@ public: protected: //! Factory implementation - class BOOST_LOG_VISIBLE impl : + class BOOST_SYMBOL_VISIBLE impl : public attribute_value_impl< value_type > { //! Base type diff --git a/include/boost/log/attributes/counter.hpp b/include/boost/log/attributes/counter.hpp index ea22c1d..a5ea59e 100644 --- a/include/boost/log/attributes/counter.hpp +++ b/include/boost/log/attributes/counter.hpp @@ -26,7 +26,7 @@ #endif // BOOST_LOG_NO_THREADS #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -57,7 +57,7 @@ public: protected: //! Base class for factory implementation - class BOOST_LOG_NO_VTABLE BOOST_LOG_VISIBLE impl : + class BOOST_LOG_NO_VTABLE BOOST_SYMBOL_VISIBLE impl : public attribute::impl { }; diff --git a/include/boost/log/attributes/current_process_id.hpp b/include/boost/log/attributes/current_process_id.hpp index dba6b94..6504387 100644 --- a/include/boost/log/attributes/current_process_id.hpp +++ b/include/boost/log/attributes/current_process_id.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/current_process_name.hpp b/include/boost/log/attributes/current_process_name.hpp index 4611095..99ff71b 100644 --- a/include/boost/log/attributes/current_process_name.hpp +++ b/include/boost/log/attributes/current_process_name.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/current_thread_id.hpp b/include/boost/log/attributes/current_thread_id.hpp index 231cb1a..c16a507 100644 --- a/include/boost/log/attributes/current_thread_id.hpp +++ b/include/boost/log/attributes/current_thread_id.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -56,7 +56,7 @@ public: protected: //! Factory implementation - class BOOST_LOG_VISIBLE impl : + class BOOST_SYMBOL_VISIBLE impl : public attribute_value::impl { public: diff --git a/include/boost/log/attributes/fallback_policy.hpp b/include/boost/log/attributes/fallback_policy.hpp index 00f52a2..bc4f6c5 100644 --- a/include/boost/log/attributes/fallback_policy.hpp +++ b/include/boost/log/attributes/fallback_policy.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/fallback_policy_fwd.hpp b/include/boost/log/attributes/fallback_policy_fwd.hpp index 76f8620..de0c9e0 100644 --- a/include/boost/log/attributes/fallback_policy_fwd.hpp +++ b/include/boost/log/attributes/fallback_policy_fwd.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/function.hpp b/include/boost/log/attributes/function.hpp index 648c450..13860e2 100644 --- a/include/boost/log/attributes/function.hpp +++ b/include/boost/log/attributes/function.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -57,7 +57,7 @@ public: protected: //! Base class for factory implementation - class BOOST_LOG_NO_VTABLE BOOST_LOG_VISIBLE impl : + class BOOST_LOG_NO_VTABLE BOOST_SYMBOL_VISIBLE impl : public attribute::impl { }; diff --git a/include/boost/log/attributes/mutable_constant.hpp b/include/boost/log/attributes/mutable_constant.hpp index 8dbb8cb..bba5637 100644 --- a/include/boost/log/attributes/mutable_constant.hpp +++ b/include/boost/log/attributes/mutable_constant.hpp @@ -29,7 +29,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -90,7 +90,7 @@ public: protected: //! Factory implementation - class BOOST_LOG_VISIBLE impl : + class BOOST_SYMBOL_VISIBLE impl : public attribute::impl { private: @@ -223,7 +223,7 @@ public: protected: //! Factory implementation - class BOOST_LOG_VISIBLE impl : + class BOOST_SYMBOL_VISIBLE impl : public attribute::impl { private: diff --git a/include/boost/log/attributes/named_scope.hpp b/include/boost/log/attributes/named_scope.hpp index aa0bbd2..f865252 100644 --- a/include/boost/log/attributes/named_scope.hpp +++ b/include/boost/log/attributes/named_scope.hpp @@ -30,7 +30,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -368,8 +368,8 @@ public: named_scope::pop_scope(); } - BOOST_LOG_DELETED_FUNCTION(sentry(sentry const&)) - BOOST_LOG_DELETED_FUNCTION(sentry& operator= (sentry const&)) + BOOST_DELETED_FUNCTION(sentry(sentry const&)) + BOOST_DELETED_FUNCTION(sentry& operator= (sentry const&)) private: scope_entry m_Entry; @@ -377,7 +377,7 @@ public: private: //! Attribute implementation class - struct BOOST_LOG_VISIBLE impl; + struct BOOST_SYMBOL_VISIBLE impl; public: /*! diff --git a/include/boost/log/attributes/scoped_attribute.hpp b/include/boost/log/attributes/scoped_attribute.hpp index 55f7266..67d8e0d 100644 --- a/include/boost/log/attributes/scoped_attribute.hpp +++ b/include/boost/log/attributes/scoped_attribute.hpp @@ -30,7 +30,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -99,7 +99,7 @@ public: } #ifndef BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT - BOOST_LOG_DELETED_FUNCTION(scoped_logger_attribute(scoped_logger_attribute const&)) + BOOST_DELETED_FUNCTION(scoped_logger_attribute(scoped_logger_attribute const&)) #else // BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT scoped_logger_attribute(scoped_logger_attribute const& that) : m_pLogger(that.m_pLogger), m_itAttribute(that.m_itAttribute) { @@ -107,7 +107,7 @@ public: } #endif // BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT - BOOST_LOG_DELETED_FUNCTION(scoped_logger_attribute& operator= (scoped_logger_attribute const&)) + BOOST_DELETED_FUNCTION(scoped_logger_attribute& operator= (scoped_logger_attribute const&)) }; } // namespace aux @@ -122,7 +122,7 @@ public: * \return An unspecified guard object which may be used to initialize a \c scoped_attribute variable. */ template< typename LoggerT > -BOOST_LOG_FORCEINLINE aux::scoped_logger_attribute< LoggerT > add_scoped_logger_attribute(LoggerT& l, attribute_name const& name, attribute const& attr) +BOOST_FORCEINLINE aux::scoped_logger_attribute< LoggerT > add_scoped_logger_attribute(LoggerT& l, attribute_name const& name, attribute const& attr) { #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) return aux::scoped_logger_attribute< LoggerT >(l, name, attr); @@ -194,7 +194,7 @@ public: } #ifndef BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT - BOOST_LOG_DELETED_FUNCTION(scoped_thread_attribute(scoped_thread_attribute const&)) + BOOST_DELETED_FUNCTION(scoped_thread_attribute(scoped_thread_attribute const&)) #else // BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT scoped_thread_attribute(scoped_thread_attribute const& that) : m_itAttribute(that.m_itAttribute) { @@ -202,7 +202,7 @@ public: } #endif // BOOST_LOG_BROKEN_REFERENCE_FROM_RVALUE_INIT - BOOST_LOG_DELETED_FUNCTION(scoped_thread_attribute& operator= (scoped_thread_attribute const&)) + BOOST_DELETED_FUNCTION(scoped_thread_attribute& operator= (scoped_thread_attribute const&)) }; } // namespace aux @@ -215,7 +215,7 @@ public: * \param attr The attribute. Must not be NULL. * \return An unspecified guard object which may be used to initialize a \c scoped_attribute variable. */ -BOOST_LOG_FORCEINLINE aux::scoped_thread_attribute add_scoped_thread_attribute(attribute_name const& name, attribute const& attr) +BOOST_FORCEINLINE aux::scoped_thread_attribute add_scoped_thread_attribute(attribute_name const& name, attribute const& attr) { #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) return aux::scoped_thread_attribute(name, attr); diff --git a/include/boost/log/attributes/time_traits.hpp b/include/boost/log/attributes/time_traits.hpp index 2e8dfc0..6f16e5b 100644 --- a/include/boost/log/attributes/time_traits.hpp +++ b/include/boost/log/attributes/time_traits.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/timer.hpp b/include/boost/log/attributes/timer.hpp index 0da5b9d..5c49941 100644 --- a/include/boost/log/attributes/timer.hpp +++ b/include/boost/log/attributes/timer.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -59,7 +59,7 @@ public: private: //! Factory implementation - class BOOST_LOG_VISIBLE impl; + class BOOST_SYMBOL_VISIBLE impl; public: /*! diff --git a/include/boost/log/attributes/value_extraction.hpp b/include/boost/log/attributes/value_extraction.hpp index 9f89f9b..b1575bc 100644 --- a/include/boost/log/attributes/value_extraction.hpp +++ b/include/boost/log/attributes/value_extraction.hpp @@ -40,7 +40,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -137,14 +137,14 @@ private: //! The function unwraps \c value_ref, if possible template< typename T, typename TagT > -BOOST_LOG_FORCEINLINE typename enable_if< mpl::is_sequence< T >, value_ref< T, TagT > >::type +BOOST_FORCEINLINE typename enable_if< mpl::is_sequence< T >, value_ref< T, TagT > >::type unwrap_value_ref(value_ref< T, TagT > const& r) { return r; } template< typename T, typename TagT > -BOOST_LOG_FORCEINLINE typename disable_if< mpl::is_sequence< T >, T const& >::type +BOOST_FORCEINLINE typename disable_if< mpl::is_sequence< T >, T const& >::type unwrap_value_ref(value_ref< T, TagT > const& r) { return r.get(); @@ -175,7 +175,7 @@ public: /*! * Default constructor */ - BOOST_LOG_DEFAULTED_FUNCTION(value_extractor(), {}) + BOOST_DEFAULTED_FUNCTION(value_extractor(), {}) /*! * Copy constructor diff --git a/include/boost/log/attributes/value_extraction_fwd.hpp b/include/boost/log/attributes/value_extraction_fwd.hpp index 8ff6180..65fc9d0 100644 --- a/include/boost/log/attributes/value_extraction_fwd.hpp +++ b/include/boost/log/attributes/value_extraction_fwd.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/attributes/value_visitation.hpp b/include/boost/log/attributes/value_visitation.hpp index 7e5000f..1e3ed0f 100644 --- a/include/boost/log/attributes/value_visitation.hpp +++ b/include/boost/log/attributes/value_visitation.hpp @@ -30,7 +30,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -115,7 +115,7 @@ public: /*! * Default constructor */ - BOOST_LOG_DEFAULTED_FUNCTION(value_visitor_invoker(), {}) + BOOST_DEFAULTED_FUNCTION(value_visitor_invoker(), {}) /*! * Copy constructor diff --git a/include/boost/log/attributes/value_visitation_fwd.hpp b/include/boost/log/attributes/value_visitation_fwd.hpp index 6313b88..703dd93 100644 --- a/include/boost/log/attributes/value_visitation_fwd.hpp +++ b/include/boost/log/attributes/value_visitation_fwd.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/common.hpp b/include/boost/log/common.hpp index 8c4f728..d86b984 100644 --- a/include/boost/log/common.hpp +++ b/include/boost/log/common.hpp @@ -34,7 +34,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/core.hpp b/include/boost/log/core.hpp index 3473c2c..128537e 100644 --- a/include/boost/log/core.hpp +++ b/include/boost/log/core.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/core/core.hpp b/include/boost/log/core/core.hpp index ee927d5..9840627 100644 --- a/include/boost/log/core/core.hpp +++ b/include/boost/log/core/core.hpp @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -288,7 +288,7 @@ public: * \b Throws: If an exception handler is installed, only throws if the handler throws. Otherwise may * throw if one of the sinks throws, or some system resource limitation is reached. */ - BOOST_LOG_FORCEINLINE record open_record(BOOST_RV_REF(attribute_value_set) source_attributes) + BOOST_FORCEINLINE record open_record(BOOST_RV_REF(attribute_value_set) source_attributes) { return open_record_move(static_cast< attribute_value_set& >(source_attributes)); } @@ -303,13 +303,13 @@ public: * \b Throws: If an exception handler is installed, only throws if the handler throws. Otherwise may * throw if one of the sinks throws. */ - BOOST_LOG_FORCEINLINE void push_record(BOOST_RV_REF(record) rec) + BOOST_FORCEINLINE void push_record(BOOST_RV_REF(record) rec) { push_record_move(static_cast< record& >(rec)); } - BOOST_LOG_DELETED_FUNCTION(core(core const&)) - BOOST_LOG_DELETED_FUNCTION(core& operator= (core const&)) + BOOST_DELETED_FUNCTION(core(core const&)) + BOOST_DELETED_FUNCTION(core& operator= (core const&)) #ifndef BOOST_LOG_DOXYGEN_PASS private: diff --git a/include/boost/log/core/record.hpp b/include/boost/log/core/record.hpp index 17ab8a9..bd4fb61 100644 --- a/include/boost/log/core/record.hpp +++ b/include/boost/log/core/record.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/core/record_view.hpp b/include/boost/log/core/record_view.hpp index 717faa4..1edb99c 100644 --- a/include/boost/log/core/record_view.hpp +++ b/include/boost/log/core/record_view.hpp @@ -26,7 +26,7 @@ #endif // BOOST_LOG_NO_THREADS #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -85,8 +85,8 @@ private: protected: ~public_data() {} - BOOST_LOG_DELETED_FUNCTION(public_data(public_data const&)) - BOOST_LOG_DELETED_FUNCTION(public_data& operator= (public_data const&)) + BOOST_DELETED_FUNCTION(public_data(public_data const&)) + BOOST_DELETED_FUNCTION(public_data& operator= (public_data const&)) friend void intrusive_ptr_add_ref(const public_data* p) { ++p->m_ref_counter; } friend void intrusive_ptr_release(const public_data* p) { if (--p->m_ref_counter == 0) public_data::destroy(p); } @@ -108,7 +108,7 @@ public: * * \post !*this == true */ - BOOST_LOG_DEFAULTED_FUNCTION(record_view(), {}) + BOOST_DEFAULTED_FUNCTION(record_view(), {}) /*! * Copy constructor diff --git a/include/boost/log/detail/alignas.hpp b/include/boost/log/detail/alignas.hpp deleted file mode 100644 index f150c1e..0000000 --- a/include/boost/log/detail/alignas.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright Andrey Semashev 2007 - 2013. - * 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 alignas.hpp - * \author Andrey Semashev - * \date 06.07.2012 - * - * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. - */ - -#ifndef BOOST_LOG_DETAIL_ALIGNAS_HPP_INCLUDED_ -#define BOOST_LOG_DETAIL_ALIGNAS_HPP_INCLUDED_ - -#include - -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE -#pragma once -#endif - -// The macro allows to specify type or variable alignment -#if defined(_MSC_VER) -#define BOOST_LOG_ALIGNAS(x) __declspec(align(x)) -#elif defined(BOOST_CLANG) -#if __has_feature(cxx_alignas) || __has_extension(cxx_alignas) -#define BOOST_LOG_ALIGNAS(x) alignas(x) -#endif -#elif defined(__GNUC__) -#if defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) -#define BOOST_LOG_ALIGNAS(x) alignas(x) -#else -#define BOOST_LOG_ALIGNAS(x) __attribute__((__aligned__(x))) -#endif -#endif - -#if !defined(BOOST_LOG_ALIGNAS) -#define BOOST_LOG_NO_ALIGNAS 1 -#define BOOST_LOG_ALIGNAS(x) -#endif - -#endif // BOOST_LOG_DETAIL_ALIGNAS_HPP_INCLUDED_ diff --git a/include/boost/log/detail/asio_fwd.hpp b/include/boost/log/detail/asio_fwd.hpp index 4b27d99..17a3fde 100644 --- a/include/boost/log/detail/asio_fwd.hpp +++ b/include/boost/log/detail/asio_fwd.hpp @@ -10,7 +10,7 @@ * \date 20.04.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. * * The header provides forward declarations of Boost.ASIO that are required for the user's * code to compile with Boost.Log. The forward declarations allow to avoid including the major @@ -22,7 +22,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/attachable_sstream_buf.hpp b/include/boost/log/detail/attachable_sstream_buf.hpp index acc439f..91e8c52 100644 --- a/include/boost/log/detail/attachable_sstream_buf.hpp +++ b/include/boost/log/detail/attachable_sstream_buf.hpp @@ -10,7 +10,7 @@ * \date 29.07.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_ATTACHABLE_SSTREAM_BUF_HPP_INCLUDED_ @@ -24,7 +24,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -156,9 +156,9 @@ protected: } //! Copy constructor (closed) - BOOST_LOG_DELETED_FUNCTION(basic_ostringstreambuf(basic_ostringstreambuf const& that)) + BOOST_DELETED_FUNCTION(basic_ostringstreambuf(basic_ostringstreambuf const& that)) //! Assignment (closed) - BOOST_LOG_DELETED_FUNCTION(basic_ostringstreambuf& operator= (basic_ostringstreambuf const& that)) + BOOST_DELETED_FUNCTION(basic_ostringstreambuf& operator= (basic_ostringstreambuf const& that)) }; } // namespace aux diff --git a/include/boost/log/detail/attr_output_impl.hpp b/include/boost/log/detail/attr_output_impl.hpp index 751d079..2e8bb16 100644 --- a/include/boost/log/detail/attr_output_impl.hpp +++ b/include/boost/log/detail/attr_output_impl.hpp @@ -10,7 +10,7 @@ * \date 12.08.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_ATTR_OUTPUT_IMPL_HPP_INCLUDED_ @@ -24,7 +24,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -44,7 +44,7 @@ struct make_output_expression //! Creates the output expression template< typename RightT > - static BOOST_LOG_FORCEINLINE type make(LeftT const& left, RightT const& right) + static BOOST_FORCEINLINE type make(LeftT const& left, RightT const& right) { return type(left, right.get_name(), to_log_fun< TagT >(), right.get_fallback_policy()); } @@ -65,7 +65,7 @@ struct make_output_actor< ActorT< LeftExprT >, RightT, ValueT, false > typedef ActorT< typename make_expression::type > type; - static BOOST_LOG_FORCEINLINE type make(ActorT< LeftExprT > const& left, RightT const& right) + static BOOST_FORCEINLINE type make(ActorT< LeftExprT > const& left, RightT const& right) { type res = {{ make_expression::make(left, right) }}; return res; @@ -79,7 +79,7 @@ struct make_output_actor< ActorT< LeftExprT >, RightT, ValueT, true > typedef ActorT< expression_type > type; - static BOOST_LOG_FORCEINLINE type make(ActorT< LeftExprT > const& left, RightT const& right) + static BOOST_FORCEINLINE type make(ActorT< LeftExprT > const& left, RightT const& right) { type res = {{ expression_type(left, right.get_name(), to_log_fun< typename RightT::tag_type >(), right.get_fallback_policy()) }}; return res; @@ -90,7 +90,7 @@ struct make_output_actor< ActorT< LeftExprT >, RightT, ValueT, true > #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename T, typename FallbackPolicyT, typename TagT >\ - BOOST_LOG_FORCEINLINE typename aux::make_output_actor< phoenix::actor< LeftExprT >, attribute_actor< T, FallbackPolicyT, TagT, phoenix::actor > >::type\ + BOOST_FORCEINLINE typename aux::make_output_actor< phoenix::actor< LeftExprT >, attribute_actor< T, FallbackPolicyT, TagT, phoenix::actor > >::type\ operator<< (phoenix::actor< LeftExprT > left_ref left, attribute_actor< T, FallbackPolicyT, TagT, phoenix::actor > right_ref right)\ {\ return aux::make_output_actor< phoenix::actor< LeftExprT >, attribute_actor< T, FallbackPolicyT, TagT, phoenix::actor > >::make(left, right);\ diff --git a/include/boost/log/detail/attr_output_terminal.hpp b/include/boost/log/detail/attr_output_terminal.hpp index a87162e..9a4428e 100644 --- a/include/boost/log/detail/attr_output_terminal.hpp +++ b/include/boost/log/detail/attr_output_terminal.hpp @@ -31,7 +31,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -139,7 +139,7 @@ public: return strm; } - BOOST_LOG_DELETED_FUNCTION(attribute_output_terminal()) + BOOST_DELETED_FUNCTION(attribute_output_terminal()) }; } // namespace aux diff --git a/include/boost/log/detail/attribute_get_value_impl.hpp b/include/boost/log/detail/attribute_get_value_impl.hpp index 40ca678..111e1a8 100644 --- a/include/boost/log/detail/attribute_get_value_impl.hpp +++ b/include/boost/log/detail/attribute_get_value_impl.hpp @@ -10,7 +10,7 @@ * \date 04.08.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_ATTRIBUTE_GET_VALUE_IMPL_HPP_INCLUDED_ @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/attribute_predicate.hpp b/include/boost/log/detail/attribute_predicate.hpp index 420138c..8ce3614 100644 --- a/include/boost/log/detail/attribute_predicate.hpp +++ b/include/boost/log/detail/attribute_predicate.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/cleanup_scope_guard.hpp b/include/boost/log/detail/cleanup_scope_guard.hpp index 695300e..5abddef 100644 --- a/include/boost/log/detail/cleanup_scope_guard.hpp +++ b/include/boost/log/detail/cleanup_scope_guard.hpp @@ -10,7 +10,7 @@ * \date 11.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_CLEANUP_SCOPE_GUARD_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -37,8 +37,8 @@ struct cleanup_guard ~cleanup_guard() { m_Obj.clear(); } // Copying prohibited - BOOST_LOG_DELETED_FUNCTION(cleanup_guard(cleanup_guard const&)) - BOOST_LOG_DELETED_FUNCTION(cleanup_guard& operator= (cleanup_guard const&)) + BOOST_DELETED_FUNCTION(cleanup_guard(cleanup_guard const&)) + BOOST_DELETED_FUNCTION(cleanup_guard& operator= (cleanup_guard const&)) private: T& m_Obj; diff --git a/include/boost/log/detail/code_conversion.hpp b/include/boost/log/detail/code_conversion.hpp index 1c65f4e..88cc535 100644 --- a/include/boost/log/detail/code_conversion.hpp +++ b/include/boost/log/detail/code_conversion.hpp @@ -10,7 +10,7 @@ * \date 08.11.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_CODE_CONVERSION_HPP_INCLUDED_ @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/config.hpp b/include/boost/log/detail/config.hpp index 342087a..d109ab4 100644 --- a/include/boost/log/detail/config.hpp +++ b/include/boost/log/detail/config.hpp @@ -10,7 +10,7 @@ * \date 08.03.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. In this file + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. In this file * internal configuration macros are defined. */ @@ -39,11 +39,7 @@ # endif #endif -#if (defined(_MSC_VER) && (_MSC_VER >= 1020)) || defined(__GNUC__) || defined(BOOST_CLANG) || defined(BOOST_INTEL) || defined(__COMO__) || defined(__DMC__) -# define BOOST_LOG_HAS_PRAGMA_ONCE -#endif - -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -120,39 +116,11 @@ # define BOOST_LOG_ANONYMOUS_NAMESPACE namespace #endif -#define BOOST_LOG_NO_TRAILING_RESULT_TYPE -#define BOOST_LOG_NO_INLINE_NAMESPACES - -#if defined(BOOST_CLANG) -# if __has_feature(cxx_trailing_return) -# undef BOOST_LOG_NO_TRAILING_RESULT_TYPE -# endif -# if __has_feature(cxx_inline_namespaces) -# undef BOOST_LOG_NO_INLINE_NAMESPACES -# endif -#elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) -# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -# undef BOOST_LOG_NO_TRAILING_RESULT_TYPE -# undef BOOST_LOG_NO_INLINE_NAMESPACES -# endif -#endif - #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || (defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 6)) // GCC up to 4.6 (inclusively) did not support expanding template argument packs into non-variadic template arguments #define BOOST_LOG_NO_CXX11_ARG_PACKS_TO_NON_VARIADIC_ARGS_EXPANSION #endif -// Extended declaration macros. Used to implement compiler-specific optimizations. -#if defined(BOOST_FORCEINLINE) -# define BOOST_LOG_FORCEINLINE BOOST_FORCEINLINE -#elif defined(_MSC_VER) -# define BOOST_LOG_FORCEINLINE __forceinline -#elif defined(__GNUC__) && (__GNUC__ > 3) -# define BOOST_LOG_FORCEINLINE inline __attribute__((always_inline)) -#else -# define BOOST_LOG_FORCEINLINE inline -#endif - #if defined(_MSC_VER) # define BOOST_LOG_NO_VTABLE __declspec(novtable) #elif defined(__GNUC__) @@ -206,14 +174,6 @@ # define BOOST_LOG_HAS_CXXABI_H #endif -#if defined(BOOST_SYMBOL_VISIBLE) -# define BOOST_LOG_VISIBLE BOOST_SYMBOL_VISIBLE -#elif defined(__GNUC__) && (__GNUC__ >= 4) -# define BOOST_LOG_VISIBLE __attribute__((visibility("default"))) -#else -# define BOOST_LOG_VISIBLE -#endif - #if !defined(BOOST_LOG_BUILDING_THE_LIB) // Detect if we're dealing with dll @@ -269,7 +229,7 @@ # endif # endif # ifndef BOOST_LOG_API -# define BOOST_LOG_API BOOST_LOG_VISIBLE +# define BOOST_LOG_API BOOST_SYMBOL_VISIBLE # endif #endif // !defined(BOOST_LOG_BUILDING_THE_LIB) @@ -312,23 +272,6 @@ # endif #endif // defined(BOOST_LOG_USE_COMPILER_TLS) -#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) - // GCC 4.5 forbids declaration of defaulted functions in private or protected sections -# define BOOST_LOG_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS -#endif - -#if defined(BOOST_LOG_DOXYGEN_PASS) || !(defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || defined(BOOST_LOG_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)) -# define BOOST_LOG_DEFAULTED_FUNCTION(fun, body) fun = default; -#else -# define BOOST_LOG_DEFAULTED_FUNCTION(fun, body) fun body -#endif - -#if defined(BOOST_LOG_DOXYGEN_PASS) || !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) -# define BOOST_LOG_DELETED_FUNCTION(fun) fun = delete; -#else -# define BOOST_LOG_DELETED_FUNCTION(fun) private: fun; -#endif - namespace boost { // Setup namespace name @@ -370,7 +313,7 @@ namespace boost { namespace log { -# if !defined(BOOST_LOG_NO_INLINE_NAMESPACES) +# if !defined(BOOST_NO_CXX11_INLINE_NAMESPACES) inline namespace BOOST_LOG_VERSION_NAMESPACE {} } diff --git a/include/boost/log/detail/custom_terminal_spec.hpp b/include/boost/log/detail/custom_terminal_spec.hpp index 6d4d7bb..15e24bf 100644 --- a/include/boost/log/detail/custom_terminal_spec.hpp +++ b/include/boost/log/detail/custom_terminal_spec.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/date_time_fmt_gen_traits_fwd.hpp b/include/boost/log/detail/date_time_fmt_gen_traits_fwd.hpp index 0dca8ba..9af64f5 100644 --- a/include/boost/log/detail/date_time_fmt_gen_traits_fwd.hpp +++ b/include/boost/log/detail/date_time_fmt_gen_traits_fwd.hpp @@ -10,7 +10,7 @@ * \date 07.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_DATE_TIME_FMT_GEN_TRAITS_FWD_HPP_INCLUDED_ @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/date_time_format_parser.hpp b/include/boost/log/detail/date_time_format_parser.hpp index 3aaac62..fdbdf85 100644 --- a/include/boost/log/detail/date_time_format_parser.hpp +++ b/include/boost/log/detail/date_time_format_parser.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/decomposed_time.hpp b/include/boost/log/detail/decomposed_time.hpp index fe30cab..f89e419 100644 --- a/include/boost/log/detail/decomposed_time.hpp +++ b/include/boost/log/detail/decomposed_time.hpp @@ -10,7 +10,7 @@ * \date 07.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_DECOMPOSED_TIME_HPP_INCLUDED_ @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -100,7 +100,7 @@ struct decomposed_time_wrapper : typedef T value_type; value_type m_time; - BOOST_LOG_DEFAULTED_FUNCTION(decomposed_time_wrapper(), {}) + BOOST_DEFAULTED_FUNCTION(decomposed_time_wrapper(), {}) explicit decomposed_time_wrapper(value_type const& time) : m_time(time) { @@ -144,8 +144,8 @@ public: { } - BOOST_LOG_DELETED_FUNCTION(context(context const&)) - BOOST_LOG_DELETED_FUNCTION(context& operator=(context const&)) + BOOST_DELETED_FUNCTION(context(context const&)) + BOOST_DELETED_FUNCTION(context& operator=(context const&)) }; private: @@ -159,7 +159,7 @@ protected: string_type m_literal_chars; public: - BOOST_LOG_DEFAULTED_FUNCTION(date_time_formatter(), {}) + BOOST_DEFAULTED_FUNCTION(date_time_formatter(), {}) date_time_formatter(date_time_formatter const& that) : m_formatters(that.m_formatters), m_literal_lens(that.m_literal_lens), diff --git a/include/boost/log/detail/deduce_char_type.hpp b/include/boost/log/detail/deduce_char_type.hpp index 098809c..1d2ee23 100644 --- a/include/boost/log/detail/deduce_char_type.hpp +++ b/include/boost/log/detail/deduce_char_type.hpp @@ -10,7 +10,7 @@ * \date 17.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_DEDUCE_CHAR_TYPE_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/default_attribute_names.hpp b/include/boost/log/detail/default_attribute_names.hpp index 3aeeb21..c398937 100644 --- a/include/boost/log/detail/default_attribute_names.hpp +++ b/include/boost/log/detail/default_attribute_names.hpp @@ -10,7 +10,7 @@ * \date 15.01.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_DEFAULT_ATTRIBUTE_NAMES_HPP_INCLUDED_ @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/embedded_string_type.hpp b/include/boost/log/detail/embedded_string_type.hpp index 4fb58a8..a587a02 100644 --- a/include/boost/log/detail/embedded_string_type.hpp +++ b/include/boost/log/detail/embedded_string_type.hpp @@ -10,7 +10,7 @@ * \date 16.08.2009 * * This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_EMBEDDED_STRING_TYPE_HPP_INCLUDED_ @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/event.hpp b/include/boost/log/detail/event.hpp index 7ee9131..3974841 100644 --- a/include/boost/log/detail/event.hpp +++ b/include/boost/log/detail/event.hpp @@ -15,7 +15,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -67,10 +67,9 @@ public: //! Sets the object to a signalled state BOOST_LOG_API void set_signalled(); -private: // Copying prohibited - sem_based_event(sem_based_event const&); - sem_based_event& operator= (sem_based_event const&); + BOOST_DELETED_FUNCTION(sem_based_event(sem_based_event const&)) + BOOST_DELETED_FUNCTION(sem_based_event& operator= (sem_based_event const&)) }; typedef sem_based_event event; @@ -94,10 +93,9 @@ public: //! Sets the object to a signalled state BOOST_LOG_API void set_signalled(); -private: // Copying prohibited - winapi_based_event(winapi_based_event const&); - winapi_based_event& operator= (winapi_based_event const&); + BOOST_DELETED_FUNCTION(winapi_based_event(winapi_based_event const&)) + BOOST_DELETED_FUNCTION(winapi_based_event& operator= (winapi_based_event const&)) }; typedef winapi_based_event event; @@ -122,10 +120,9 @@ public: //! Sets the object to a signalled state BOOST_LOG_API void set_signalled(); -private: // Copying prohibited - generic_event(generic_event const&); - generic_event& operator= (generic_event const&); + BOOST_DELETED_FUNCTION(generic_event(generic_event const&)) + BOOST_DELETED_FUNCTION(generic_event& operator= (generic_event const&)) }; typedef generic_event event; diff --git a/include/boost/log/detail/fake_mutex.hpp b/include/boost/log/detail/fake_mutex.hpp index dd70eff..3c21a16 100644 --- a/include/boost/log/detail/fake_mutex.hpp +++ b/include/boost/log/detail/fake_mutex.hpp @@ -10,7 +10,7 @@ * \date 31.07.2011 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_FAKE_MUTEX_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -33,7 +33,7 @@ namespace aux { class fake_mutex { public: - BOOST_LOG_DEFAULTED_FUNCTION(fake_mutex(), {}) + BOOST_DEFAULTED_FUNCTION(fake_mutex(), {}) void lock() {} bool try_lock() { return true; } template< typename T > @@ -41,8 +41,8 @@ public: void unlock() {} // Copying prohibited - BOOST_LOG_DELETED_FUNCTION(fake_mutex(fake_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(fake_mutex& operator=(fake_mutex const&)) + BOOST_DELETED_FUNCTION(fake_mutex(fake_mutex const&)) + BOOST_DELETED_FUNCTION(fake_mutex& operator=(fake_mutex const&)) }; } // namespace aux diff --git a/include/boost/log/detail/footer.hpp b/include/boost/log/detail/footer.hpp index fce7746..853da99 100644 --- a/include/boost/log/detail/footer.hpp +++ b/include/boost/log/detail/footer.hpp @@ -8,7 +8,13 @@ #if !defined(BOOST_LOG_ENABLE_WARNINGS) #if defined(_MSC_VER) + #pragma warning(pop) + +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 + +#pragma GCC diagnostic pop + #endif #endif // !defined(BOOST_LOG_ENABLE_WARNINGS) diff --git a/include/boost/log/detail/format.hpp b/include/boost/log/detail/format.hpp index 879d47b..54b35f5 100644 --- a/include/boost/log/detail/format.hpp +++ b/include/boost/log/detail/format.hpp @@ -10,7 +10,7 @@ * \date 15.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_FORMAT_HPP_INCLUDED_ @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -87,7 +87,7 @@ public: //! Format element descriptors format_element_list format_elements; - BOOST_LOG_DEFAULTED_FUNCTION(format_description(), {}) + BOOST_DEFAULTED_FUNCTION(format_description(), {}) format_description(format_description const& that) : literal_chars(that.literal_chars), format_elements(that.format_elements) { @@ -113,14 +113,14 @@ BOOST_LOG_API format_description< CharT > parse_format(const CharT* begin, const //! Parses format string template< typename CharT > -BOOST_LOG_FORCEINLINE format_description< CharT > parse_format(const CharT* begin) +BOOST_FORCEINLINE format_description< CharT > parse_format(const CharT* begin) { return parse_format(begin, begin + std::char_traits< CharT >::length(begin)); } //! Parses format string template< typename CharT, typename TraitsT, typename AllocatorT > -BOOST_LOG_FORCEINLINE format_description< CharT > parse_format(std::basic_string< CharT, TraitsT, AllocatorT > const& fmt) +BOOST_FORCEINLINE format_description< CharT > parse_format(std::basic_string< CharT, TraitsT, AllocatorT > const& fmt) { const CharT* begin = fmt.c_str(); return parse_format(begin, begin + fmt.size()); diff --git a/include/boost/log/detail/function_traits.hpp b/include/boost/log/detail/function_traits.hpp index 78cdda6..a7b3be9 100644 --- a/include/boost/log/detail/function_traits.hpp +++ b/include/boost/log/detail/function_traits.hpp @@ -10,7 +10,7 @@ * \date 30.08.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_FUNCTION_TRAITS_HPP_INCLUDED_ @@ -35,7 +35,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/header.hpp b/include/boost/log/detail/header.hpp index a4b9021..0959824 100644 --- a/include/boost/log/detail/header.hpp +++ b/include/boost/log/detail/header.hpp @@ -10,6 +10,7 @@ #if !defined(BOOST_LOG_ENABLE_WARNINGS) #if defined(_MSC_VER) + #pragma warning(push, 3) // 'm_A' : class 'A' needs to have dll-interface to be used by clients of class 'B' #pragma warning(disable: 4251) @@ -35,6 +36,25 @@ #pragma warning(disable: 4610) // function marked as __forceinline not inlined #pragma warning(disable: 4714) +// decorated name length exceeded, name was truncated +#pragma warning(disable: 4503) + +#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \ + && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 + +#pragma GCC diagnostic push +// 'var' defined but not used +#pragma GCC diagnostic ignored "-Wunused-variable" +// unused parameter 'arg' +#pragma GCC diagnostic ignored "-Wunused-parameter" +// missing initializer for member var +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" + +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 +// typedef ‘foo’ locally defined but not used +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#endif + #endif #endif // !defined(BOOST_LOG_ENABLE_WARNINGS) diff --git a/include/boost/log/detail/id.hpp b/include/boost/log/detail/id.hpp index db4afe1..9c43776 100644 --- a/include/boost/log/detail/id.hpp +++ b/include/boost/log/detail/id.hpp @@ -10,7 +10,7 @@ * \date 08.01.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_ID_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/intptr_t.hpp b/include/boost/log/detail/intptr_t.hpp deleted file mode 100644 index f5151c8..0000000 --- a/include/boost/log/detail/intptr_t.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright Andrey Semashev 2007 - 2013. - * 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 intptr_t.hpp - * \author Andrey Semashev - * \date 06.05.2013 - * - * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. - */ - -#ifndef BOOST_LOG_DETAIL_INTPTR_T_HPP_INCLUDED_ -#define BOOST_LOG_DETAIL_INTPTR_T_HPP_INCLUDED_ - -#include -#include -#include - -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { - -BOOST_LOG_OPEN_NAMESPACE - -namespace aux { - -// PGI seems to not support intptr_t/uintptr_t properly. BOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config. -#if !defined(__PGIC__) - -#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \ - || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \ - || defined(__CYGWIN__) \ - || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ - || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) - -typedef ::intptr_t intptr_t; -typedef ::uintptr_t uintptr_t; -#define BOOST_LOG_HAS_INTPTR_T - -#elif (defined(__GNUC__) || defined(__clang__)) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__) - -typedef __INTPTR_TYPE__ intptr_t; -typedef __UINTPTR_TYPE__ uintptr_t; -#define BOOST_LOG_HAS_INTPTR_T - -#endif - -#endif - -} // namespace aux - -BOOST_LOG_CLOSE_NAMESPACE // namespace log - -} // namespace boost - -#include - -#endif // BOOST_LOG_DETAIL_INTPTR_T_HPP_INCLUDED_ diff --git a/include/boost/log/detail/light_function.hpp b/include/boost/log/detail/light_function.hpp index e870615..ba09dde 100644 --- a/include/boost/log/detail/light_function.hpp +++ b/include/boost/log/detail/light_function.hpp @@ -10,7 +10,7 @@ * \date 20.06.2010 * * \brief This header is the Boost.Log library impl, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. * * The file contains a lightweight alternative of Boost.Function. It does not provide all * features of Boost.Function but doesn't introduce dependency on Boost.Bind. @@ -44,7 +44,7 @@ #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/light_rw_mutex.hpp b/include/boost/log/detail/light_rw_mutex.hpp index a6bad5a..544ae14 100644 --- a/include/boost/log/detail/light_rw_mutex.hpp +++ b/include/boost/log/detail/light_rw_mutex.hpp @@ -10,7 +10,7 @@ * \date 24.03.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_LIGHT_RW_MUTEX_HPP_INCLUDED_ @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -105,8 +105,8 @@ public: } // Noncopyable - BOOST_LOG_DELETED_FUNCTION(light_rw_mutex(light_rw_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(light_rw_mutex& operator= (light_rw_mutex const&)) + BOOST_DELETED_FUNCTION(light_rw_mutex(light_rw_mutex const&)) + BOOST_DELETED_FUNCTION(light_rw_mutex& operator= (light_rw_mutex const&)) }; } // namespace aux @@ -157,8 +157,8 @@ public: } // Noncopyable - BOOST_LOG_DELETED_FUNCTION(light_rw_mutex(light_rw_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(light_rw_mutex& operator= (light_rw_mutex const&)) + BOOST_DELETED_FUNCTION(light_rw_mutex(light_rw_mutex const&)) + BOOST_DELETED_FUNCTION(light_rw_mutex& operator= (light_rw_mutex const&)) }; } // namespace aux @@ -189,8 +189,8 @@ public: BOOST_LOG_API void unlock(); // Noncopyable - BOOST_LOG_DELETED_FUNCTION(light_rw_mutex(light_rw_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(light_rw_mutex& operator= (light_rw_mutex const&)) + BOOST_DELETED_FUNCTION(light_rw_mutex(light_rw_mutex const&)) + BOOST_DELETED_FUNCTION(light_rw_mutex& operator= (light_rw_mutex const&)) }; } // namespace aux diff --git a/include/boost/log/detail/locking_ptr.hpp b/include/boost/log/detail/locking_ptr.hpp index 672189e..62a9c6f 100644 --- a/include/boost/log/detail/locking_ptr.hpp +++ b/include/boost/log/detail/locking_ptr.hpp @@ -10,7 +10,7 @@ * \date 15.07.2009 * * This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_LOCKING_PTR_HPP_INCLUDED_ @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/locks.hpp b/include/boost/log/detail/locks.hpp index 5d46e65..65e2704 100644 --- a/include/boost/log/detail/locks.hpp +++ b/include/boost/log/detail/locks.hpp @@ -10,7 +10,7 @@ * \date 30.05.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_LOCKS_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/malloc_aligned.hpp b/include/boost/log/detail/malloc_aligned.hpp index 0f5f488..02cb3fe 100644 --- a/include/boost/log/detail/malloc_aligned.hpp +++ b/include/boost/log/detail/malloc_aligned.hpp @@ -10,7 +10,7 @@ * \date 12.07.2013 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_MALLOC_ALIGNED_HPP_INCLUDED_ @@ -53,7 +53,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/named_scope_fmt_pp.hpp b/include/boost/log/detail/named_scope_fmt_pp.hpp index 00d743a..b041bc7 100644 --- a/include/boost/log/detail/named_scope_fmt_pp.hpp +++ b/include/boost/log/detail/named_scope_fmt_pp.hpp @@ -6,7 +6,7 @@ */ template< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename ArgT) > -BOOST_LOG_FORCEINLINE format_named_scope_actor< +BOOST_FORCEINLINE format_named_scope_actor< fallback_to_none, typename boost::log::aux::deduce_char_type< typename parameter::binding< @@ -28,7 +28,7 @@ BOOST_LOG_FORCEINLINE format_named_scope_actor< } template< typename DescriptorT, template< typename > class ActorT, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename ArgT) > -BOOST_LOG_FORCEINLINE format_named_scope_actor< +BOOST_FORCEINLINE format_named_scope_actor< fallback_to_none, typename boost::log::aux::deduce_char_type< typename parameter::binding< @@ -55,7 +55,7 @@ format_named_scope(attribute_keyword< DescriptorT, ActorT > const& keyword, BOOS } template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename ArgT) > -BOOST_LOG_FORCEINLINE format_named_scope_actor< +BOOST_FORCEINLINE format_named_scope_actor< FallbackPolicyT, typename boost::log::aux::deduce_char_type< typename parameter::binding< diff --git a/include/boost/log/detail/native_typeof.hpp b/include/boost/log/detail/native_typeof.hpp index 98c8bf9..8f742bc 100644 --- a/include/boost/log/detail/native_typeof.hpp +++ b/include/boost/log/detail/native_typeof.hpp @@ -10,7 +10,7 @@ * \date 08.03.2009 * * This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_ @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/parameter_tools.hpp b/include/boost/log/detail/parameter_tools.hpp index a8df786..eea2f7b 100644 --- a/include/boost/log/detail/parameter_tools.hpp +++ b/include/boost/log/detail/parameter_tools.hpp @@ -10,7 +10,7 @@ * \date 28.06.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_PARAMETER_TOOLS_HPP_INCLUDED_ @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/pp_identity.hpp b/include/boost/log/detail/pp_identity.hpp index ed73c97..d05d196 100644 --- a/include/boost/log/detail/pp_identity.hpp +++ b/include/boost/log/detail/pp_identity.hpp @@ -10,7 +10,7 @@ * \date 12.02.2011 * * This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_PP_IDENTITY_HPP_INCLUDED_ @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/process_id.hpp b/include/boost/log/detail/process_id.hpp index 634b4e4..1dce267 100644 --- a/include/boost/log/detail/process_id.hpp +++ b/include/boost/log/detail/process_id.hpp @@ -10,7 +10,7 @@ * \date 12.09.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_PROCESS_ID_HPP_INCLUDED_ @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/setup_config.hpp b/include/boost/log/detail/setup_config.hpp index 5cb2b5c..583b7b9 100644 --- a/include/boost/log/detail/setup_config.hpp +++ b/include/boost/log/detail/setup_config.hpp @@ -10,7 +10,7 @@ * \date 14.09.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. In this file + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. In this file * internal configuration macros are defined. */ @@ -19,7 +19,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/singleton.hpp b/include/boost/log/detail/singleton.hpp index a5e9dde..94de4e6 100644 --- a/include/boost/log/detail/singleton.hpp +++ b/include/boost/log/detail/singleton.hpp @@ -10,7 +10,7 @@ * \date 20.04.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_SINGLETON_HPP_INCLUDED_ @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -35,7 +35,7 @@ template< typename DerivedT, typename StorageT = DerivedT > class lazy_singleton { public: - BOOST_LOG_DEFAULTED_FUNCTION(lazy_singleton(), {}) + BOOST_DEFAULTED_FUNCTION(lazy_singleton(), {}) //! Returns the singleton instance static StorageT& get() @@ -53,8 +53,8 @@ public: get_instance(); } - BOOST_LOG_DELETED_FUNCTION(lazy_singleton(lazy_singleton const&)) - BOOST_LOG_DELETED_FUNCTION(lazy_singleton& operator= (lazy_singleton const&)) + BOOST_DELETED_FUNCTION(lazy_singleton(lazy_singleton const&)) + BOOST_DELETED_FUNCTION(lazy_singleton& operator= (lazy_singleton const&)) protected: //! Returns the singleton instance (not thread-safe) diff --git a/include/boost/log/detail/sink_init_helpers.hpp b/include/boost/log/detail/sink_init_helpers.hpp index 1724f0b..24742ea 100644 --- a/include/boost/log/detail/sink_init_helpers.hpp +++ b/include/boost/log/detail/sink_init_helpers.hpp @@ -10,7 +10,7 @@ * \date 14.03.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_SINK_INIT_HELPERS_HPP_INCLUDED_ @@ -32,7 +32,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/snprintf.hpp b/include/boost/log/detail/snprintf.hpp index 759ff25..d09f4b2 100644 --- a/include/boost/log/detail/snprintf.hpp +++ b/include/boost/log/detail/snprintf.hpp @@ -10,7 +10,7 @@ * \date 20.02.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_SNPRINTF_HPP_INCLUDED_ @@ -24,7 +24,7 @@ #endif // BOOST_LOG_USE_WCHAR_T #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/spin_mutex.hpp b/include/boost/log/detail/spin_mutex.hpp index 79722d1..0dfb31a 100644 --- a/include/boost/log/detail/spin_mutex.hpp +++ b/include/boost/log/detail/spin_mutex.hpp @@ -10,7 +10,7 @@ * \date 01.08.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_SPIN_MUTEX_HPP_INCLUDED_ @@ -18,12 +18,15 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif #ifndef BOOST_LOG_NO_THREADS +#include +#include + #if defined(BOOST_THREAD_POSIX) // This one can be defined by users, so it should go first #define BOOST_LOG_SPIN_MUTEX_USE_PTHREAD #elif defined(BOOST_WINDOWS) @@ -154,8 +157,8 @@ public: } // Non-copyable - BOOST_LOG_DELETED_FUNCTION(spin_mutex(spin_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(spin_mutex& operator= (spin_mutex const&)) + BOOST_DELETED_FUNCTION(spin_mutex(spin_mutex const&)) + BOOST_DELETED_FUNCTION(spin_mutex& operator= (spin_mutex const&)) }; #undef BOOST_LOG_PAUSE_OP @@ -192,28 +195,52 @@ private: public: spin_mutex() { - BOOST_VERIFY(pthread_spin_init(&m_State, PTHREAD_PROCESS_PRIVATE) == 0); + const int err = pthread_spin_init(&m_State, PTHREAD_PROCESS_PRIVATE); + if (err != 0) + throw_exception< thread_resource_error >(err, "failed to initialize a spin mutex", "spin_mutex::spin_mutex()", __FILE__, __LINE__); } + ~spin_mutex() { - pthread_spin_destroy(&m_State); + BOOST_VERIFY(pthread_spin_destroy(&m_State) == 0); } + bool try_lock() { - return (pthread_spin_trylock(&m_State) == 0); + const int err = pthread_spin_trylock(&m_State); + if (err == 0) + return true; + if (err != EBUSY) + throw_exception< lock_error >(err, "failed to lock a spin mutex", "spin_mutex::try_lock()", __FILE__, __LINE__); + return false; } + void lock() { - BOOST_VERIFY(pthread_spin_lock(&m_State) == 0); + const int err = pthread_spin_lock(&m_State); + if (err != 0) + throw_exception< lock_error >(err, "failed to lock a spin mutex", "spin_mutex::lock()", __FILE__, __LINE__); } + void unlock() { - pthread_spin_unlock(&m_State); + BOOST_VERIFY(pthread_spin_unlock(&m_State) == 0); } // Non-copyable - BOOST_LOG_DELETED_FUNCTION(spin_mutex(spin_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(spin_mutex& operator= (spin_mutex const&)) + BOOST_DELETED_FUNCTION(spin_mutex(spin_mutex const&)) + BOOST_DELETED_FUNCTION(spin_mutex& operator= (spin_mutex const&)) + +private: + template< typename ExceptionT > + static BOOST_NOINLINE BOOST_LOG_NORETURN void throw_exception(int err, const char* descr, const char* func, const char* file, int line) + { +#if !defined(BOOST_EXCEPTION_DISABLE) + boost::exception_detail::throw_exception_(ExceptionT(err, descr), func, file, line); +#else + boost::throw_exception(ExceptionT(err, descr)); +#endif + } }; #else // defined(_POSIX_SPIN_LOCKS) @@ -227,28 +254,52 @@ private: public: spin_mutex() { - BOOST_VERIFY(pthread_mutex_init(&m_State, NULL) == 0); + const int err = pthread_mutex_init(&m_State, NULL); + if (err != 0) + throw_exception< thread_resource_error >(err, "failed to initialize a spin mutex", "spin_mutex::spin_mutex()", __FILE__, __LINE__); } + ~spin_mutex() { - pthread_mutex_destroy(&m_State); + BOOST_VERIFY(pthread_mutex_destroy(&m_State) == 0); } + bool try_lock() { - return (pthread_mutex_trylock(&m_State) == 0); + const int err = pthread_mutex_trylock(&m_State); + if (err == 0) + return true; + if (err != EBUSY) + throw_exception< lock_error >(err, "failed to lock a spin mutex", "spin_mutex::try_lock()", __FILE__, __LINE__); + return false; } + void lock() { - BOOST_VERIFY(pthread_mutex_lock(&m_State) == 0); + const int err = pthread_mutex_lock(&m_State); + if (err != 0) + throw_exception< lock_error >(err, "failed to lock a spin mutex", "spin_mutex::lock()", __FILE__, __LINE__); } + void unlock() { - pthread_mutex_unlock(&m_State); + BOOST_VERIFY(pthread_mutex_unlock(&m_State) == 0); } // Non-copyable - BOOST_LOG_DELETED_FUNCTION(spin_mutex(spin_mutex const&)) - BOOST_LOG_DELETED_FUNCTION(spin_mutex& operator= (spin_mutex const&)) + BOOST_DELETED_FUNCTION(spin_mutex(spin_mutex const&)) + BOOST_DELETED_FUNCTION(spin_mutex& operator= (spin_mutex const&)) + +private: + template< typename ExceptionT > + static BOOST_NOINLINE BOOST_LOG_NORETURN void throw_exception(int err, const char* descr, const char* func, const char* file, int line) + { +#if !defined(BOOST_EXCEPTION_DISABLE) + boost::exception_detail::throw_exception_(ExceptionT(err, descr), func, file, line); +#else + boost::throw_exception(ExceptionT(err, descr)); +#endif + } }; #endif // defined(_POSIX_SPIN_LOCKS) diff --git a/include/boost/log/detail/tagged_integer.hpp b/include/boost/log/detail/tagged_integer.hpp index 9cecc43..134f712 100644 --- a/include/boost/log/detail/tagged_integer.hpp +++ b/include/boost/log/detail/tagged_integer.hpp @@ -10,7 +10,7 @@ * \date 11.01.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_TAGGED_INTEGER_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/thread_id.hpp b/include/boost/log/detail/thread_id.hpp index c922308..db94f3e 100644 --- a/include/boost/log/detail/thread_id.hpp +++ b/include/boost/log/detail/thread_id.hpp @@ -10,7 +10,7 @@ * \date 08.01.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_THREAD_ID_HPP_INCLUDED_ @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/thread_specific.hpp b/include/boost/log/detail/thread_specific.hpp index 8164d25..2892cfb 100644 --- a/include/boost/log/detail/thread_specific.hpp +++ b/include/boost/log/detail/thread_specific.hpp @@ -10,7 +10,7 @@ * \date 01.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_THREAD_SPECIFIC_HPP_INCLUDED_ @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -53,8 +53,8 @@ protected: BOOST_LOG_API void set_content(void* value) const; // Copying prohibited - BOOST_LOG_DELETED_FUNCTION(thread_specific_base(thread_specific_base const&)) - BOOST_LOG_DELETED_FUNCTION(thread_specific_base& operator= (thread_specific_base const&)) + BOOST_DELETED_FUNCTION(thread_specific_base(thread_specific_base const&)) + BOOST_DELETED_FUNCTION(thread_specific_base& operator= (thread_specific_base const&)) }; //! A TLS wrapper for small POD types with least possible overhead @@ -73,7 +73,7 @@ class thread_specific : public: //! Default constructor - BOOST_LOG_DEFAULTED_FUNCTION(thread_specific(), {}) + BOOST_DEFAULTED_FUNCTION(thread_specific(), {}) //! Initializing constructor thread_specific(T const& value) { diff --git a/include/boost/log/detail/threadsafe_queue.hpp b/include/boost/log/detail/threadsafe_queue.hpp index 025eaf9..98d734b 100644 --- a/include/boost/log/detail/threadsafe_queue.hpp +++ b/include/boost/log/detail/threadsafe_queue.hpp @@ -10,7 +10,7 @@ * \date 05.11.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_THREADSAFE_QUEUE_HPP_INCLUDED_ @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -255,10 +255,9 @@ public: return false; } -private: // Copying and assignment is prohibited - threadsafe_queue(threadsafe_queue const&); - threadsafe_queue& operator= (threadsafe_queue const&); + BOOST_DELETED_FUNCTION(threadsafe_queue(threadsafe_queue const&)) + BOOST_DELETED_FUNCTION(threadsafe_queue& operator= (threadsafe_queue const&)) private: //! Pointer to the implementation diff --git a/include/boost/log/detail/timestamp.hpp b/include/boost/log/detail/timestamp.hpp index 1341d7d..f1de990 100644 --- a/include/boost/log/detail/timestamp.hpp +++ b/include/boost/log/detail/timestamp.hpp @@ -10,7 +10,7 @@ * \date 31.07.2011 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_TIMESTAMP_HPP_INCLUDED_ @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/trivial_keyword.hpp b/include/boost/log/detail/trivial_keyword.hpp index 5b38746..8dd50b7 100644 --- a/include/boost/log/detail/trivial_keyword.hpp +++ b/include/boost/log/detail/trivial_keyword.hpp @@ -10,7 +10,7 @@ * \date 02.12.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_TRIVIAL_KEYWORD_HPP_INCLUDED_ @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/unary_function_terminal.hpp b/include/boost/log/detail/unary_function_terminal.hpp index 2bb6a1f..90519d2 100644 --- a/include/boost/log/detail/unary_function_terminal.hpp +++ b/include/boost/log/detail/unary_function_terminal.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -90,7 +90,7 @@ private: public: //! Default constructor - BOOST_LOG_DEFAULTED_FUNCTION(unary_function_terminal(), {}) + BOOST_DEFAULTED_FUNCTION(unary_function_terminal(), {}) //! Copy constructor unary_function_terminal(unary_function_terminal const& that) : m_fun(that.m_fun) {} //! Initializing constructor diff --git a/include/boost/log/detail/unhandled_exception_count.hpp b/include/boost/log/detail/unhandled_exception_count.hpp index 90245ab..4a57b11 100644 --- a/include/boost/log/detail/unhandled_exception_count.hpp +++ b/include/boost/log/detail/unhandled_exception_count.hpp @@ -10,7 +10,7 @@ * \date 05.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DETAIL_UNHANDLED_EXCEPTION_COUNT_HPP_INCLUDED_ @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/detail/value_ref_visitation.hpp b/include/boost/log/detail/value_ref_visitation.hpp index c7744a2..25f3271 100644 --- a/include/boost/log/detail/value_ref_visitation.hpp +++ b/include/boost/log/detail/value_ref_visitation.hpp @@ -10,7 +10,7 @@ * \date 28.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. In this file + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. In this file * internal configuration macros are defined. */ @@ -44,7 +44,7 @@ struct apply_visitor_dispatch { typedef typename VisitorT::result_type result_type; - static BOOST_LOG_FORCEINLINE result_type call(const void* p, unsigned int type_index, VisitorT& visitor) + static BOOST_FORCEINLINE result_type call(const void* p, unsigned int type_index, VisitorT& visitor) { typedef typename mpl::begin< SequenceT >::type begin_type; typedef typename mpl::advance_c< begin_type, SizeV / 2u >::type middle_type; @@ -91,7 +91,7 @@ struct apply_visitor_dispatch< SequenceT, VisitorT, BOOST_LOG_AUX_SWITCH_SIZE > { typedef typename VisitorT::result_type result_type; - static BOOST_LOG_FORCEINLINE result_type call(const void* p, unsigned int type_index, VisitorT& visitor) + static BOOST_FORCEINLINE result_type call(const void* p, unsigned int type_index, VisitorT& visitor) { switch (type_index) { diff --git a/include/boost/log/detail/visible_type.hpp b/include/boost/log/detail/visible_type.hpp index 0e03e19..28770f1 100644 --- a/include/boost/log/detail/visible_type.hpp +++ b/include/boost/log/detail/visible_type.hpp @@ -10,7 +10,7 @@ * \date 08.03.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. In this file + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. In this file * internal configuration macros are defined. */ @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -32,7 +32,7 @@ namespace aux { //! The wrapper type whose type_info is always visible template< typename T > -struct BOOST_LOG_VISIBLE visible_type +struct BOOST_SYMBOL_VISIBLE visible_type { typedef T wrapped_type; }; diff --git a/include/boost/log/exceptions.hpp b/include/boost/log/exceptions.hpp index 71c51d3..8eb5773 100644 --- a/include/boost/log/exceptions.hpp +++ b/include/boost/log/exceptions.hpp @@ -24,7 +24,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -45,7 +45,7 @@ class exception; # endif #else -class BOOST_LOG_VISIBLE exception; +class BOOST_SYMBOL_VISIBLE exception; #endif diff --git a/include/boost/log/expressions.hpp b/include/boost/log/expressions.hpp index ae1c0f6..27cc512 100644 --- a/include/boost/log/expressions.hpp +++ b/include/boost/log/expressions.hpp @@ -31,7 +31,7 @@ // Boost.Phoenix operators are likely to be used with Boost.Log expression nodes anyway #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/attr.hpp b/include/boost/log/expressions/attr.hpp index 2483e90..7a64fc0 100644 --- a/include/boost/log/expressions/attr.hpp +++ b/include/boost/log/expressions/attr.hpp @@ -32,7 +32,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -149,7 +149,7 @@ public: return m_value_extractor(m_name, fusion::at_c< 0 >(phoenix::env(ctx).args())); } - BOOST_LOG_DELETED_FUNCTION(attribute_terminal()) + BOOST_DELETED_FUNCTION(attribute_terminal()) }; /*! @@ -232,7 +232,7 @@ public: * with the specified name and type. */ template< typename AttributeValueT > -BOOST_LOG_FORCEINLINE attribute_actor< AttributeValueT > attr(attribute_name const& name) +BOOST_FORCEINLINE attribute_actor< AttributeValueT > attr(attribute_name const& name) { typedef attribute_actor< AttributeValueT > result_type; typedef typename result_type::terminal_type result_terminal; @@ -245,7 +245,7 @@ BOOST_LOG_FORCEINLINE attribute_actor< AttributeValueT > attr(attribute_name con * with the specified name and type. */ template< typename AttributeValueT, typename TagT > -BOOST_LOG_FORCEINLINE attribute_actor< AttributeValueT, fallback_to_none, TagT > attr(attribute_name const& name) +BOOST_FORCEINLINE attribute_actor< AttributeValueT, fallback_to_none, TagT > attr(attribute_name const& name) { typedef attribute_actor< AttributeValueT, fallback_to_none, TagT > result_type; typedef typename result_type::terminal_type result_terminal; diff --git a/include/boost/log/expressions/attr_fwd.hpp b/include/boost/log/expressions/attr_fwd.hpp index a858bc6..26d3a2e 100644 --- a/include/boost/log/expressions/attr_fwd.hpp +++ b/include/boost/log/expressions/attr_fwd.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/filter.hpp b/include/boost/log/expressions/filter.hpp index 95a0a9f..f65df0d 100644 --- a/include/boost/log/expressions/filter.hpp +++ b/include/boost/log/expressions/filter.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -71,7 +71,7 @@ public: { } /*! - * Move constructor + * Move constructor. The moved-from filter is left in an unspecified state. */ filter(BOOST_RV_REF(filter) that) BOOST_NOEXCEPT : m_Filter(boost::move(that.m_Filter)) { @@ -92,7 +92,7 @@ public: } /*! - * Move assignment. + * Move assignment. The moved-from filter is left in an unspecified state. */ filter& operator= (BOOST_RV_REF(filter) that) BOOST_NOEXCEPT { diff --git a/include/boost/log/expressions/formatter.hpp b/include/boost/log/expressions/formatter.hpp index ebe5f68..05c6dae 100644 --- a/include/boost/log/expressions/formatter.hpp +++ b/include/boost/log/expressions/formatter.hpp @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -94,7 +94,7 @@ public: { } /*! - * Move constructor + * Move constructor. The moved-from formatter is left in an unspecified state. */ basic_formatter(BOOST_RV_REF(this_type) that) BOOST_NOEXCEPT : m_Formatter(boost::move(that.m_Formatter)) { @@ -115,7 +115,7 @@ public: } /*! - * Move assignment. + * Move assignment. The moved-from formatter is left in an unspecified state. */ basic_formatter& operator= (BOOST_RV_REF(this_type) that) BOOST_NOEXCEPT { diff --git a/include/boost/log/expressions/formatters.hpp b/include/boost/log/expressions/formatters.hpp index 79ea0d7..80b7cf4 100644 --- a/include/boost/log/expressions/formatters.hpp +++ b/include/boost/log/expressions/formatters.hpp @@ -31,7 +31,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/formatters/c_decorator.hpp b/include/boost/log/expressions/formatters/c_decorator.hpp index d9ceb23..e52ae0b 100644 --- a/include/boost/log/expressions/formatters/c_decorator.hpp +++ b/include/boost/log/expressions/formatters/c_decorator.hpp @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -118,7 +118,7 @@ struct c_decorator_gen typedef CharT char_type; template< typename SubactorT > - BOOST_LOG_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const + BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const { typedef c_decorator_traits< char_type > traits_type; typedef pattern_replacer< char_type > replacer_type; @@ -153,7 +153,7 @@ const aux::c_decorator_gen< wchar_t > wc_decor = {}; * The function creates a C-style decorator generator for arbitrary character type. */ template< typename CharT > -BOOST_LOG_FORCEINLINE aux::c_decorator_gen< CharT > make_c_decor() +BOOST_FORCEINLINE aux::c_decorator_gen< CharT > make_c_decor() { return aux::c_decorator_gen< CharT >(); } @@ -218,7 +218,7 @@ struct c_ascii_decorator_gen typedef CharT char_type; template< typename SubactorT > - BOOST_LOG_FORCEINLINE char_decorator_actor< SubactorT, c_ascii_pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const + BOOST_FORCEINLINE char_decorator_actor< SubactorT, c_ascii_pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const { typedef c_decorator_traits< char_type > traits_type; typedef c_ascii_pattern_replacer< char_type > replacer_type; @@ -254,7 +254,7 @@ const aux::c_ascii_decorator_gen< wchar_t > wc_ascii_decor = {}; * The function creates a C-style decorator generator for arbitrary character type. */ template< typename CharT > -BOOST_LOG_FORCEINLINE aux::c_ascii_decorator_gen< CharT > make_c_ascii_decor() +BOOST_FORCEINLINE aux::c_ascii_decorator_gen< CharT > make_c_ascii_decor() { return aux::c_ascii_decorator_gen< CharT >(); } diff --git a/include/boost/log/expressions/formatters/char_decorator.hpp b/include/boost/log/expressions/formatters/char_decorator.hpp index e59378e..dc0860b 100644 --- a/include/boost/log/expressions/formatters/char_decorator.hpp +++ b/include/boost/log/expressions/formatters/char_decorator.hpp @@ -45,7 +45,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -342,7 +342,7 @@ public: return strm; } - BOOST_LOG_DELETED_FUNCTION(char_decorator_output_terminal()) + BOOST_DELETED_FUNCTION(char_decorator_output_terminal()) }; } // namespace aux @@ -483,7 +483,7 @@ public: return boost::move(str); } - BOOST_LOG_DELETED_FUNCTION(char_decorator_terminal()) + BOOST_DELETED_FUNCTION(char_decorator_terminal()) }; /*! @@ -519,7 +519,7 @@ public: #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename SubactorT, typename ImplT, template< typename > class ActorT >\ - BOOST_LOG_FORCEINLINE phoenix::actor< aux::char_decorator_output_terminal< phoenix::actor< LeftExprT >, SubactorT, ImplT > >\ + BOOST_FORCEINLINE phoenix::actor< aux::char_decorator_output_terminal< phoenix::actor< LeftExprT >, SubactorT, ImplT > >\ operator<< (phoenix::actor< LeftExprT > left_ref left, char_decorator_actor< SubactorT, ImplT, ActorT > right_ref right)\ {\ typedef aux::char_decorator_output_terminal< phoenix::actor< LeftExprT >, SubactorT, ImplT > terminal_type;\ @@ -548,7 +548,7 @@ public: } template< typename SubactorT > - BOOST_LOG_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const + BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const { typedef pattern_replacer< char_type > replacer_type; typedef char_decorator_actor< SubactorT, replacer_type > result_type; @@ -574,7 +574,7 @@ public: } template< typename SubactorT > - BOOST_LOG_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< from_char_type > > operator[] (SubactorT const& subactor) const + BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< from_char_type > > operator[] (SubactorT const& subactor) const { typedef pattern_replacer< from_char_type > replacer_type; typedef char_decorator_actor< SubactorT, replacer_type > result_type; @@ -594,7 +594,7 @@ public: * substring occurrence in the output will be replaced with decorations[i].second. */ template< typename RangeT > -BOOST_LOG_FORCEINLINE aux::char_decorator_gen1< RangeT > char_decor(RangeT const& decorations) +BOOST_FORCEINLINE aux::char_decorator_gen1< RangeT > char_decor(RangeT const& decorations) { return aux::char_decorator_gen1< RangeT >(decorations); } @@ -610,7 +610,7 @@ BOOST_LOG_FORCEINLINE aux::char_decorator_gen1< RangeT > char_decor(RangeT const * substring occurrence in the output will be replaced with to[i]. */ template< typename FromRangeT, typename ToRangeT > -BOOST_LOG_FORCEINLINE aux::char_decorator_gen2< FromRangeT, ToRangeT > char_decor(FromRangeT const& from, ToRangeT const& to) +BOOST_FORCEINLINE aux::char_decorator_gen2< FromRangeT, ToRangeT > char_decor(FromRangeT const& from, ToRangeT const& to) { return aux::char_decorator_gen2< FromRangeT, ToRangeT >(from, to); } diff --git a/include/boost/log/expressions/formatters/csv_decorator.hpp b/include/boost/log/expressions/formatters/csv_decorator.hpp index 4a0e0dd..cd0c5a0 100644 --- a/include/boost/log/expressions/formatters/csv_decorator.hpp +++ b/include/boost/log/expressions/formatters/csv_decorator.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -88,7 +88,7 @@ struct csv_decorator_gen typedef CharT char_type; template< typename SubactorT > - BOOST_LOG_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const + BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const { typedef csv_decorator_traits< char_type > traits_type; typedef pattern_replacer< char_type > replacer_type; @@ -124,7 +124,7 @@ const aux::csv_decorator_gen< wchar_t > wcsv_decor = {}; * The function creates an CSV-style decorator generator for arbitrary character type. */ template< typename CharT > -BOOST_LOG_FORCEINLINE aux::csv_decorator_gen< CharT > make_csv_decor() +BOOST_FORCEINLINE aux::csv_decorator_gen< CharT > make_csv_decor() { return aux::csv_decorator_gen< CharT >(); } diff --git a/include/boost/log/expressions/formatters/date_time.hpp b/include/boost/log/expressions/formatters/date_time.hpp index 39a82b9..461be5c 100644 --- a/include/boost/log/expressions/formatters/date_time.hpp +++ b/include/boost/log/expressions/formatters/date_time.hpp @@ -37,7 +37,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -140,7 +140,7 @@ public: return boost::move(str); } - BOOST_LOG_DELETED_FUNCTION(format_date_time_terminal()) + BOOST_DELETED_FUNCTION(format_date_time_terminal()) }; /*! @@ -200,7 +200,7 @@ public: #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename T, typename FallbackPolicyT, typename CharT >\ - BOOST_LOG_FORCEINLINE phoenix::actor< aux::attribute_output_terminal< phoenix::actor< LeftExprT >, T, FallbackPolicyT, typename format_date_time_actor< T, FallbackPolicyT, CharT >::formatter_function_type > >\ + BOOST_FORCEINLINE phoenix::actor< aux::attribute_output_terminal< phoenix::actor< LeftExprT >, T, FallbackPolicyT, typename format_date_time_actor< T, FallbackPolicyT, CharT >::formatter_function_type > >\ operator<< (phoenix::actor< LeftExprT > left_ref left, format_date_time_actor< T, FallbackPolicyT, CharT > right_ref right)\ {\ typedef aux::attribute_output_terminal< phoenix::actor< LeftExprT >, T, FallbackPolicyT, typename format_date_time_actor< T, FallbackPolicyT, CharT >::formatter_function_type > terminal_type;\ @@ -222,7 +222,7 @@ public: * \param format Format string */ template< typename AttributeValueT, typename CharT > -BOOST_LOG_FORCEINLINE format_date_time_actor< AttributeValueT, fallback_to_none, CharT > format_date_time(attribute_name const& name, const CharT* format) +BOOST_FORCEINLINE format_date_time_actor< AttributeValueT, fallback_to_none, CharT > format_date_time(attribute_name const& name, const CharT* format) { typedef format_date_time_actor< AttributeValueT, fallback_to_none, CharT > actor_type; typedef typename actor_type::terminal_type terminal_type; @@ -238,7 +238,7 @@ BOOST_LOG_FORCEINLINE format_date_time_actor< AttributeValueT, fallback_to_none, * \param format Format string */ template< typename AttributeValueT, typename CharT > -BOOST_LOG_FORCEINLINE format_date_time_actor< AttributeValueT, fallback_to_none, CharT > format_date_time(attribute_name const& name, std::basic_string< CharT > const& format) +BOOST_FORCEINLINE format_date_time_actor< AttributeValueT, fallback_to_none, CharT > format_date_time(attribute_name const& name, std::basic_string< CharT > const& format) { typedef format_date_time_actor< AttributeValueT, fallback_to_none, CharT > actor_type; typedef typename actor_type::terminal_type terminal_type; @@ -254,7 +254,7 @@ BOOST_LOG_FORCEINLINE format_date_time_actor< AttributeValueT, fallback_to_none, * \param format Format string */ template< typename DescriptorT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_date_time_actor< typename DescriptorT::value_type, fallback_to_none, CharT, ActorT > +BOOST_FORCEINLINE format_date_time_actor< typename DescriptorT::value_type, fallback_to_none, CharT, ActorT > format_date_time(attribute_keyword< DescriptorT, ActorT > const& keyword, const CharT* format) { typedef format_date_time_actor< typename DescriptorT::value_type, fallback_to_none, CharT, ActorT > actor_type; @@ -271,7 +271,7 @@ format_date_time(attribute_keyword< DescriptorT, ActorT > const& keyword, const * \param format Format string */ template< typename DescriptorT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_date_time_actor< typename DescriptorT::value_type, fallback_to_none, CharT, ActorT > +BOOST_FORCEINLINE format_date_time_actor< typename DescriptorT::value_type, fallback_to_none, CharT, ActorT > format_date_time(attribute_keyword< DescriptorT, ActorT > const& keyword, std::basic_string< CharT > const& format) { typedef format_date_time_actor< typename DescriptorT::value_type, fallback_to_none, CharT, ActorT > actor_type; @@ -288,7 +288,7 @@ format_date_time(attribute_keyword< DescriptorT, ActorT > const& keyword, std::b * \param format Format string */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_date_time_actor< T, FallbackPolicyT, CharT, ActorT > +BOOST_FORCEINLINE format_date_time_actor< T, FallbackPolicyT, CharT, ActorT > format_date_time(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& placeholder, const CharT* format) { typedef format_date_time_actor< T, FallbackPolicyT, CharT, ActorT > actor_type; @@ -305,7 +305,7 @@ format_date_time(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& plac * \param format Format string */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_date_time_actor< T, FallbackPolicyT, CharT, ActorT > +BOOST_FORCEINLINE format_date_time_actor< T, FallbackPolicyT, CharT, ActorT > format_date_time(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& placeholder, std::basic_string< CharT > const& format) { typedef format_date_time_actor< T, FallbackPolicyT, CharT, ActorT > actor_type; diff --git a/include/boost/log/expressions/formatters/format.hpp b/include/boost/log/expressions/formatters/format.hpp index c8c71ad..e3ac138 100644 --- a/include/boost/log/expressions/formatters/format.hpp +++ b/include/boost/log/expressions/formatters/format.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -72,7 +72,7 @@ public: return m_format.make_pump(fusion::at_c< 1 >(phoenix::env(ctx).args())); } - BOOST_LOG_DELETED_FUNCTION(format_terminal()) + BOOST_DELETED_FUNCTION(format_terminal()) }; /*! @@ -80,7 +80,7 @@ public: * according to the provided format string. */ template< typename CharT > -BOOST_LOG_FORCEINLINE phoenix::actor< format_terminal< CharT > > format(const CharT* fmt) +BOOST_FORCEINLINE phoenix::actor< format_terminal< CharT > > format(const CharT* fmt) { typedef format_terminal< CharT > terminal_type; phoenix::actor< terminal_type > act = {{ terminal_type(fmt) }}; @@ -92,7 +92,7 @@ BOOST_LOG_FORCEINLINE phoenix::actor< format_terminal< CharT > > format(const Ch * according to the provided format string. */ template< typename CharT, typename TraitsT, typename AllocatorT > -BOOST_LOG_FORCEINLINE phoenix::actor< format_terminal< CharT > > format(std::basic_string< CharT, TraitsT, AllocatorT > const& fmt) +BOOST_FORCEINLINE phoenix::actor< format_terminal< CharT > > format(std::basic_string< CharT, TraitsT, AllocatorT > const& fmt) { typedef format_terminal< CharT > terminal_type; phoenix::actor< terminal_type > act = {{ terminal_type(fmt.c_str()) }}; diff --git a/include/boost/log/expressions/formatters/if.hpp b/include/boost/log/expressions/formatters/if.hpp index c992982..070a752 100644 --- a/include/boost/log/expressions/formatters/if.hpp +++ b/include/boost/log/expressions/formatters/if.hpp @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -113,7 +113,7 @@ public: return strm; } - BOOST_LOG_DELETED_FUNCTION(if_output_terminal()) + BOOST_DELETED_FUNCTION(if_output_terminal()) }; template< typename LeftT, typename CondT, typename ThenT, typename ElseT > @@ -195,7 +195,7 @@ public: return strm; } - BOOST_LOG_DELETED_FUNCTION(if_else_output_terminal()) + BOOST_DELETED_FUNCTION(if_else_output_terminal()) }; @@ -215,7 +215,7 @@ struct if_then_else_gen #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename CondT, typename ThenT, typename ElseT >\ - BOOST_LOG_FORCEINLINE phoenix::actor< if_else_output_terminal< phoenix::actor< LeftExprT >, CondT, ThenT, ElseT > >\ + BOOST_FORCEINLINE phoenix::actor< if_else_output_terminal< phoenix::actor< LeftExprT >, CondT, ThenT, ElseT > >\ operator<< (phoenix::actor< LeftExprT > left_ref left, if_then_else_gen< CondT, ThenT, ElseT > right_ref right)\ {\ typedef if_else_output_terminal< phoenix::actor< LeftExprT >, CondT, ThenT, ElseT > terminal_type;\ @@ -242,7 +242,7 @@ struct if_then_gen } template< typename ElseT > - BOOST_LOG_FORCEINLINE if_then_else_gen< CondT, ThenT, ElseT > operator[] (ElseT const& el) + BOOST_FORCEINLINE if_then_else_gen< CondT, ThenT, ElseT > operator[] (ElseT const& el) { return if_then_else_gen< CondT, ThenT, ElseT >(m_cond, m_then, el); } @@ -256,7 +256,7 @@ struct if_then_gen #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename CondT, typename ThenT >\ - BOOST_LOG_FORCEINLINE phoenix::actor< if_output_terminal< phoenix::actor< LeftExprT >, CondT, ThenT > >\ + BOOST_FORCEINLINE phoenix::actor< if_output_terminal< phoenix::actor< LeftExprT >, CondT, ThenT > >\ operator<< (phoenix::actor< LeftExprT > left_ref left, if_then_gen< CondT, ThenT > right_ref right)\ {\ typedef if_output_terminal< phoenix::actor< LeftExprT >, CondT, ThenT > terminal_type;\ @@ -282,7 +282,7 @@ public: } template< typename ThenT > - BOOST_LOG_FORCEINLINE if_then_gen< CondT, ThenT > operator[] (ThenT const& then_) const + BOOST_FORCEINLINE if_then_gen< CondT, ThenT > operator[] (ThenT const& then_) const { return if_then_gen< CondT, ThenT >(m_cond, then_); } @@ -297,7 +297,7 @@ public: * \param cond A filter expression that will be used as the condition */ template< typename CondT > -BOOST_LOG_FORCEINLINE aux::if_gen< CondT > if_(CondT const& cond) +BOOST_FORCEINLINE aux::if_gen< CondT > if_(CondT const& cond) { return aux::if_gen< CondT >(cond); } diff --git a/include/boost/log/expressions/formatters/named_scope.hpp b/include/boost/log/expressions/formatters/named_scope.hpp index 86952af..d6cdd62 100644 --- a/include/boost/log/expressions/formatters/named_scope.hpp +++ b/include/boost/log/expressions/formatters/named_scope.hpp @@ -52,7 +52,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -309,7 +309,7 @@ public: return boost::move(str); } - BOOST_LOG_DELETED_FUNCTION(format_named_scope_terminal()) + BOOST_DELETED_FUNCTION(format_named_scope_terminal()) }; /*! @@ -369,7 +369,7 @@ public: #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename FallbackPolicyT, typename CharT >\ - BOOST_LOG_FORCEINLINE phoenix::actor< aux::attribute_output_terminal< phoenix::actor< LeftExprT >, attributes::named_scope::value_type, FallbackPolicyT, typename format_named_scope_actor< FallbackPolicyT, CharT >::formatter_function_type > >\ + BOOST_FORCEINLINE phoenix::actor< aux::attribute_output_terminal< phoenix::actor< LeftExprT >, attributes::named_scope::value_type, FallbackPolicyT, typename format_named_scope_actor< FallbackPolicyT, CharT >::formatter_function_type > >\ operator<< (phoenix::actor< LeftExprT > left_ref left, format_named_scope_actor< FallbackPolicyT, CharT > right_ref right)\ {\ typedef aux::attribute_output_terminal< phoenix::actor< LeftExprT >, attributes::named_scope::value_type, FallbackPolicyT, typename format_named_scope_actor< FallbackPolicyT, CharT >::formatter_function_type > terminal_type;\ @@ -407,7 +407,7 @@ struct default_scope_delimiter< wchar_t > #endif template< typename CharT, template< typename > class ActorT, typename FallbackPolicyT, typename ArgsT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > format_named_scope(attribute_name const& name, FallbackPolicyT const& fallback, ArgsT const& args) +BOOST_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > format_named_scope(attribute_name const& name, FallbackPolicyT const& fallback, ArgsT const& args) { typedef format_named_scope_actor< FallbackPolicyT, CharT, ActorT > actor_type; typedef typename actor_type::terminal_type terminal_type; @@ -438,7 +438,7 @@ BOOST_LOG_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > * \param element_format Format string for a single named scope */ template< typename CharT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT > format_named_scope(attribute_name const& name, const CharT* element_format) +BOOST_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT > format_named_scope(attribute_name const& name, const CharT* element_format) { typedef format_named_scope_actor< fallback_to_none, CharT > actor_type; typedef typename actor_type::terminal_type terminal_type; @@ -454,7 +454,7 @@ BOOST_LOG_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT > format * \param element_format Format string for a single named scope */ template< typename CharT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT > format_named_scope(attribute_name const& name, std::basic_string< CharT > const& element_format) +BOOST_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT > format_named_scope(attribute_name const& name, std::basic_string< CharT > const& element_format) { typedef format_named_scope_actor< fallback_to_none, CharT > actor_type; typedef typename actor_type::terminal_type terminal_type; @@ -470,7 +470,7 @@ BOOST_LOG_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT > format * \param element_format Format string for a single named scope */ template< typename DescriptorT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT, ActorT > +BOOST_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT, ActorT > format_named_scope(attribute_keyword< DescriptorT, ActorT > const& keyword, const CharT* element_format) { BOOST_STATIC_ASSERT_MSG((is_same< typename DescriptorT::value_type, attributes::named_scope::value_type >::value),\ @@ -490,7 +490,7 @@ format_named_scope(attribute_keyword< DescriptorT, ActorT > const& keyword, cons * \param element_format Format string for a single named scope */ template< typename DescriptorT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT, ActorT > +BOOST_FORCEINLINE format_named_scope_actor< fallback_to_none, CharT, ActorT > format_named_scope(attribute_keyword< DescriptorT, ActorT > const& keyword, std::basic_string< CharT > const& element_format) { BOOST_STATIC_ASSERT_MSG((is_same< typename DescriptorT::value_type, attributes::named_scope::value_type >::value),\ @@ -510,7 +510,7 @@ format_named_scope(attribute_keyword< DescriptorT, ActorT > const& keyword, std: * \param element_format Format string for a single named scope */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > +BOOST_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > format_named_scope(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& placeholder, const CharT* element_format) { BOOST_STATIC_ASSERT_MSG((is_same< T, attributes::named_scope::value_type >::value),\ @@ -530,7 +530,7 @@ format_named_scope(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& pl * \param element_format Format string for a single named scope */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename CharT > -BOOST_LOG_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > +BOOST_FORCEINLINE format_named_scope_actor< FallbackPolicyT, CharT, ActorT > format_named_scope(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& placeholder, std::basic_string< CharT > const& element_format) { BOOST_STATIC_ASSERT_MSG((is_same< T, attributes::named_scope::value_type >::value),\ diff --git a/include/boost/log/expressions/formatters/stream.hpp b/include/boost/log/expressions/formatters/stream.hpp index 39449ce..0d0abd8 100644 --- a/include/boost/log/expressions/formatters/stream.hpp +++ b/include/boost/log/expressions/formatters/stream.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/formatters/wrap_formatter.hpp b/include/boost/log/expressions/formatters/wrap_formatter.hpp index 52064a5..79e8f06 100644 --- a/include/boost/log/expressions/formatters/wrap_formatter.hpp +++ b/include/boost/log/expressions/formatters/wrap_formatter.hpp @@ -32,7 +32,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -121,7 +121,7 @@ public: return strm; } - BOOST_LOG_DELETED_FUNCTION(wrapped_formatter_output_terminal()) + BOOST_DELETED_FUNCTION(wrapped_formatter_output_terminal()) }; BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_char_type, char_type, false) @@ -262,7 +262,7 @@ public: #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\ template< typename LeftExprT, typename FunT, typename CharT >\ - BOOST_LOG_FORCEINLINE phoenix::actor< aux::wrapped_formatter_output_terminal< phoenix::actor< LeftExprT >, FunT > >\ + BOOST_FORCEINLINE phoenix::actor< aux::wrapped_formatter_output_terminal< phoenix::actor< LeftExprT >, FunT > >\ operator<< (phoenix::actor< LeftExprT > left_ref left, wrapped_formatter_actor< FunT, CharT > right_ref right)\ {\ typedef aux::wrapped_formatter_output_terminal< phoenix::actor< LeftExprT >, FunT > terminal_type;\ @@ -287,7 +287,7 @@ public: * where \c CharT is the character type of the formatting expression. */ template< typename FunT > -BOOST_LOG_FORCEINLINE wrapped_formatter_actor< FunT, typename aux::default_char_type< FunT >::type > wrap_formatter(FunT const& fun) +BOOST_FORCEINLINE wrapped_formatter_actor< FunT, typename aux::default_char_type< FunT >::type > wrap_formatter(FunT const& fun) { typedef wrapped_formatter_actor< FunT, typename aux::default_char_type< FunT >::type > actor_type; typedef typename actor_type::terminal_type terminal_type; @@ -306,7 +306,7 @@ BOOST_LOG_FORCEINLINE wrapped_formatter_actor< FunT, typename aux::default_char_ * where \c CharT is the character type of the formatting expression. */ template< typename CharT, typename FunT > -BOOST_LOG_FORCEINLINE wrapped_formatter_actor< FunT, CharT > wrap_formatter(FunT const& fun) +BOOST_FORCEINLINE wrapped_formatter_actor< FunT, CharT > wrap_formatter(FunT const& fun) { typedef wrapped_formatter_actor< FunT, CharT > actor_type; typedef typename actor_type::terminal_type terminal_type; diff --git a/include/boost/log/expressions/formatters/xml_decorator.hpp b/include/boost/log/expressions/formatters/xml_decorator.hpp index 72c0b1f..a970ab1 100644 --- a/include/boost/log/expressions/formatters/xml_decorator.hpp +++ b/include/boost/log/expressions/formatters/xml_decorator.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -87,7 +87,7 @@ struct xml_decorator_gen typedef CharT char_type; template< typename SubactorT > - BOOST_LOG_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const + BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const { typedef xml_decorator_traits< char_type > traits_type; typedef pattern_replacer< char_type > replacer_type; @@ -122,7 +122,7 @@ const aux::xml_decorator_gen< wchar_t > wxml_decor = {}; * The function creates an XML-style decorator generator for arbitrary character type. */ template< typename CharT > -BOOST_LOG_FORCEINLINE aux::xml_decorator_gen< CharT > make_xml_decor() +BOOST_FORCEINLINE aux::xml_decorator_gen< CharT > make_xml_decor() { return aux::xml_decorator_gen< CharT >(); } diff --git a/include/boost/log/expressions/is_keyword_descriptor.hpp b/include/boost/log/expressions/is_keyword_descriptor.hpp index 67e194a..5062f83 100644 --- a/include/boost/log/expressions/is_keyword_descriptor.hpp +++ b/include/boost/log/expressions/is_keyword_descriptor.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/keyword.hpp b/include/boost/log/expressions/keyword.hpp index b1169df..f9442d9 100644 --- a/include/boost/log/expressions/keyword.hpp +++ b/include/boost/log/expressions/keyword.hpp @@ -33,7 +33,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/keyword_fwd.hpp b/include/boost/log/expressions/keyword_fwd.hpp index 5506721..64c55b2 100644 --- a/include/boost/log/expressions/keyword_fwd.hpp +++ b/include/boost/log/expressions/keyword_fwd.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/message.hpp b/include/boost/log/expressions/message.hpp index 2f1a761..366c584 100644 --- a/include/boost/log/expressions/message.hpp +++ b/include/boost/log/expressions/message.hpp @@ -24,7 +24,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/predicates.hpp b/include/boost/log/expressions/predicates.hpp index 87d8a02..662d02a 100644 --- a/include/boost/log/expressions/predicates.hpp +++ b/include/boost/log/expressions/predicates.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/predicates/begins_with.hpp b/include/boost/log/expressions/predicates/begins_with.hpp index 8d7ce17..b7328e6 100644 --- a/include/boost/log/expressions/predicates/begins_with.hpp +++ b/include/boost/log/expressions/predicates/begins_with.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -84,7 +84,7 @@ public: * which is assumed to be a string, begins with the specified substring. */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename SubstringT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > > begins_with(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > terminal_type; @@ -97,7 +97,7 @@ begins_with(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, Sub * which is assumed to be a string, begins with the specified substring. */ template< typename DescriptorT, template< typename > class ActorT, typename SubstringT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > begins_with(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type; @@ -110,7 +110,7 @@ begins_with(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& s * which is assumed to be a string, begins with the specified substring. */ template< typename T, typename SubstringT > -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > begins_with(attribute_name const& name, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type; diff --git a/include/boost/log/expressions/predicates/channel_severity_filter.hpp b/include/boost/log/expressions/predicates/channel_severity_filter.hpp index 5dd3917..1d34a33 100644 --- a/include/boost/log/expressions/predicates/channel_severity_filter.hpp +++ b/include/boost/log/expressions/predicates/channel_severity_filter.hpp @@ -35,7 +35,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -304,7 +304,7 @@ public: * if the record severity level is not less than the threshold for the channel the record belongs to. */ template< typename ChannelT, typename SeverityT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT > channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name) { typedef channel_severity_filter_actor< ChannelT, SeverityT > result_type; @@ -315,7 +315,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_name const //! \overload template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name) { typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type; @@ -326,7 +326,7 @@ channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& c //! \overload template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword) { typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type; @@ -337,7 +337,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_keyword< S //! \overload template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword) { typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type; @@ -348,7 +348,7 @@ channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& c //! \overload template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name) { typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type; @@ -359,7 +359,7 @@ channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT //! \overload template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder) { typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > result_type; @@ -370,7 +370,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_actor< Sev //! \overload template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder) { typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > result_type; @@ -382,7 +382,7 @@ channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT //! \overload template< typename ChannelT, typename SeverityT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT > channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT > result_type; @@ -393,7 +393,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_name const //! \overload template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -404,7 +404,7 @@ channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& c //! \overload template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -415,7 +415,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_keyword< S //! \overload template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -426,7 +426,7 @@ channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& c //! \overload template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -437,7 +437,7 @@ channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT //! \overload template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -448,7 +448,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_actor< Sev //! \overload template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare) { typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -460,7 +460,7 @@ channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT //! \overload template< typename ChannelT, typename SeverityT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT > channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT > result_type; @@ -471,7 +471,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_name const //! \overload template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -482,7 +482,7 @@ channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& c //! \overload template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -493,7 +493,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_keyword< S //! \overload template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -504,7 +504,7 @@ channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& c //! \overload template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -515,7 +515,7 @@ channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT //! \overload template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; @@ -526,7 +526,7 @@ channel_severity_filter(attribute_name const& channel_name, attribute_actor< Sev //! \overload template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > -BOOST_LOG_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > +BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) { typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; diff --git a/include/boost/log/expressions/predicates/contains.hpp b/include/boost/log/expressions/predicates/contains.hpp index fd7f845..732e817 100644 --- a/include/boost/log/expressions/predicates/contains.hpp +++ b/include/boost/log/expressions/predicates/contains.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -84,7 +84,7 @@ public: * which is assumed to be a string, contains the specified substring. */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename SubstringT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_contains< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_contains< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > > contains(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_contains< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > terminal_type; @@ -97,7 +97,7 @@ contains(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, Substr * which is assumed to be a string, contains the specified substring. */ template< typename DescriptorT, template< typename > class ActorT, typename SubstringT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_contains< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_contains< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > contains(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_contains< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type; @@ -110,7 +110,7 @@ contains(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& subs * which is assumed to be a string, contains the specified substring. */ template< typename T, typename SubstringT > -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_contains< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_contains< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > contains(attribute_name const& name, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_contains< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type; diff --git a/include/boost/log/expressions/predicates/ends_with.hpp b/include/boost/log/expressions/predicates/ends_with.hpp index 83ef043..0669f62 100644 --- a/include/boost/log/expressions/predicates/ends_with.hpp +++ b/include/boost/log/expressions/predicates/ends_with.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -84,7 +84,7 @@ public: * which is assumed to be a string, ends with the specified substring. */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename SubstringT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_ends_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_ends_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > > ends_with(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_ends_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > terminal_type; @@ -97,7 +97,7 @@ ends_with(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, Subst * which is assumed to be a string, ends with the specified substring. */ template< typename DescriptorT, template< typename > class ActorT, typename SubstringT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_ends_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_ends_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > ends_with(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_ends_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type; @@ -110,7 +110,7 @@ ends_with(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& sub * which is assumed to be a string, ends with the specified substring. */ template< typename T, typename SubstringT > -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_ends_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_ends_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > > ends_with(attribute_name const& name, SubstringT const& substring) { typedef aux::unary_function_terminal< attribute_ends_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type; diff --git a/include/boost/log/expressions/predicates/has_attr.hpp b/include/boost/log/expressions/predicates/has_attr.hpp index 605d550..8591417 100644 --- a/include/boost/log/expressions/predicates/has_attr.hpp +++ b/include/boost/log/expressions/predicates/has_attr.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -131,7 +131,7 @@ public: * presence in a log record. The node will also check that the attribute value has the specified type, if present. */ template< typename AttributeValueT > -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< has_attribute< AttributeValueT > > > has_attr(attribute_name const& name) +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< has_attribute< AttributeValueT > > > has_attr(attribute_name const& name) { typedef aux::unary_function_terminal< has_attribute< AttributeValueT > > terminal_type; phoenix::actor< terminal_type > act = {{ terminal_type(name) }}; @@ -142,7 +142,7 @@ BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< has_attribut * The function generates a terminal node in a template expression. The node will check for the attribute value * presence in a log record. */ -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< has_attribute< void > > > has_attr(attribute_name const& name) +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< has_attribute< void > > > has_attr(attribute_name const& name) { typedef aux::unary_function_terminal< has_attribute< void > > terminal_type; phoenix::actor< terminal_type > act = {{ terminal_type(name) }}; @@ -154,7 +154,7 @@ BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< has_attribut * presence in a log record. The node will also check that the attribute value has the specified type, if present. */ template< typename DescriptorT, template< typename > class ActorT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< has_attribute< typename DescriptorT::value_type > > > has_attr(attribute_keyword< DescriptorT, ActorT > const&) +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< has_attribute< typename DescriptorT::value_type > > > has_attr(attribute_keyword< DescriptorT, ActorT > const&) { typedef aux::unary_function_terminal< has_attribute< typename DescriptorT::value_type > > terminal_type; ActorT< terminal_type > act = {{ terminal_type(DescriptorT::get_name()) }}; diff --git a/include/boost/log/expressions/predicates/is_debugger_present.hpp b/include/boost/log/expressions/predicates/is_debugger_present.hpp index cde74b0..2b0d717 100644 --- a/include/boost/log/expressions/predicates/is_debugger_present.hpp +++ b/include/boost/log/expressions/predicates/is_debugger_present.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/expressions/predicates/is_in_range.hpp b/include/boost/log/expressions/predicates/is_in_range.hpp index 672bcfa..eb096e6 100644 --- a/include/boost/log/expressions/predicates/is_in_range.hpp +++ b/include/boost/log/expressions/predicates/is_in_range.hpp @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -85,7 +85,7 @@ public: * is in the specified range. The range must be half-open, that is the predicate will be equivalent to least <= attr < most. */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename BoundaryT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_is_in_range< T, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type, FallbackPolicyT > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_is_in_range< T, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type, FallbackPolicyT > > > is_in_range(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, BoundaryT const& least, BoundaryT const& most) { typedef typename boost::log::aux::make_embedded_string_type< BoundaryT >::type boundary_type; @@ -99,7 +99,7 @@ is_in_range(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, Bou * is in the specified range. The range must be half-open, that is the predicate will be equivalent to least <= attr < most. */ template< typename DescriptorT, template< typename > class ActorT, typename BoundaryT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_is_in_range< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_is_in_range< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type > > > is_in_range(attribute_keyword< DescriptorT, ActorT > const&, BoundaryT const& least, BoundaryT const& most) { typedef typename boost::log::aux::make_embedded_string_type< BoundaryT >::type boundary_type; @@ -113,7 +113,7 @@ is_in_range(attribute_keyword< DescriptorT, ActorT > const&, BoundaryT const& le * is in the specified range. The range must be half-open, that is the predicate will be equivalent to least <= attr < most. */ template< typename T, typename BoundaryT > -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_is_in_range< T, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type > > > +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_is_in_range< T, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type > > > is_in_range(attribute_name const& name, BoundaryT const& least, BoundaryT const& most) { typedef typename boost::log::aux::make_embedded_string_type< BoundaryT >::type boundary_type; diff --git a/include/boost/log/expressions/predicates/matches.hpp b/include/boost/log/expressions/predicates/matches.hpp index fed3ef7..30138b0 100644 --- a/include/boost/log/expressions/predicates/matches.hpp +++ b/include/boost/log/expressions/predicates/matches.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -83,7 +83,7 @@ public: * which is assumed to be a string, matches the specified regular expression. */ template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename RegexT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_matches< T, RegexT, FallbackPolicyT > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_matches< T, RegexT, FallbackPolicyT > > > matches(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, RegexT const& rex) { typedef aux::unary_function_terminal< attribute_matches< T, RegexT, FallbackPolicyT > > terminal_type; @@ -96,7 +96,7 @@ matches(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, RegexT * which is assumed to be a string, matches the specified regular expression. */ template< typename DescriptorT, template< typename > class ActorT, typename RegexT > -BOOST_LOG_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_matches< typename DescriptorT::value_type, RegexT > > > +BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_matches< typename DescriptorT::value_type, RegexT > > > matches(attribute_keyword< DescriptorT, ActorT > const&, RegexT const& rex) { typedef aux::unary_function_terminal< attribute_matches< typename DescriptorT::value_type, RegexT > > terminal_type; @@ -109,7 +109,7 @@ matches(attribute_keyword< DescriptorT, ActorT > const&, RegexT const& rex) * which is assumed to be a string, matches the specified regular expression. */ template< typename T, typename RegexT > -BOOST_LOG_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_matches< T, RegexT > > > +BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_matches< T, RegexT > > > matches(attribute_name const& name, RegexT const& rex) { typedef aux::unary_function_terminal< attribute_matches< T, RegexT > > terminal_type; diff --git a/include/boost/log/expressions/record.hpp b/include/boost/log/expressions/record.hpp index cf436b6..bdb38d6 100644 --- a/include/boost/log/expressions/record.hpp +++ b/include/boost/log/expressions/record.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/auto_flush.hpp b/include/boost/log/keywords/auto_flush.hpp index 98dfb10..fb050a7 100644 --- a/include/boost/log/keywords/auto_flush.hpp +++ b/include/boost/log/keywords/auto_flush.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/channel.hpp b/include/boost/log/keywords/channel.hpp index a6521f2..0c17b9d 100644 --- a/include/boost/log/keywords/channel.hpp +++ b/include/boost/log/keywords/channel.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/delimiter.hpp b/include/boost/log/keywords/delimiter.hpp index b6722e0..19dbaea 100644 --- a/include/boost/log/keywords/delimiter.hpp +++ b/include/boost/log/keywords/delimiter.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/depth.hpp b/include/boost/log/keywords/depth.hpp index c1acfa2..09d9e7c 100644 --- a/include/boost/log/keywords/depth.hpp +++ b/include/boost/log/keywords/depth.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/facility.hpp b/include/boost/log/keywords/facility.hpp index 8fab71d..5285b4b 100644 --- a/include/boost/log/keywords/facility.hpp +++ b/include/boost/log/keywords/facility.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/file_name.hpp b/include/boost/log/keywords/file_name.hpp index 153c61d..a3a653c 100644 --- a/include/boost/log/keywords/file_name.hpp +++ b/include/boost/log/keywords/file_name.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/filter.hpp b/include/boost/log/keywords/filter.hpp index bc1a080..00dcee7 100644 --- a/include/boost/log/keywords/filter.hpp +++ b/include/boost/log/keywords/filter.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/format.hpp b/include/boost/log/keywords/format.hpp index f02e72b..827af54 100644 --- a/include/boost/log/keywords/format.hpp +++ b/include/boost/log/keywords/format.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/ident.hpp b/include/boost/log/keywords/ident.hpp index dafda8c..e3ab9a8 100644 --- a/include/boost/log/keywords/ident.hpp +++ b/include/boost/log/keywords/ident.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/ip_version.hpp b/include/boost/log/keywords/ip_version.hpp index 6e8f79b..e45225e 100644 --- a/include/boost/log/keywords/ip_version.hpp +++ b/include/boost/log/keywords/ip_version.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/iteration.hpp b/include/boost/log/keywords/iteration.hpp index ae4fd51..4b53d7c 100644 --- a/include/boost/log/keywords/iteration.hpp +++ b/include/boost/log/keywords/iteration.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/log_name.hpp b/include/boost/log/keywords/log_name.hpp index 8fc3e6a..7f825c9 100644 --- a/include/boost/log/keywords/log_name.hpp +++ b/include/boost/log/keywords/log_name.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/log_source.hpp b/include/boost/log/keywords/log_source.hpp index 622413c..b9c34bc 100644 --- a/include/boost/log/keywords/log_source.hpp +++ b/include/boost/log/keywords/log_source.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/max_size.hpp b/include/boost/log/keywords/max_size.hpp index b996810..2ba0355 100644 --- a/include/boost/log/keywords/max_size.hpp +++ b/include/boost/log/keywords/max_size.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/message_file.hpp b/include/boost/log/keywords/message_file.hpp index af8c762..bb3d71d 100644 --- a/include/boost/log/keywords/message_file.hpp +++ b/include/boost/log/keywords/message_file.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/min_free_space.hpp b/include/boost/log/keywords/min_free_space.hpp index 958f29d..8424111 100644 --- a/include/boost/log/keywords/min_free_space.hpp +++ b/include/boost/log/keywords/min_free_space.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/open_mode.hpp b/include/boost/log/keywords/open_mode.hpp index 0e3ae0d..67e3156 100644 --- a/include/boost/log/keywords/open_mode.hpp +++ b/include/boost/log/keywords/open_mode.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/order.hpp b/include/boost/log/keywords/order.hpp index 634ed17..4c1131f 100644 --- a/include/boost/log/keywords/order.hpp +++ b/include/boost/log/keywords/order.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/ordering_window.hpp b/include/boost/log/keywords/ordering_window.hpp index 5b06ec1..a30a471 100644 --- a/include/boost/log/keywords/ordering_window.hpp +++ b/include/boost/log/keywords/ordering_window.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/registration.hpp b/include/boost/log/keywords/registration.hpp index 884e0ca..4e5cebb 100644 --- a/include/boost/log/keywords/registration.hpp +++ b/include/boost/log/keywords/registration.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/rotation_size.hpp b/include/boost/log/keywords/rotation_size.hpp index be15c70..8cb1f22 100644 --- a/include/boost/log/keywords/rotation_size.hpp +++ b/include/boost/log/keywords/rotation_size.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/scan_method.hpp b/include/boost/log/keywords/scan_method.hpp index 6dee866..13d7a56 100644 --- a/include/boost/log/keywords/scan_method.hpp +++ b/include/boost/log/keywords/scan_method.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/severity.hpp b/include/boost/log/keywords/severity.hpp index a8636b8..74aae8c 100644 --- a/include/boost/log/keywords/severity.hpp +++ b/include/boost/log/keywords/severity.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/start_thread.hpp b/include/boost/log/keywords/start_thread.hpp index 9e90716..c098bab 100644 --- a/include/boost/log/keywords/start_thread.hpp +++ b/include/boost/log/keywords/start_thread.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/target.hpp b/include/boost/log/keywords/target.hpp index e8301ed..869c7e0 100644 --- a/include/boost/log/keywords/target.hpp +++ b/include/boost/log/keywords/target.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/time_based_rotation.hpp b/include/boost/log/keywords/time_based_rotation.hpp index 6cddbe2..744e4b6 100644 --- a/include/boost/log/keywords/time_based_rotation.hpp +++ b/include/boost/log/keywords/time_based_rotation.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/keywords/use_impl.hpp b/include/boost/log/keywords/use_impl.hpp index b104098..7ebba86 100644 --- a/include/boost/log/keywords/use_impl.hpp +++ b/include/boost/log/keywords/use_impl.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks.hpp b/include/boost/log/sinks.hpp index ed6abef..2c678d8 100644 --- a/include/boost/log/sinks.hpp +++ b/include/boost/log/sinks.hpp @@ -40,7 +40,7 @@ #include #endif // BOOST_WINDOWS -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/async_frontend.hpp b/include/boost/log/sinks/async_frontend.hpp index 1430695..c64092b 100644 --- a/include/boost/log/sinks/async_frontend.hpp +++ b/include/boost/log/sinks/async_frontend.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/attribute_mapping.hpp b/include/boost/log/sinks/attribute_mapping.hpp index 1f1bc5c..bf6e008 100644 --- a/include/boost/log/sinks/attribute_mapping.hpp +++ b/include/boost/log/sinks/attribute_mapping.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/basic_sink_backend.hpp b/include/boost/log/sinks/basic_sink_backend.hpp index 06c79d8..2aedccc 100644 --- a/include/boost/log/sinks/basic_sink_backend.hpp +++ b/include/boost/log/sinks/basic_sink_backend.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -45,10 +45,10 @@ struct basic_sink_backend //! Frontend requirements tag typedef FrontendRequirementsT frontend_requirements; - BOOST_LOG_DEFAULTED_FUNCTION(basic_sink_backend(), {}) + BOOST_DEFAULTED_FUNCTION(basic_sink_backend(), {}) - BOOST_LOG_DELETED_FUNCTION(basic_sink_backend(basic_sink_backend const&)) - BOOST_LOG_DELETED_FUNCTION(basic_sink_backend& operator= (basic_sink_backend const&)) + BOOST_DELETED_FUNCTION(basic_sink_backend(basic_sink_backend const&)) + BOOST_DELETED_FUNCTION(basic_sink_backend& operator= (basic_sink_backend const&)) }; /*! diff --git a/include/boost/log/sinks/basic_sink_frontend.hpp b/include/boost/log/sinks/basic_sink_frontend.hpp index 1d687f6..daa672f 100644 --- a/include/boost/log/sinks/basic_sink_frontend.hpp +++ b/include/boost/log/sinks/basic_sink_frontend.hpp @@ -36,7 +36,7 @@ #endif // !defined(BOOST_LOG_NO_THREADS) #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/block_on_overflow.hpp b/include/boost/log/sinks/block_on_overflow.hpp index 4dd3420..b9b4b0f 100644 --- a/include/boost/log/sinks/block_on_overflow.hpp +++ b/include/boost/log/sinks/block_on_overflow.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/bounded_fifo_queue.hpp b/include/boost/log/sinks/bounded_fifo_queue.hpp index 82ec3c7..a0f65db 100644 --- a/include/boost/log/sinks/bounded_fifo_queue.hpp +++ b/include/boost/log/sinks/bounded_fifo_queue.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/bounded_ordering_queue.hpp b/include/boost/log/sinks/bounded_ordering_queue.hpp index 3a0057f..e441ef6 100644 --- a/include/boost/log/sinks/bounded_ordering_queue.hpp +++ b/include/boost/log/sinks/bounded_ordering_queue.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/debug_output_backend.hpp b/include/boost/log/sinks/debug_output_backend.hpp index b3cb5f1..f2f7a34 100644 --- a/include/boost/log/sinks/debug_output_backend.hpp +++ b/include/boost/log/sinks/debug_output_backend.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/drop_on_overflow.hpp b/include/boost/log/sinks/drop_on_overflow.hpp index 0857f90..6729eb5 100644 --- a/include/boost/log/sinks/drop_on_overflow.hpp +++ b/include/boost/log/sinks/drop_on_overflow.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/event_log_backend.hpp b/include/boost/log/sinks/event_log_backend.hpp index 286fcfa..32b6049 100644 --- a/include/boost/log/sinks/event_log_backend.hpp +++ b/include/boost/log/sinks/event_log_backend.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/event_log_constants.hpp b/include/boost/log/sinks/event_log_constants.hpp index 148008b..bf88a99 100644 --- a/include/boost/log/sinks/event_log_constants.hpp +++ b/include/boost/log/sinks/event_log_constants.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/frontend_requirements.hpp b/include/boost/log/sinks/frontend_requirements.hpp index 79b9dad..4cacac3 100644 --- a/include/boost/log/sinks/frontend_requirements.hpp +++ b/include/boost/log/sinks/frontend_requirements.hpp @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/sink.hpp b/include/boost/log/sinks/sink.hpp index e96ac2b..ef40749 100644 --- a/include/boost/log/sinks/sink.hpp +++ b/include/boost/log/sinks/sink.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -100,8 +100,8 @@ public: */ bool is_cross_thread() const BOOST_NOEXCEPT { return m_cross_thread; } - BOOST_LOG_DELETED_FUNCTION(sink(sink const&)) - BOOST_LOG_DELETED_FUNCTION(sink& operator= (sink const&)) + BOOST_DELETED_FUNCTION(sink(sink const&)) + BOOST_DELETED_FUNCTION(sink& operator= (sink const&)) }; } // namespace sinks diff --git a/include/boost/log/sinks/sync_frontend.hpp b/include/boost/log/sinks/sync_frontend.hpp index 22def85..3f70ba3 100644 --- a/include/boost/log/sinks/sync_frontend.hpp +++ b/include/boost/log/sinks/sync_frontend.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/syslog_backend.hpp b/include/boost/log/sinks/syslog_backend.hpp index de57f68..8778ca3 100644 --- a/include/boost/log/sinks/syslog_backend.hpp +++ b/include/boost/log/sinks/syslog_backend.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/syslog_constants.hpp b/include/boost/log/sinks/syslog_constants.hpp index 5fe7aae..61d2bc2 100644 --- a/include/boost/log/sinks/syslog_constants.hpp +++ b/include/boost/log/sinks/syslog_constants.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/text_file_backend.hpp b/include/boost/log/sinks/text_file_backend.hpp index 57dab24..9250f6f 100644 --- a/include/boost/log/sinks/text_file_backend.hpp +++ b/include/boost/log/sinks/text_file_backend.hpp @@ -41,7 +41,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -71,7 +71,7 @@ struct BOOST_LOG_NO_VTABLE collector /*! * Default constructor */ - BOOST_LOG_DEFAULTED_FUNCTION(collector(), {}) + BOOST_DEFAULTED_FUNCTION(collector(), {}) /*! * Virtual destructor @@ -119,8 +119,8 @@ struct BOOST_LOG_NO_VTABLE collector virtual uintmax_t scan_for_files( scan_method method, filesystem::path const& pattern = filesystem::path(), unsigned int* counter = 0) = 0; - BOOST_LOG_DELETED_FUNCTION(collector(collector const&)) - BOOST_LOG_DELETED_FUNCTION(collector& operator= (collector const&)) + BOOST_DELETED_FUNCTION(collector(collector const&)) + BOOST_DELETED_FUNCTION(collector& operator= (collector const&)) }; namespace aux { diff --git a/include/boost/log/sinks/text_multifile_backend.hpp b/include/boost/log/sinks/text_multifile_backend.hpp index 914c91c..4af6378 100644 --- a/include/boost/log/sinks/text_multifile_backend.hpp +++ b/include/boost/log/sinks/text_multifile_backend.hpp @@ -30,7 +30,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/text_ostream_backend.hpp b/include/boost/log/sinks/text_ostream_backend.hpp index 4681de7..8298109 100644 --- a/include/boost/log/sinks/text_ostream_backend.hpp +++ b/include/boost/log/sinks/text_ostream_backend.hpp @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/unbounded_fifo_queue.hpp b/include/boost/log/sinks/unbounded_fifo_queue.hpp index 4e48513..98af9bd 100644 --- a/include/boost/log/sinks/unbounded_fifo_queue.hpp +++ b/include/boost/log/sinks/unbounded_fifo_queue.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/unbounded_ordering_queue.hpp b/include/boost/log/sinks/unbounded_ordering_queue.hpp index ffd46ba..04ab2d9 100644 --- a/include/boost/log/sinks/unbounded_ordering_queue.hpp +++ b/include/boost/log/sinks/unbounded_ordering_queue.hpp @@ -18,7 +18,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sinks/unlocked_frontend.hpp b/include/boost/log/sinks/unlocked_frontend.hpp index ca89a73..0646092 100644 --- a/include/boost/log/sinks/unlocked_frontend.hpp +++ b/include/boost/log/sinks/unlocked_frontend.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/basic_logger.hpp b/include/boost/log/sources/basic_logger.hpp index 5adac6e..86faa10 100644 --- a/include/boost/log/sources/basic_logger.hpp +++ b/include/boost/log/sources/basic_logger.hpp @@ -41,7 +41,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -285,7 +285,7 @@ protected: } //! Assignment is closed (should be implemented through copy and swap in the final class) - BOOST_LOG_DELETED_FUNCTION(basic_logger& operator= (basic_logger const&)) + BOOST_DELETED_FUNCTION(basic_logger& operator= (basic_logger const&)) }; /*! @@ -599,7 +599,7 @@ protected: #define BOOST_LOG_FORWARD_LOGGER_CONSTRUCTORS_IMPL(class_type, typename_keyword)\ public:\ - BOOST_LOG_DEFAULTED_FUNCTION(class_type(), {})\ + BOOST_DEFAULTED_FUNCTION(class_type(), {})\ class_type(class_type const& that) : class_type::logger_base(\ static_cast< typename_keyword() class_type::logger_base const& >(that)) {}\ class_type(BOOST_RV_REF(class_type) that) : class_type::logger_base(\ diff --git a/include/boost/log/sources/channel_feature.hpp b/include/boost/log/sources/channel_feature.hpp index 8e6079d..89fdbb3 100644 --- a/include/boost/log/sources/channel_feature.hpp +++ b/include/boost/log/sources/channel_feature.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/channel_logger.hpp b/include/boost/log/sources/channel_logger.hpp index e3414de..57d0068 100644 --- a/include/boost/log/sources/channel_logger.hpp +++ b/include/boost/log/sources/channel_logger.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/exception_handler_feature.hpp b/include/boost/log/sources/exception_handler_feature.hpp index 21b516c..ec40706 100644 --- a/include/boost/log/sources/exception_handler_feature.hpp +++ b/include/boost/log/sources/exception_handler_feature.hpp @@ -29,7 +29,7 @@ #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/features.hpp b/include/boost/log/sources/features.hpp index ca19d0b..f9ac944 100644 --- a/include/boost/log/sources/features.hpp +++ b/include/boost/log/sources/features.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/global_logger_storage.hpp b/include/boost/log/sources/global_logger_storage.hpp index 37acdb7..eff4815 100644 --- a/include/boost/log/sources/global_logger_storage.hpp +++ b/include/boost/log/sources/global_logger_storage.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -38,7 +38,7 @@ namespace sources { namespace aux { //! The base class for logger holders -struct BOOST_LOG_NO_VTABLE BOOST_LOG_VISIBLE logger_holder_base +struct BOOST_LOG_NO_VTABLE BOOST_SYMBOL_VISIBLE logger_holder_base { //! The source file name where the logger was registered const char* m_RegistrationFile; @@ -56,7 +56,7 @@ struct BOOST_LOG_NO_VTABLE BOOST_LOG_VISIBLE logger_holder_base //! The actual logger holder class template< typename LoggerT > -struct BOOST_LOG_VISIBLE logger_holder : +struct BOOST_SYMBOL_VISIBLE logger_holder : public logger_holder_base { //! The logger instance @@ -79,9 +79,9 @@ struct global_storage BOOST_LOG_API static shared_ptr< logger_holder_base > get_or_init(std::type_info const& key, initializer_t initializer); // Non-constructible, non-copyable, non-assignable - BOOST_LOG_DELETED_FUNCTION(global_storage()) - BOOST_LOG_DELETED_FUNCTION(global_storage(global_storage const&)) - BOOST_LOG_DELETED_FUNCTION(global_storage& operator= (global_storage const&)) + BOOST_DELETED_FUNCTION(global_storage()) + BOOST_DELETED_FUNCTION(global_storage(global_storage const&)) + BOOST_DELETED_FUNCTION(global_storage& operator= (global_storage const&)) }; //! Throws the \c odr_violation exception diff --git a/include/boost/log/sources/logger.hpp b/include/boost/log/sources/logger.hpp index 022e1ce..6905ce6 100644 --- a/include/boost/log/sources/logger.hpp +++ b/include/boost/log/sources/logger.hpp @@ -24,7 +24,7 @@ #endif // !defined(BOOST_LOG_NO_THREADS) #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/record_ostream.hpp b/include/boost/log/sources/record_ostream.hpp index e640b32..3ac1cef 100644 --- a/include/boost/log/sources/record_ostream.hpp +++ b/include/boost/log/sources/record_ostream.hpp @@ -31,7 +31,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -162,8 +162,8 @@ private: BOOST_LOG_API void init_stream(); // Copy and assignment are closed - BOOST_LOG_DELETED_FUNCTION(basic_record_ostream(basic_record_ostream const&)) - BOOST_LOG_DELETED_FUNCTION(basic_record_ostream& operator= (basic_record_ostream const&)) + BOOST_DELETED_FUNCTION(basic_record_ostream(basic_record_ostream const&)) + BOOST_DELETED_FUNCTION(basic_record_ostream& operator= (basic_record_ostream const&)) }; @@ -201,9 +201,9 @@ struct stream_provider BOOST_LOG_API static void release_compound(stream_compound* compound) BOOST_NOEXCEPT; // Non-constructible, non-copyable, non-assignable - BOOST_LOG_DELETED_FUNCTION(stream_provider()) - BOOST_LOG_DELETED_FUNCTION(stream_provider(stream_provider const&)) - BOOST_LOG_DELETED_FUNCTION(stream_provider& operator= (stream_provider const&)) + BOOST_DELETED_FUNCTION(stream_provider()) + BOOST_DELETED_FUNCTION(stream_provider(stream_provider const&)) + BOOST_DELETED_FUNCTION(stream_provider& operator= (stream_provider const&)) }; @@ -289,7 +289,7 @@ public: }; template< typename LoggerT > -BOOST_LOG_FORCEINLINE record_pump< LoggerT > make_record_pump(LoggerT& lg, record& rec) +BOOST_FORCEINLINE record_pump< LoggerT > make_record_pump(LoggerT& lg, record& rec) { return record_pump< LoggerT >(lg, rec); } diff --git a/include/boost/log/sources/severity_channel_logger.hpp b/include/boost/log/sources/severity_channel_logger.hpp index 84c6929..152557e 100644 --- a/include/boost/log/sources/severity_channel_logger.hpp +++ b/include/boost/log/sources/severity_channel_logger.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/severity_feature.hpp b/include/boost/log/sources/severity_feature.hpp index 80fc07b..f846fd3 100644 --- a/include/boost/log/sources/severity_feature.hpp +++ b/include/boost/log/sources/severity_feature.hpp @@ -32,7 +32,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -62,7 +62,7 @@ namespace aux { protected: //! Factory implementation - class BOOST_LOG_VISIBLE impl : + class BOOST_SYMBOL_VISIBLE impl : public attribute_value::impl { public: diff --git a/include/boost/log/sources/severity_logger.hpp b/include/boost/log/sources/severity_logger.hpp index 5b0c5b8..3d280f3 100644 --- a/include/boost/log/sources/severity_logger.hpp +++ b/include/boost/log/sources/severity_logger.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/sources/threading_models.hpp b/include/boost/log/sources/threading_models.hpp index 9ca68c7..552b26f 100644 --- a/include/boost/log/sources/threading_models.hpp +++ b/include/boost/log/sources/threading_models.hpp @@ -24,7 +24,7 @@ #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/support/date_time.hpp b/include/boost/log/support/date_time.hpp index 18c9996..ebd774f 100644 --- a/include/boost/log/support/date_time.hpp +++ b/include/boost/log/support/date_time.hpp @@ -36,7 +36,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -142,7 +142,7 @@ struct date_time_formatter_generator_traits_impl typedef typename date_time_formatter_generator_traits_impl< TimeT, CharT >::value_type value_type; public: - BOOST_LOG_DEFAULTED_FUNCTION(formatter(), {}) + BOOST_DEFAULTED_FUNCTION(formatter(), {}) formatter(formatter const& that) : base_type(static_cast< base_type const& >(that)) {} formatter(BOOST_RV_REF(formatter) that) { this->swap(that); } @@ -217,7 +217,7 @@ struct date_time_formatter_generator_traits< local_time::local_date_time_base< T typedef typename date_time_formatter_generator_traits< local_time::local_date_time_base< TimeT, TimeZoneT >, CharT, VoidT >::value_type value_type; public: - BOOST_LOG_DEFAULTED_FUNCTION(formatter(), {}) + BOOST_DEFAULTED_FUNCTION(formatter(), {}) formatter(formatter const& that) : base_type(static_cast< base_type const& >(that)) {} formatter(BOOST_RV_REF(formatter) that) { this->swap(that); } @@ -320,7 +320,7 @@ struct date_formatter_generator_traits_impl typedef typename date_formatter_generator_traits_impl< DateT, CharT >::value_type value_type; public: - BOOST_LOG_DEFAULTED_FUNCTION(formatter(), {}) + BOOST_DEFAULTED_FUNCTION(formatter(), {}) formatter(formatter const& that) : base_type(static_cast< base_type const& >(that)) {} formatter(BOOST_RV_REF(formatter) that) { this->swap(that); } @@ -394,7 +394,7 @@ struct time_duration_formatter_generator_traits_impl typedef typename time_duration_formatter_generator_traits_impl< TimeDurationT, CharT >::value_type value_type; public: - BOOST_LOG_DEFAULTED_FUNCTION(formatter(), {}) + BOOST_DEFAULTED_FUNCTION(formatter(), {}) formatter(formatter const& that) : base_type(static_cast< base_type const& >(that)) {} formatter(BOOST_RV_REF(formatter) that) { this->swap(that); } @@ -492,7 +492,7 @@ struct date_duration_formatter_generator_traits_impl typedef typename date_duration_formatter_generator_traits_impl< DateDurationT, CharT >::value_type value_type; public: - BOOST_LOG_DEFAULTED_FUNCTION(formatter(), {}) + BOOST_DEFAULTED_FUNCTION(formatter(), {}) formatter(formatter const& that) : base_type(static_cast< base_type const& >(that)) {} formatter(BOOST_RV_REF(formatter) that) { this->swap(that); } diff --git a/include/boost/log/support/exception.hpp b/include/boost/log/support/exception.hpp index ae06719..d8f9785 100644 --- a/include/boost/log/support/exception.hpp +++ b/include/boost/log/support/exception.hpp @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/support/regex.hpp b/include/boost/log/support/regex.hpp index 4844603..5cfb421 100644 --- a/include/boost/log/support/regex.hpp +++ b/include/boost/log/support/regex.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/support/spirit_classic.hpp b/include/boost/log/support/spirit_classic.hpp index a3bea64..d4ff11b 100644 --- a/include/boost/log/support/spirit_classic.hpp +++ b/include/boost/log/support/spirit_classic.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/support/spirit_qi.hpp b/include/boost/log/support/spirit_qi.hpp index b18a938..5d563a5 100644 --- a/include/boost/log/support/spirit_qi.hpp +++ b/include/boost/log/support/spirit_qi.hpp @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/support/xpressive.hpp b/include/boost/log/support/xpressive.hpp index 902c6d3..c27f777 100644 --- a/include/boost/log/support/xpressive.hpp +++ b/include/boost/log/support/xpressive.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/trivial.hpp b/include/boost/log/trivial.hpp index 937be20..b7fdb56 100644 --- a/include/boost/log/trivial.hpp +++ b/include/boost/log/trivial.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -51,6 +51,7 @@ enum severity_level //! Returns stringized enumeration value or \c NULL, if the value is not valid BOOST_LOG_API const char* to_string(severity_level lvl); +//! Outputs stringized representation of the severity level to the stream template< typename CharT, typename TraitsT > inline std::basic_ostream< CharT, TraitsT >& operator<< ( std::basic_ostream< CharT, TraitsT >& strm, severity_level lvl) @@ -63,6 +64,7 @@ inline std::basic_ostream< CharT, TraitsT >& operator<< ( return strm; } +//! Reads stringized representation of the severity level from the stream template< typename CharT, typename TraitsT > BOOST_LOG_API std::basic_istream< CharT, TraitsT >& operator>> ( std::basic_istream< CharT, TraitsT >& strm, severity_level& lvl); @@ -74,7 +76,12 @@ typedef sources::severity_logger_mt< severity_level > logger_type; typedef sources::severity_logger< severity_level > logger_type; #endif -//! Trivial logger tag +/*! + * \brief Trivial logger tag + * + * This tag can be used to acquire the logger that is used with lrivial logging macros. + * This may be useful when the logger is used with other macros which require a logger. + */ struct logger { //! Logger type @@ -93,7 +100,15 @@ struct logger #endif }; -//! The macro is used to initiate logging +/*! + * The macro is used to initiate logging. The \c lvl argument of the macro specifies one of the following + * severity levels: \c trace, \c debug, \c info, \c warning, \c error or \c fatal (see \c severity_level enum). + * Following the macro, there may be a streaming expression that composes the record message string. For example: + * + * \code + * BOOST_LOG_TRIVIAL(info) << "Hello, world!"; + * \endcode + */ #define BOOST_LOG_TRIVIAL(lvl)\ BOOST_LOG_STREAM_WITH_PARAMS(::boost::log::trivial::logger::get(),\ (::boost::log::keywords::severity = ::boost::log::trivial::lvl)) diff --git a/include/boost/log/utility/empty_deleter.hpp b/include/boost/log/utility/empty_deleter.hpp index e1ae568..60aafab 100644 --- a/include/boost/log/utility/empty_deleter.hpp +++ b/include/boost/log/utility/empty_deleter.hpp @@ -21,7 +21,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/exception_handler.hpp b/include/boost/log/utility/exception_handler.hpp index 6384f4e..a0fc0aa 100644 --- a/include/boost/log/utility/exception_handler.hpp +++ b/include/boost/log/utility/exception_handler.hpp @@ -30,7 +30,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/explicit_operator_bool.hpp b/include/boost/log/utility/explicit_operator_bool.hpp index 375a753..c9aec45 100644 --- a/include/boost/log/utility/explicit_operator_bool.hpp +++ b/include/boost/log/utility/explicit_operator_bool.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -34,7 +34,7 @@ * in terms of which the conversion operator will be implemented. */ #define BOOST_LOG_EXPLICIT_OPERATOR_BOOL()\ - BOOST_LOG_FORCEINLINE explicit operator bool () const\ + BOOST_FORCEINLINE explicit operator bool () const\ {\ return !this->operator! ();\ } @@ -81,7 +81,7 @@ BOOST_LOG_CLOSE_NAMESPACE // namespace log } // namespace boost #define BOOST_LOG_EXPLICIT_OPERATOR_BOOL()\ - BOOST_LOG_FORCEINLINE operator boost::log::aux::unspecified_bool_type () const\ + BOOST_FORCEINLINE operator boost::log::aux::unspecified_bool_type () const\ {\ if (!this->operator!())\ return &boost::log::aux::unspecified_bool::true_value;\ @@ -92,7 +92,7 @@ BOOST_LOG_CLOSE_NAMESPACE // namespace log #else #define BOOST_LOG_EXPLICIT_OPERATOR_BOOL()\ - BOOST_LOG_FORCEINLINE operator bool () const\ + BOOST_FORCEINLINE operator bool () const\ {\ return !this->operator! ();\ } diff --git a/include/boost/log/utility/formatting_ostream.hpp b/include/boost/log/utility/formatting_ostream.hpp index 0004984..cec46d9 100644 --- a/include/boost/log/utility/formatting_ostream.hpp +++ b/include/boost/log/utility/formatting_ostream.hpp @@ -29,7 +29,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -121,8 +121,8 @@ public: { } - BOOST_LOG_DELETED_FUNCTION(sentry(sentry const&)) - BOOST_LOG_DELETED_FUNCTION(sentry& operator= (sentry const&)) + BOOST_DELETED_FUNCTION(sentry(sentry const&)) + BOOST_DELETED_FUNCTION(sentry& operator= (sentry const&)) }; private: @@ -580,9 +580,9 @@ private: } //! Copy constructor (closed) - BOOST_LOG_DELETED_FUNCTION(basic_formatting_ostream(basic_formatting_ostream const& that)) + BOOST_DELETED_FUNCTION(basic_formatting_ostream(basic_formatting_ostream const& that)) //! Assignment (closed) - BOOST_LOG_DELETED_FUNCTION(basic_formatting_ostream& operator= (basic_formatting_ostream const& that)) + BOOST_DELETED_FUNCTION(basic_formatting_ostream& operator= (basic_formatting_ostream const& that)) }; template< typename CharT, typename TraitsT, typename AllocatorT > diff --git a/include/boost/log/utility/formatting_ostream_fwd.hpp b/include/boost/log/utility/formatting_ostream_fwd.hpp index f0a97f8..0ccff63 100644 --- a/include/boost/log/utility/formatting_ostream_fwd.hpp +++ b/include/boost/log/utility/formatting_ostream_fwd.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional.hpp b/include/boost/log/utility/functional.hpp index 1cfd0a8..37fc023 100644 --- a/include/boost/log/utility/functional.hpp +++ b/include/boost/log/utility/functional.hpp @@ -33,7 +33,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/as_action.hpp b/include/boost/log/utility/functional/as_action.hpp index 1814e11..78c82ca 100644 --- a/include/boost/log/utility/functional/as_action.hpp +++ b/include/boost/log/utility/functional/as_action.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -32,7 +32,7 @@ struct as_action_adapter { typedef typename FunT::result_type result_type; - BOOST_LOG_DEFAULTED_FUNCTION(as_action_adapter(), {}) + BOOST_DEFAULTED_FUNCTION(as_action_adapter(), {}) explicit as_action_adapter(FunT const& fun) : m_fun(fun) {} template< typename AttributeT, typename ContextT > @@ -46,7 +46,7 @@ private: }; template< typename FunT > -BOOST_LOG_FORCEINLINE as_action_adapter< FunT > as_action(FunT const& fun) +BOOST_FORCEINLINE as_action_adapter< FunT > as_action(FunT const& fun) { return as_action_adapter< FunT >(fun); } diff --git a/include/boost/log/utility/functional/begins_with.hpp b/include/boost/log/utility/functional/begins_with.hpp index 25f0fbb..8c27bb0 100644 --- a/include/boost/log/utility/functional/begins_with.hpp +++ b/include/boost/log/utility/functional/begins_with.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/bind.hpp b/include/boost/log/utility/functional/bind.hpp index bbd78c0..5114996 100644 --- a/include/boost/log/utility/functional/bind.hpp +++ b/include/boost/log/utility/functional/bind.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -105,13 +105,13 @@ private: }; template< typename FunT, typename FirstArgT > -BOOST_LOG_FORCEINLINE binder1st< FunT, FirstArgT > bind1st(FunT fun, FirstArgT const& arg) +BOOST_FORCEINLINE binder1st< FunT, FirstArgT > bind1st(FunT fun, FirstArgT const& arg) { return binder1st< FunT, FirstArgT >(fun, arg); } template< typename FunT, typename FirstArgT > -BOOST_LOG_FORCEINLINE binder1st< FunT, FirstArgT > bind1st(FunT fun, FirstArgT& arg) +BOOST_FORCEINLINE binder1st< FunT, FirstArgT > bind1st(FunT fun, FirstArgT& arg) { return binder1st< FunT, FirstArgT >(fun, arg); } @@ -167,13 +167,13 @@ private: }; template< typename FunT, typename SecondArgT > -BOOST_LOG_FORCEINLINE binder2nd< FunT, SecondArgT > bind2nd(FunT fun, SecondArgT const& arg) +BOOST_FORCEINLINE binder2nd< FunT, SecondArgT > bind2nd(FunT fun, SecondArgT const& arg) { return binder2nd< FunT, SecondArgT >(fun, arg); } template< typename FunT, typename SecondArgT > -BOOST_LOG_FORCEINLINE binder2nd< FunT, SecondArgT > bind2nd(FunT fun, SecondArgT& arg) +BOOST_FORCEINLINE binder2nd< FunT, SecondArgT > bind2nd(FunT fun, SecondArgT& arg) { return binder2nd< FunT, SecondArgT >(fun, arg); } @@ -217,13 +217,13 @@ private: }; template< typename FunT, typename ThirdArgT > -BOOST_LOG_FORCEINLINE binder3rd< FunT, ThirdArgT > bind3rd(FunT fun, ThirdArgT const& arg) +BOOST_FORCEINLINE binder3rd< FunT, ThirdArgT > bind3rd(FunT fun, ThirdArgT const& arg) { return binder3rd< FunT, ThirdArgT >(fun, arg); } template< typename FunT, typename ThirdArgT > -BOOST_LOG_FORCEINLINE binder3rd< FunT, ThirdArgT > bind3rd(FunT fun, ThirdArgT& arg) +BOOST_FORCEINLINE binder3rd< FunT, ThirdArgT > bind3rd(FunT fun, ThirdArgT& arg) { return binder3rd< FunT, ThirdArgT >(fun, arg); } diff --git a/include/boost/log/utility/functional/bind_assign.hpp b/include/boost/log/utility/functional/bind_assign.hpp index f4de02d..fa1f1ac 100644 --- a/include/boost/log/utility/functional/bind_assign.hpp +++ b/include/boost/log/utility/functional/bind_assign.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -41,7 +41,7 @@ struct assign_fun }; template< typename AssigneeT > -BOOST_LOG_FORCEINLINE binder1st< assign_fun, AssigneeT& > bind_assign(AssigneeT& assignee) +BOOST_FORCEINLINE binder1st< assign_fun, AssigneeT& > bind_assign(AssigneeT& assignee) { return binder1st< assign_fun, AssigneeT& >(assign_fun(), assignee); } diff --git a/include/boost/log/utility/functional/bind_output.hpp b/include/boost/log/utility/functional/bind_output.hpp index 955c9bb..e54ecb1 100644 --- a/include/boost/log/utility/functional/bind_output.hpp +++ b/include/boost/log/utility/functional/bind_output.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -41,7 +41,7 @@ struct output_fun }; template< typename StreamT > -BOOST_LOG_FORCEINLINE binder1st< output_fun, StreamT& > bind_output(StreamT& strm) +BOOST_FORCEINLINE binder1st< output_fun, StreamT& > bind_output(StreamT& strm) { return binder1st< output_fun, StreamT& >(output_fun(), strm); } diff --git a/include/boost/log/utility/functional/bind_to_log.hpp b/include/boost/log/utility/functional/bind_to_log.hpp index 65fdb5e..a9d2488 100644 --- a/include/boost/log/utility/functional/bind_to_log.hpp +++ b/include/boost/log/utility/functional/bind_to_log.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -56,13 +56,13 @@ struct to_log_fun< void > }; template< typename StreamT > -BOOST_LOG_FORCEINLINE binder1st< to_log_fun< >, StreamT& > bind_to_log(StreamT& strm) +BOOST_FORCEINLINE binder1st< to_log_fun< >, StreamT& > bind_to_log(StreamT& strm) { return binder1st< to_log_fun< >, StreamT& >(to_log_fun< >(), strm); } template< typename TagT, typename StreamT > -BOOST_LOG_FORCEINLINE binder1st< to_log_fun< TagT >, StreamT& > bind_to_log(StreamT& strm) +BOOST_FORCEINLINE binder1st< to_log_fun< TagT >, StreamT& > bind_to_log(StreamT& strm) { return binder1st< to_log_fun< TagT >, StreamT& >(to_log_fun< TagT >(), strm); } diff --git a/include/boost/log/utility/functional/contains.hpp b/include/boost/log/utility/functional/contains.hpp index 0433ca7..1034f8f 100644 --- a/include/boost/log/utility/functional/contains.hpp +++ b/include/boost/log/utility/functional/contains.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/ends_with.hpp b/include/boost/log/utility/functional/ends_with.hpp index b5a75bd..3e078fc 100644 --- a/include/boost/log/utility/functional/ends_with.hpp +++ b/include/boost/log/utility/functional/ends_with.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/fun_ref.hpp b/include/boost/log/utility/functional/fun_ref.hpp index 90ef2bd..d1d9b39 100644 --- a/include/boost/log/utility/functional/fun_ref.hpp +++ b/include/boost/log/utility/functional/fun_ref.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -65,7 +65,7 @@ private: }; template< typename FunT > -BOOST_LOG_FORCEINLINE function_reference_wrapper< FunT > fun_ref(FunT& fun) +BOOST_FORCEINLINE function_reference_wrapper< FunT > fun_ref(FunT& fun) { return function_reference_wrapper< FunT >(fun); } diff --git a/include/boost/log/utility/functional/in_range.hpp b/include/boost/log/utility/functional/in_range.hpp index fdec067..6b85838 100644 --- a/include/boost/log/utility/functional/in_range.hpp +++ b/include/boost/log/utility/functional/in_range.hpp @@ -20,7 +20,7 @@ #include // make_common_integral_type #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/logical.hpp b/include/boost/log/utility/functional/logical.hpp index a5c9d3c..03c104d 100644 --- a/include/boost/log/utility/functional/logical.hpp +++ b/include/boost/log/utility/functional/logical.hpp @@ -29,7 +29,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/matches.hpp b/include/boost/log/utility/functional/matches.hpp index 943a021..cc84bec 100644 --- a/include/boost/log/utility/functional/matches.hpp +++ b/include/boost/log/utility/functional/matches.hpp @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/nop.hpp b/include/boost/log/utility/functional/nop.hpp index d4f4edf..4cd876b 100644 --- a/include/boost/log/utility/functional/nop.hpp +++ b/include/boost/log/utility/functional/nop.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/functional/save_result.hpp b/include/boost/log/utility/functional/save_result.hpp index ce72adb..baf9687 100644 --- a/include/boost/log/utility/functional/save_result.hpp +++ b/include/boost/log/utility/functional/save_result.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -46,7 +46,7 @@ private: }; template< typename FunT, typename AssigneeT > -BOOST_LOG_FORCEINLINE save_result_wrapper< FunT, AssigneeT > save_result(FunT const& fun, AssigneeT& assignee) +BOOST_FORCEINLINE save_result_wrapper< FunT, AssigneeT > save_result(FunT const& fun, AssigneeT& assignee) { return save_result_wrapper< FunT, AssigneeT >(fun, assignee); } diff --git a/include/boost/log/utility/intrusive_ref_counter.hpp b/include/boost/log/utility/intrusive_ref_counter.hpp index 6a694d1..006fff2 100644 --- a/include/boost/log/utility/intrusive_ref_counter.hpp +++ b/include/boost/log/utility/intrusive_ref_counter.hpp @@ -22,7 +22,7 @@ #endif // BOOST_LOG_NO_THREADS #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/manipulators.hpp b/include/boost/log/utility/manipulators.hpp index 2081d4e..718828c 100644 --- a/include/boost/log/utility/manipulators.hpp +++ b/include/boost/log/utility/manipulators.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/manipulators/add_value.hpp b/include/boost/log/utility/manipulators/add_value.hpp index 69bd8a8..d6f81ed 100644 --- a/include/boost/log/utility/manipulators/add_value.hpp +++ b/include/boost/log/utility/manipulators/add_value.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/manipulators/dump.hpp b/include/boost/log/utility/manipulators/dump.hpp index 7dcaf74..df0424f 100644 --- a/include/boost/log/utility/manipulators/dump.hpp +++ b/include/boost/log/utility/manipulators/dump.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -32,14 +32,14 @@ namespace aux { typedef void dump_data_char_t(const void* data, std::size_t size, std::basic_ostream< char >& strm); extern BOOST_LOG_API dump_data_char_t* dump_data_char; -BOOST_LOG_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< char >& strm) +BOOST_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< char >& strm) { (dump_data_char)(data, size, strm); } typedef void dump_data_wchar_t(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm); extern BOOST_LOG_API dump_data_wchar_t* dump_data_wchar; -BOOST_LOG_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm) +BOOST_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm) { (dump_data_wchar)(data, size, strm); } @@ -47,7 +47,7 @@ BOOST_LOG_FORCEINLINE void dump_data(const void* data, std::size_t size, std::ba #if !defined(BOOST_NO_CXX11_CHAR16_T) typedef void dump_data_char16_t(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm); extern BOOST_LOG_API dump_data_char16_t* dump_data_char16; -BOOST_LOG_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm) +BOOST_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm) { (dump_data_char16)(data, size, strm); } @@ -56,7 +56,7 @@ BOOST_LOG_FORCEINLINE void dump_data(const void* data, std::size_t size, std::ba #if !defined(BOOST_NO_CXX11_CHAR32_T) typedef void dump_data_char32_t(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm); extern BOOST_LOG_API dump_data_char32_t* dump_data_char32; -BOOST_LOG_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm) +BOOST_FORCEINLINE void dump_data(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm) { (dump_data_char32)(data, size, strm); } diff --git a/include/boost/log/utility/manipulators/to_log.hpp b/include/boost/log/utility/manipulators/to_log.hpp index 5bde6dd..7f97d73 100644 --- a/include/boost/log/utility/manipulators/to_log.hpp +++ b/include/boost/log/utility/manipulators/to_log.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/once_block.hpp b/include/boost/log/utility/once_block.hpp index f9895dd..c70a531 100644 --- a/include/boost/log/utility/once_block.hpp +++ b/include/boost/log/utility/once_block.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -98,8 +98,8 @@ private: BOOST_LOG_API void rollback() BOOST_NOEXCEPT; // Non-copyable, non-assignable - BOOST_LOG_DELETED_FUNCTION(once_block_sentry(once_block_sentry const&)) - BOOST_LOG_DELETED_FUNCTION(once_block_sentry& operator= (once_block_sentry const&)) + BOOST_DELETED_FUNCTION(once_block_sentry(once_block_sentry const&)) + BOOST_DELETED_FUNCTION(once_block_sentry& operator= (once_block_sentry const&)) }; } // namespace aux @@ -144,8 +144,8 @@ public: } // Non-copyable, non-assignable - BOOST_LOG_DELETED_FUNCTION(once_block_sentry(once_block_sentry const&)) - BOOST_LOG_DELETED_FUNCTION(once_block_sentry& operator= (once_block_sentry const&)) + BOOST_DELETED_FUNCTION(once_block_sentry(once_block_sentry const&)) + BOOST_DELETED_FUNCTION(once_block_sentry& operator= (once_block_sentry const&)) }; } // namespace aux diff --git a/include/boost/log/utility/record_ordering.hpp b/include/boost/log/utility/record_ordering.hpp index 4950d13..90b762f 100644 --- a/include/boost/log/utility/record_ordering.hpp +++ b/include/boost/log/utility/record_ordering.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/setup.hpp b/include/boost/log/utility/setup.hpp index 68428e2..5b5ea24 100644 --- a/include/boost/log/utility/setup.hpp +++ b/include/boost/log/utility/setup.hpp @@ -30,7 +30,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/setup/common_attributes.hpp b/include/boost/log/utility/setup/common_attributes.hpp index a9315b8..af83f88 100644 --- a/include/boost/log/utility/setup/common_attributes.hpp +++ b/include/boost/log/utility/setup/common_attributes.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/setup/console.hpp b/include/boost/log/utility/setup/console.hpp index 25a9d42..ee8d219 100644 --- a/include/boost/log/utility/setup/console.hpp +++ b/include/boost/log/utility/setup/console.hpp @@ -32,7 +32,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/setup/file.hpp b/include/boost/log/utility/setup/file.hpp index 0391096..6ecb70a 100644 --- a/include/boost/log/utility/setup/file.hpp +++ b/include/boost/log/utility/setup/file.hpp @@ -37,7 +37,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/setup/filter_parser.hpp b/include/boost/log/utility/setup/filter_parser.hpp index 2903563..6c9d1c4 100644 --- a/include/boost/log/utility/setup/filter_parser.hpp +++ b/include/boost/log/utility/setup/filter_parser.hpp @@ -34,7 +34,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -56,7 +56,7 @@ struct filter_factory /*! * Default constructor */ - BOOST_LOG_DEFAULTED_FUNCTION(filter_factory(), {}) + BOOST_DEFAULTED_FUNCTION(filter_factory(), {}) /*! * Virtual destructor @@ -129,8 +129,8 @@ struct filter_factory BOOST_LOG_UNREACHABLE(); } - BOOST_LOG_DELETED_FUNCTION(filter_factory(filter_factory const&)) - BOOST_LOG_DELETED_FUNCTION(filter_factory& operator= (filter_factory const&)) + BOOST_DELETED_FUNCTION(filter_factory(filter_factory const&)) + BOOST_DELETED_FUNCTION(filter_factory& operator= (filter_factory const&)) }; /*! diff --git a/include/boost/log/utility/setup/formatter_parser.hpp b/include/boost/log/utility/setup/formatter_parser.hpp index 4293214..66a1561 100644 --- a/include/boost/log/utility/setup/formatter_parser.hpp +++ b/include/boost/log/utility/setup/formatter_parser.hpp @@ -31,7 +31,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -60,7 +60,7 @@ struct formatter_factory /*! * Default constructor */ - BOOST_LOG_DEFAULTED_FUNCTION(formatter_factory(), {}) + BOOST_DEFAULTED_FUNCTION(formatter_factory(), {}) /*! * Virtual destructor @@ -75,8 +75,8 @@ struct formatter_factory */ virtual formatter_type create_formatter(attribute_name const& name, args_map const& args) = 0; - BOOST_LOG_DELETED_FUNCTION(formatter_factory(formatter_factory const&)) - BOOST_LOG_DELETED_FUNCTION(formatter_factory& operator= (formatter_factory const&)) + BOOST_DELETED_FUNCTION(formatter_factory(formatter_factory const&)) + BOOST_DELETED_FUNCTION(formatter_factory& operator= (formatter_factory const&)) }; /*! diff --git a/include/boost/log/utility/setup/from_settings.hpp b/include/boost/log/utility/setup/from_settings.hpp index 6de6f25..83f91a4 100644 --- a/include/boost/log/utility/setup/from_settings.hpp +++ b/include/boost/log/utility/setup/from_settings.hpp @@ -25,7 +25,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -60,7 +60,7 @@ struct sink_factory /*! * Default constructor */ - BOOST_LOG_DEFAULTED_FUNCTION(sink_factory(), {}) + BOOST_DEFAULTED_FUNCTION(sink_factory(), {}) /*! * Virtual destructor @@ -74,8 +74,8 @@ struct sink_factory */ virtual shared_ptr< sinks::sink > create_sink(settings_section const& settings) = 0; - BOOST_LOG_DELETED_FUNCTION(sink_factory(sink_factory const&)) - BOOST_LOG_DELETED_FUNCTION(sink_factory& operator= (sink_factory const&)) + BOOST_DELETED_FUNCTION(sink_factory(sink_factory const&)) + BOOST_DELETED_FUNCTION(sink_factory& operator= (sink_factory const&)) }; /*! diff --git a/include/boost/log/utility/setup/from_stream.hpp b/include/boost/log/utility/setup/from_stream.hpp index 68aa9d3..02ee550 100644 --- a/include/boost/log/utility/setup/from_stream.hpp +++ b/include/boost/log/utility/setup/from_stream.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/setup/settings.hpp b/include/boost/log/utility/setup/settings.hpp index 379e544..b6ff0d1 100644 --- a/include/boost/log/utility/setup/settings.hpp +++ b/include/boost/log/utility/setup/settings.hpp @@ -30,12 +30,12 @@ #if !defined(BOOST_LOG_TYPEOF) #include #endif -#if defined(BOOST_LOG_TYPEOF) && defined(BOOST_LOG_NO_TRAILING_RESULT_TYPE) +#if defined(BOOST_LOG_TYPEOF) && defined(BOOST_NO_CXX11_TRAILING_RESULT_TYPES) #include #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -223,7 +223,7 @@ private: } #if defined(BOOST_LOG_TYPEOF) && !(defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) && !defined(__PATHSCALE__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 5)) -#if !defined(BOOST_LOG_NO_TRAILING_RESULT_TYPE) +#if !defined(BOOST_NO_CXX11_TRAILING_RESULT_TYPES) template< typename T > auto or_default(T const& def_value) const -> BOOST_LOG_TYPEOF(property_tree_type().get(typename property_tree_type::path_type(), def_value)) { @@ -297,7 +297,7 @@ private: typedef typename iterator_adaptor_::reference reference; public: - BOOST_LOG_DEFAULTED_FUNCTION(iter(), {}) + BOOST_DEFAULTED_FUNCTION(iter(), {}) template< bool OtherIsConstV > iter(iter< OtherIsConstV > const& that) : iterator_adaptor_(that.base()) {} explicit iter(base_iterator_type const& it) : iterator_adaptor_(it) {} @@ -506,7 +506,7 @@ public: { if (m_ptree) { - optional< property_tree_type const& > section = m_ptree->get_child_optional(section_name); + optional< property_tree_type& > section = m_ptree->get_child_optional(section_name); if (!!section) return (section->find(param_name) != section->not_found()); } diff --git a/include/boost/log/utility/setup/settings_parser.hpp b/include/boost/log/utility/setup/settings_parser.hpp index 8e4b38b..05c99d5 100644 --- a/include/boost/log/utility/setup/settings_parser.hpp +++ b/include/boost/log/utility/setup/settings_parser.hpp @@ -20,7 +20,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/strictest_lock.hpp b/include/boost/log/utility/strictest_lock.hpp index ae2282a..8780b11 100644 --- a/include/boost/log/utility/strictest_lock.hpp +++ b/include/boost/log/utility/strictest_lock.hpp @@ -33,7 +33,7 @@ #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/string_literal.hpp b/include/boost/log/utility/string_literal.hpp index e28be9d..f476895 100644 --- a/include/boost/log/utility/string_literal.hpp +++ b/include/boost/log/utility/string_literal.hpp @@ -28,7 +28,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/string_literal_fwd.hpp b/include/boost/log/utility/string_literal_fwd.hpp index 33aa7d9..7d9f3f8 100644 --- a/include/boost/log/utility/string_literal_fwd.hpp +++ b/include/boost/log/utility/string_literal_fwd.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/type_dispatch/date_time_types.hpp b/include/boost/log/utility/type_dispatch/date_time_types.hpp index fefdfc5..ce23aaa 100644 --- a/include/boost/log/utility/type_dispatch/date_time_types.hpp +++ b/include/boost/log/utility/type_dispatch/date_time_types.hpp @@ -26,7 +26,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp index 27356d4..312760f 100644 --- a/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/type_dispatch/standard_types.hpp b/include/boost/log/utility/type_dispatch/standard_types.hpp index 2cfa5de..1233cf6 100644 --- a/include/boost/log/utility/type_dispatch/standard_types.hpp +++ b/include/boost/log/utility/type_dispatch/standard_types.hpp @@ -23,7 +23,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp index 6f08c19..a47382c 100644 --- a/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp @@ -36,7 +36,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -62,12 +62,12 @@ template< typename VisitorT > struct dispatching_map_initializer { template< typename IteratorT > - static BOOST_LOG_FORCEINLINE void init(IteratorT*, IteratorT*, std::pair< type_info_wrapper, void* >*) + static BOOST_FORCEINLINE void init(IteratorT*, IteratorT*, std::pair< type_info_wrapper, void* >*) { } template< typename BeginIteratorT, typename EndIteratorT > - static BOOST_LOG_FORCEINLINE void init(BeginIteratorT*, EndIteratorT* end, std::pair< type_info_wrapper, void* >* p) + static BOOST_FORCEINLINE void init(BeginIteratorT*, EndIteratorT* end, std::pair< type_info_wrapper, void* >* p) { typedef typename mpl::deref< BeginIteratorT >::type type; do_init(static_cast< visible_type< type >* >(0), p); @@ -78,7 +78,7 @@ struct dispatching_map_initializer private: template< typename T > - static BOOST_LOG_FORCEINLINE void do_init(visible_type< T >*, std::pair< type_info_wrapper, void* >* p) + static BOOST_FORCEINLINE void do_init(visible_type< T >*, std::pair< type_info_wrapper, void* >* p) { p->first = typeid(visible_type< T >); @@ -176,8 +176,8 @@ private: } // Copying and assignment closed - BOOST_LOG_DELETED_FUNCTION(type_sequence_dispatcher(type_sequence_dispatcher const&)) - BOOST_LOG_DELETED_FUNCTION(type_sequence_dispatcher& operator= (type_sequence_dispatcher const&)) + BOOST_DELETED_FUNCTION(type_sequence_dispatcher(type_sequence_dispatcher const&)) + BOOST_DELETED_FUNCTION(type_sequence_dispatcher& operator= (type_sequence_dispatcher const&)) }; //! A simple dispatcher that only supports one type @@ -213,8 +213,8 @@ public: } // Copying and assignment closed - BOOST_LOG_DELETED_FUNCTION(single_type_dispatcher(single_type_dispatcher const&)) - BOOST_LOG_DELETED_FUNCTION(single_type_dispatcher& operator= (single_type_dispatcher const&)) + BOOST_DELETED_FUNCTION(single_type_dispatcher(single_type_dispatcher const&)) + BOOST_DELETED_FUNCTION(single_type_dispatcher& operator= (single_type_dispatcher const&)) }; } // namespace aux @@ -259,8 +259,8 @@ public: } // Copying and assignment prohibited - BOOST_LOG_DELETED_FUNCTION(static_type_dispatcher(static_type_dispatcher const&)) - BOOST_LOG_DELETED_FUNCTION(static_type_dispatcher& operator= (static_type_dispatcher const&)) + BOOST_DELETED_FUNCTION(static_type_dispatcher(static_type_dispatcher const&)) + BOOST_DELETED_FUNCTION(static_type_dispatcher& operator= (static_type_dispatcher const&)) }; BOOST_LOG_CLOSE_NAMESPACE // namespace log diff --git a/include/boost/log/utility/type_dispatch/type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/type_dispatcher.hpp index 14a9527..fc4c642 100644 --- a/include/boost/log/utility/type_dispatch/type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/type_dispatcher.hpp @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -162,9 +162,9 @@ protected: { } // Destructor and copying can only be called from the derived classes - BOOST_LOG_DEFAULTED_FUNCTION(~type_dispatcher(), {}) - BOOST_LOG_DEFAULTED_FUNCTION(type_dispatcher(type_dispatcher const& that), : m_get_callback_impl(that.m_get_callback_impl) {}) - BOOST_LOG_DEFAULTED_FUNCTION(type_dispatcher& operator= (type_dispatcher const& that), { m_get_callback_impl = that.m_get_callback_impl; return *this; }) + BOOST_DEFAULTED_FUNCTION(~type_dispatcher(), {}) + BOOST_DEFAULTED_FUNCTION(type_dispatcher(type_dispatcher const& that), : m_get_callback_impl(that.m_get_callback_impl) {}) + BOOST_DEFAULTED_FUNCTION(type_dispatcher& operator= (type_dispatcher const& that), { m_get_callback_impl = that.m_get_callback_impl; return *this; }) public: /*! diff --git a/include/boost/log/utility/type_info_wrapper.hpp b/include/boost/log/utility/type_info_wrapper.hpp index a59ac2f..d075289 100644 --- a/include/boost/log/utility/type_info_wrapper.hpp +++ b/include/boost/log/utility/type_info_wrapper.hpp @@ -27,7 +27,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -48,7 +48,7 @@ private: #ifndef BOOST_LOG_DOXYGEN_PASS //! An inaccessible type to indicate an uninitialized state of the wrapper - struct BOOST_LOG_VISIBLE uninitialized {}; + struct BOOST_SYMBOL_VISIBLE uninitialized {}; #ifdef BOOST_LOG_HAS_CXXABI_H //! A simple scope guard for automatic memory free diff --git a/include/boost/log/utility/unique_identifier_name.hpp b/include/boost/log/utility/unique_identifier_name.hpp index c1fd70f..debd205 100644 --- a/include/boost/log/utility/unique_identifier_name.hpp +++ b/include/boost/log/utility/unique_identifier_name.hpp @@ -19,7 +19,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/include/boost/log/utility/unused_variable.hpp b/include/boost/log/utility/unused_variable.hpp index bc057ee..29dfde1 100644 --- a/include/boost/log/utility/unused_variable.hpp +++ b/include/boost/log/utility/unused_variable.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -35,7 +35,7 @@ BOOST_LOG_OPEN_NAMESPACE namespace aux { template< typename T > -BOOST_LOG_FORCEINLINE void no_unused_warnings(T const&) {} +BOOST_FORCEINLINE void no_unused_warnings(T const&) {} } // namespace aux diff --git a/include/boost/log/utility/value_ref.hpp b/include/boost/log/utility/value_ref.hpp index 55cb2b4..79aaf58 100644 --- a/include/boost/log/utility/value_ref.hpp +++ b/include/boost/log/utility/value_ref.hpp @@ -47,7 +47,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -428,12 +428,12 @@ public: /*! * Default constructor. Creates a reference wrapper that does not refer to a value. */ - BOOST_LOG_DEFAULTED_FUNCTION(value_ref(), BOOST_NOEXCEPT {}) + BOOST_DEFAULTED_FUNCTION(value_ref(), BOOST_NOEXCEPT {}) /*! * Copy constructor. */ - BOOST_LOG_DEFAULTED_FUNCTION(value_ref(value_ref const& that), BOOST_NOEXCEPT : base_type(static_cast< base_type const& >(that)) {}) + BOOST_DEFAULTED_FUNCTION(value_ref(value_ref const& that), BOOST_NOEXCEPT : base_type(static_cast< base_type const& >(that)) {}) /*! * Initializing constructor. Creates a reference wrapper that refers to the specified value. diff --git a/include/boost/log/utility/value_ref_fwd.hpp b/include/boost/log/utility/value_ref_fwd.hpp index e7ffb3f..a3130f9 100644 --- a/include/boost/log/utility/value_ref_fwd.hpp +++ b/include/boost/log/utility/value_ref_fwd.hpp @@ -17,7 +17,7 @@ #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/src/alignment_gap_between.hpp b/src/alignment_gap_between.hpp index dfd881c..790a314 100644 --- a/src/alignment_gap_between.hpp +++ b/src/alignment_gap_between.hpp @@ -10,7 +10,7 @@ * \date 20.11.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_ALIGNMENT_GAP_BETWEEN_HPP_INCLUDED_ diff --git a/src/atomic_queue.hpp b/src/atomic_queue.hpp index d6e4511..3787379 100644 --- a/src/atomic_queue.hpp +++ b/src/atomic_queue.hpp @@ -10,7 +10,7 @@ * \date 14.07.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_ATOMIC_QUEUE_HPP_INCLUDED_ diff --git a/src/attribute_name.cpp b/src/attribute_name.cpp index 25db349..9a4ab16 100644 --- a/src/attribute_name.cpp +++ b/src/attribute_name.cpp @@ -10,7 +10,7 @@ * \date 28.06.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/attribute_set.cpp b/src/attribute_set.cpp index f8577bf..431404f 100644 --- a/src/attribute_set.cpp +++ b/src/attribute_set.cpp @@ -10,7 +10,7 @@ * \date 19.04.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/attribute_set_impl.hpp b/src/attribute_set_impl.hpp index 306ce71..93c551e 100644 --- a/src/attribute_set_impl.hpp +++ b/src/attribute_set_impl.hpp @@ -10,7 +10,7 @@ * \date 03.07.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_ATTRIBUTE_SET_IMPL_HPP_INCLUDED_ diff --git a/src/attribute_value_set.cpp b/src/attribute_value_set.cpp index d03381f..8145996 100644 --- a/src/attribute_value_set.cpp +++ b/src/attribute_value_set.cpp @@ -10,7 +10,7 @@ * \date 19.04.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include @@ -32,13 +32,13 @@ namespace boost { BOOST_LOG_OPEN_NAMESPACE -BOOST_LOG_FORCEINLINE attribute_value_set::node_base::node_base() : +BOOST_FORCEINLINE attribute_value_set::node_base::node_base() : m_pPrev(NULL), m_pNext(NULL) { } -BOOST_LOG_FORCEINLINE attribute_value_set::node::node(key_type const& key, mapped_type& data, bool dynamic) : +BOOST_FORCEINLINE attribute_value_set::node::node(key_type const& key, mapped_type& data, bool dynamic) : node_base(), m_Value(key, mapped_type()), m_DynamicallyAllocated(dynamic) diff --git a/src/code_conversion.cpp b/src/code_conversion.cpp index f9bc63d..73a17f0 100644 --- a/src/code_conversion.cpp +++ b/src/code_conversion.cpp @@ -10,7 +10,7 @@ * \date 08.11.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/core.cpp b/src/core.cpp index 2449ed4..be2ab2a 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -10,7 +10,7 @@ * \date 19.04.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include @@ -134,8 +134,8 @@ public: //! Returns the flag indicating whether it is needed to detach the record from the current thread bool is_detach_from_thread_needed() const BOOST_NOEXCEPT { return m_detach_from_thread_needed; } - BOOST_LOG_DELETED_FUNCTION(private_data(private_data const&)) - BOOST_LOG_DELETED_FUNCTION(private_data& operator= (private_data const&)) + BOOST_DELETED_FUNCTION(private_data(private_data const&)) + BOOST_DELETED_FUNCTION(private_data& operator= (private_data const&)) private: //! Returns a pointer to the first accepting sink @@ -286,7 +286,7 @@ public: //! Opens a record template< typename SourceAttributesT > - BOOST_LOG_FORCEINLINE record open_record(BOOST_FWD_REF(SourceAttributesT) source_attributes) + BOOST_FORCEINLINE record open_record(BOOST_FWD_REF(SourceAttributesT) source_attributes) { // Try a quick win first if (m_enabled) try diff --git a/src/date_time_format_parser.cpp b/src/date_time_format_parser.cpp index cef17ac..eaa4ead 100644 --- a/src/date_time_format_parser.cpp +++ b/src/date_time_format_parser.cpp @@ -10,7 +10,7 @@ * \date 30.09.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/default_attribute_names.cpp b/src/default_attribute_names.cpp index 4f679cf..6fb1170 100644 --- a/src/default_attribute_names.cpp +++ b/src/default_attribute_names.cpp @@ -10,7 +10,7 @@ * \date 13.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/default_filter_factory.cpp b/src/default_filter_factory.cpp index 3502991..ab95ff2 100644 --- a/src/default_filter_factory.cpp +++ b/src/default_filter_factory.cpp @@ -10,7 +10,7 @@ * \date 29.05.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) @@ -18,11 +18,14 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include -#include #include #include #include @@ -30,13 +33,8 @@ #include #include #include -#include -#include #include -#include #include -#include -#include #if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) #include #include @@ -55,135 +53,156 @@ BOOST_LOG_OPEN_NAMESPACE namespace aux { -template< typename CharT > -template< typename ValueT, typename PredicateT > -struct default_filter_factory< CharT >::predicate_wrapper -{ - typedef typename PredicateT::result_type result_type; +BOOST_LOG_ANONYMOUS_NAMESPACE { - explicit predicate_wrapper(attribute_name const& name, PredicateT const& pred) : m_name(name), m_visitor(pred) +#if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) + +//! A special filtering predicate that adopts the string operand to the attribute value character type +template< typename RelationT > +class string_predicate : + public RelationT +{ +private: + template< typename StringT > + struct initializer + { + typedef void result_type; + + explicit initializer(StringT const& val) : m_initializer(val) + { + } + + template< typename T > + result_type operator() (T& val) const + { + try + { + log::aux::code_convert(m_initializer, val); + } + catch (...) + { + val.clear(); + } + } + + private: + StringT const& m_initializer; + }; + +public: + typedef RelationT relation_type; + typedef typename relation_type::result_type result_type; + + template< typename StringT > + string_predicate(relation_type const& rel, StringT const& operand) : relation_type(rel) + { + fusion::for_each(m_operands, initializer< StringT >(operand)); + } + + template< typename T > + typename boost::enable_if< + mpl::contains< log::string_types::type, T >, + result_type + >::type operator() (T const& val) const + { + typedef std::basic_string< typename T::value_type > operand_type; + return relation_type::operator() (val, fusion::at_key< operand_type >(m_operands)); + } + +private: + fusion::set< std::string, std::wstring > m_operands; +}; + +#else // defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) + +//! A special filtering predicate that adopts the string operand to the attribute value character type +template< typename RelationT > +class string_predicate : + public RelationT +{ +private: +#if defined(BOOST_LOG_USE_CHAR) + typedef std::basic_string< char > string_type; +#elif defined(BOOST_LOG_USE_WCHAR_T) + typedef std::basic_string< wchar_t > string_type; +#else +#error Boost.Log: Inconsistent character configuration +#endif + +public: + typedef RelationT relation_type; + typedef typename relation_type::result_type result_type; + +public: + string_predicate(relation_type const& rel, string_type const& operand) : relation_type(rel), m_operand(operand) { } template< typename T > - result_type operator() (T const& arg) const + typename boost::enable_if< + mpl::contains< log::string_types::type, T >, + result_type + >::type operator() (T const& val) const { - bool res = false; - boost::log::visit< ValueT >(m_name, arg, save_result_wrapper< PredicateT const&, bool >(m_visitor, res)); - return res; + return relation_type::operator() (val, m_operand); } private: - attribute_name m_name; - const PredicateT m_visitor; + const string_type m_operand; }; -template< typename CharT > -template< typename RelationT > -struct default_filter_factory< CharT >::on_integral_argument -{ - typedef void result_type; +#endif // defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) - on_integral_argument(attribute_name const& name, filter& f) : m_name(name), m_filter(f) +//! A filtering predicate for numeric relations +template< typename NumericT, typename RelationT > +class numeric_predicate : + public string_predicate< RelationT > +{ + typedef string_predicate< RelationT > base_type; + +public: + typedef NumericT numeric_type; + typedef typename base_type::relation_type relation_type; + typedef typename base_type::result_type result_type; + +public: + template< typename StringT > + numeric_predicate(relation_type const& rel, StringT const& string_operand, numeric_type numeric_operand) : + base_type(rel, string_operand), + m_numeric_operand(numeric_operand) { } - result_type operator() (long val) const + using base_type::operator(); + + template< typename T > + typename boost::disable_if< + mpl::contains< log::string_types::type, T >, + result_type + >::type operator() (T const& val) const { - typedef binder2nd< RelationT, long > predicate; - m_filter = predicate_wrapper< log::integral_types::type, predicate >(m_name, predicate(RelationT(), val)); + return relation_type::operator() (val, m_numeric_operand); } private: - attribute_name m_name; - filter& m_filter; + const numeric_type m_numeric_operand; }; -template< typename CharT > + template< typename RelationT > -struct default_filter_factory< CharT >::on_fp_argument +struct on_string_argument { typedef void result_type; - on_fp_argument(attribute_name const& name, filter& f) : m_name(name), m_filter(f) - { - } - - result_type operator() (double val) const - { - typedef binder2nd< RelationT, double > predicate; - m_filter = predicate_wrapper< log::floating_point_types::type, predicate >(m_name, predicate(RelationT(), val)); - } - -private: - attribute_name m_name; - filter& m_filter; -}; - -template< typename CharT > -template< typename RelationT > -struct default_filter_factory< CharT >::on_string_argument -{ - typedef void result_type; - -#if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) - //! A special filtering predicate that adopts the string operand to the attribute value character type - struct predicate : - public RelationT - { - struct initializer - { - typedef void result_type; - - explicit initializer(string_type const& val) : m_initializer(val) - { - } - - template< typename T > - result_type operator() (T& val) const - { - try - { - log::aux::code_convert(m_initializer, val); - } - catch (...) - { - val.clear(); - } - } - - private: - string_type const& m_initializer; - }; - - typedef typename RelationT::result_type result_type; - - explicit predicate(RelationT const& rel, string_type const& operand) : RelationT(rel) - { - fusion::for_each(m_operands, initializer(operand)); - } - - template< typename T > - result_type operator() (T const& val) const - { - typedef std::basic_string< typename T::value_type > operand_type; - return RelationT::operator() (val, fusion::at_key< operand_type >(m_operands)); - } - - private: - fusion::set< std::string, std::wstring > m_operands; - }; -#else - typedef binder2nd< RelationT, string_type > predicate; -#endif - on_string_argument(attribute_name const& name, filter& f) : m_name(name), m_filter(f) { } - result_type operator() (string_type const& val) const + template< typename StringT > + result_type operator() (StringT const& val) const { - m_filter = predicate_wrapper< log::string_types::type, predicate >(m_name, predicate(RelationT(), val)); + typedef string_predicate< RelationT > predicate; + m_filter = predicate_wrapper< log::string_types, predicate >(m_name, predicate(RelationT(), val)); } private: @@ -191,101 +210,57 @@ private: filter& m_filter; }; -template< typename CharT > -template< typename RelationT > -struct default_filter_factory< CharT >::on_regex_argument +template< typename RelationT, typename StringT > +struct on_integral_argument { typedef void result_type; -#if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) - //! A special filtering predicate that adopts the string operand to the attribute value character type - struct predicate : - public RelationT - { - struct initializer - { - typedef void result_type; - - explicit initializer(string_type const& val) : m_initializer(val) - { - } - - template< typename T > - result_type operator() (T& val) const - { - try - { - typedef typename T::char_type char_type; - std::basic_string< char_type > str; - log::aux::code_convert(m_initializer, str); - val = T::compile(str.c_str(), str.size(), T::ECMAScript | T::optimize); - } - catch (...) - { - } - } - - private: - string_type const& m_initializer; - }; - - typedef typename RelationT::result_type result_type; - - explicit predicate(RelationT const& rel, string_type const& operand) : RelationT(rel) - { - fusion::for_each(m_operands, initializer(operand)); - } - - template< typename T > - result_type operator() (T const& val) const - { - typedef typename T::value_type char_type; - typedef xpressive::basic_regex< const char_type* > regex_type; - return RelationT::operator() (val, fusion::at_key< regex_type >(m_operands)); - } - - private: - fusion::set< xpressive::cregex, xpressive::wcregex > m_operands; - }; -#else - //! A special filtering predicate that adopts the string operand to the attribute value character type - struct predicate : - public RelationT - { - typedef typename RelationT::result_type result_type; - typedef xpressive::basic_regex< typename string_type::value_type const* > regex_type; - - explicit predicate(RelationT const& rel, string_type const& operand) : - RelationT(rel), - m_operand(regex_type::compile(operand.c_str(), operand.size(), regex_type::ECMAScript | regex_type::optimize)) - { - } - - template< typename T > - result_type operator() (T const& val) const - { - return RelationT::operator() (val, m_operand); - } - - private: - regex_type m_operand; - }; -#endif - - on_regex_argument(attribute_name const& name, filter& f) : m_name(name), m_filter(f) + on_integral_argument(attribute_name const& name, StringT const& operand, filter& f) : m_name(name), m_operand(operand), m_filter(f) { } - result_type operator() (string_type const& val) const + result_type operator() (long val) const { - m_filter = predicate_wrapper< log::string_types::type, predicate >(m_name, predicate(RelationT(), val)); + typedef numeric_predicate< long, RelationT > predicate; + typedef mpl::copy< + log::string_types, + mpl::back_inserter< log::numeric_types > + >::type value_types; + m_filter = predicate_wrapper< value_types, predicate >(m_name, predicate(RelationT(), m_operand, val)); } private: attribute_name m_name; + StringT const& m_operand; filter& m_filter; }; +template< typename RelationT, typename StringT > +struct on_fp_argument +{ + typedef void result_type; + + on_fp_argument(attribute_name const& name, StringT const& operand, filter& f) : m_name(name), m_operand(operand), m_filter(f) + { + } + + result_type operator() (double val) const + { + typedef numeric_predicate< double, RelationT > predicate; + typedef mpl::copy< + log::string_types, + mpl::back_inserter< log::floating_point_types > + >::type value_types; + m_filter = predicate_wrapper< value_types, predicate >(m_name, predicate(RelationT(), m_operand, val)); + } + +private: + attribute_name m_name; + StringT const& m_operand; + filter& m_filter; +}; + +} // namespace //! The callback for equality relation filter template< typename CharT > @@ -343,7 +318,7 @@ filter default_filter_factory< CharT >::on_custom_relation(attribute_name const& else if (rel == constants::contains_keyword()) on_string_argument< contains_fun >(name, f)(arg); else if (rel == constants::matches_keyword()) - on_regex_argument< matches_fun >(name, f)(arg); + f = parse_matches_relation(name, arg); else { BOOST_LOG_THROW_DESCR(parse_error, "The custom attribute relation \"" + log::aux::to_narrow(rel) + "\" is not supported"); @@ -362,8 +337,8 @@ filter default_filter_factory< CharT >::parse_argument(attribute_name const& nam const qi::real_parser< double, qi::strict_real_policies< double > > real_; filter f; - const on_fp_argument< RelationT > on_fp(name, f); - const on_integral_argument< RelationT > on_int(name, f); + const on_fp_argument< RelationT, string_type > on_fp(name, arg, f); + const on_integral_argument< RelationT, string_type > on_int(name, arg, f); const on_string_argument< RelationT > on_str(name, f); const bool res = qi::parse diff --git a/src/default_filter_factory.hpp b/src/default_filter_factory.hpp index 802690d..a37db17 100644 --- a/src/default_filter_factory.hpp +++ b/src/default_filter_factory.hpp @@ -10,13 +10,17 @@ * \date 29.05.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_DEFAULT_FILTER_FACTORY_HPP_INCLUDED_ #define BOOST_DEFAULT_FILTER_FACTORY_HPP_INCLUDED_ +#include +#include +#include #include +#include #include namespace boost { @@ -25,28 +29,40 @@ BOOST_LOG_OPEN_NAMESPACE namespace aux { +//! Relation predicate wrapper +template< typename ValueT, typename PredicateT > +struct predicate_wrapper +{ + typedef typename PredicateT::result_type result_type; + + explicit predicate_wrapper(attribute_name const& name, PredicateT const& pred) : m_name(name), m_visitor(pred) + { + } + + template< typename T > + result_type operator() (T const& arg) const + { + bool res = false; + boost::log::visit< ValueT >(m_name, arg, save_result_wrapper< PredicateT const&, bool >(m_visitor, res)); + return res; + } + +private: + attribute_name m_name; + const PredicateT m_visitor; +}; + //! The default filter factory that supports creating filters for the standard types (see utility/type_dispatch/standard_types.hpp) template< typename CharT > class default_filter_factory : public filter_factory< CharT > { +private: //! Base type typedef filter_factory< CharT > base_type; //! Self type typedef default_filter_factory< CharT > this_type; - template< typename ValueT, typename PredicateT > - struct predicate_wrapper; - - template< typename RelationT > - struct on_integral_argument; - template< typename RelationT > - struct on_fp_argument; - template< typename RelationT > - struct on_string_argument; - template< typename RelationT > - struct on_regex_argument; - public: // Type imports typedef typename base_type::char_type char_type; @@ -68,11 +84,16 @@ public: //! The callback for custom relation filter virtual filter on_custom_relation(attribute_name const& name, string_type const& rel, string_type const& arg); +private: //! The function parses the argument value for a binary relation and constructs the corresponding filter template< typename RelationT > static filter parse_argument(attribute_name const& name, string_type const& arg); }; +//! The function parses the "matches" relation +template< typename CharT > +filter parse_matches_relation(attribute_name const& name, std::basic_string< CharT > const& operand); + } // namespace aux BOOST_LOG_CLOSE_NAMESPACE // namespace log diff --git a/src/default_formatter_factory.cpp b/src/default_formatter_factory.cpp index ab601be..c6d1c55 100644 --- a/src/default_formatter_factory.cpp +++ b/src/default_formatter_factory.cpp @@ -10,7 +10,7 @@ * \date 14.07.2013 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) diff --git a/src/default_formatter_factory.hpp b/src/default_formatter_factory.hpp index cc9a51a..b45692a 100644 --- a/src/default_formatter_factory.hpp +++ b/src/default_formatter_factory.hpp @@ -10,7 +10,7 @@ * \date 14.07.2013 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_DEFAULT_FORMATTER_FACTORY_HPP_INCLUDED_ diff --git a/src/default_sink.cpp b/src/default_sink.cpp index 6ea880f..687dd14 100644 --- a/src/default_sink.cpp +++ b/src/default_sink.cpp @@ -10,7 +10,7 @@ * \date 19.04.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/default_sink.hpp b/src/default_sink.hpp index 7b5d381..f5bf5ed 100644 --- a/src/default_sink.hpp +++ b/src/default_sink.hpp @@ -10,7 +10,7 @@ * \date 08.01.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_DEFAULT_SINK_HPP_INCLUDED_ @@ -29,7 +29,7 @@ #endif #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/src/dump.cpp b/src/dump.cpp index 308e74f..526936d 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -10,7 +10,7 @@ * \date 03.05.2013 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/dump_avx2.cpp b/src/dump_avx2.cpp index e773d3c..045a5d7 100644 --- a/src/dump_avx2.cpp +++ b/src/dump_avx2.cpp @@ -10,7 +10,7 @@ * \date 05.05.2013 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ // NOTE: You should generally avoid including headers as much as possible here, because this file @@ -20,7 +20,6 @@ #include #include #include -#include #include namespace boost { @@ -56,7 +55,7 @@ static const ymm_constant mm_shuffle_pattern3 = {{ 5, 0x80, 6, 7, 0x80, 8, 9, 0x static const ymm_constant mm_shuffle_pattern13 = {{ 0x80, 0, 1, 0x80, 2, 3, 0x80, 4, 5, 0x80, 6, 7, 0x80, 8, 9, 0x80, 5, 0x80, 6, 7, 0x80, 8, 9, 0x80, 10, 11, 0x80, 12, 13, 0x80, 14, 15 }}; //! Dumps a pack of input data into a string of 8 bit ASCII characters -static BOOST_LOG_FORCEINLINE void dump_pack(__m256i mm_char_a, __m256i mm_input, __m256i& mm_output1, __m256i& mm_output2, __m256i& mm_output3) +static BOOST_FORCEINLINE void dump_pack(__m256i mm_char_a, __m256i mm_input, __m256i& mm_output1, __m256i& mm_output2, __m256i& mm_output3) { // Split half-bytes const __m256i mm_15 = _mm256_set1_epi8(0x0F); @@ -98,7 +97,7 @@ static BOOST_LOG_FORCEINLINE void dump_pack(__m256i mm_char_a, __m256i mm_input, } //! Dumps a pack of input data into a string of 8 bit ASCII characters -static BOOST_LOG_FORCEINLINE void dump_pack(__m256i mm_char_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) +static BOOST_FORCEINLINE void dump_pack(__m256i mm_char_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) { // Split half-bytes __m128i mm_input_hi = _mm_srli_epi16(mm_input, 4); @@ -123,7 +122,7 @@ static BOOST_LOG_FORCEINLINE void dump_pack(__m256i mm_char_a, __m128i mm_input, } template< typename CharT > -BOOST_LOG_FORCEINLINE void store_characters(__m256i mm_chars, CharT* buf) +BOOST_FORCEINLINE void store_characters(__m256i mm_chars, CharT* buf) { switch (sizeof(CharT)) { @@ -149,7 +148,7 @@ BOOST_LOG_FORCEINLINE void store_characters(__m256i mm_chars, CharT* buf) } template< typename CharT > -BOOST_LOG_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) +BOOST_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) { switch (sizeof(CharT)) { @@ -172,7 +171,7 @@ BOOST_LOG_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) } template< typename CharT > -BOOST_LOG_FORCEINLINE void dump_data_avx2(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) +BOOST_FORCEINLINE void dump_data_avx2(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) { typedef CharT char_type; diff --git a/src/dump_ssse3.cpp b/src/dump_ssse3.cpp index ba02406..462823d 100644 --- a/src/dump_ssse3.cpp +++ b/src/dump_ssse3.cpp @@ -10,7 +10,7 @@ * \date 05.05.2013 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ // NOTE: You should generally avoid including headers as much as possible here, because this file @@ -20,7 +20,6 @@ #include #include #include -#include #include namespace boost { @@ -58,7 +57,7 @@ static const xmm_constant mm_shuffle_pattern2 = {{ 0, 1, 0x80, 2, 3, 0x80, 4, 5, static const xmm_constant mm_shuffle_pattern3 = {{ 5, 0x80, 6, 7, 0x80, 8, 9, 0x80, 10, 11, 0x80, 12, 13, 0x80, 14, 15 }}; //! Dumps a pack of input data into a string of 8 bit ASCII characters -static BOOST_LOG_FORCEINLINE void dump_pack(__m128i mm_char_10_to_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) +static BOOST_FORCEINLINE void dump_pack(__m128i mm_char_10_to_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) { // Split half-bytes __m128i mm_input_hi = _mm_and_si128(_mm_srli_epi16(mm_input, 4), mm_15.as_mm); @@ -96,7 +95,7 @@ static BOOST_LOG_FORCEINLINE void dump_pack(__m128i mm_char_10_to_a, __m128i mm_ } template< typename CharT > -BOOST_LOG_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) +BOOST_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) { switch (sizeof(CharT)) { @@ -127,7 +126,7 @@ BOOST_LOG_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) } template< typename CharT > -BOOST_LOG_FORCEINLINE void dump_data_ssse3(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) +BOOST_FORCEINLINE void dump_data_ssse3(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) { typedef CharT char_type; diff --git a/src/event.cpp b/src/event.cpp index 83759c4..7426d34 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -10,13 +10,14 @@ * \date 24.07.2011 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include #ifndef BOOST_LOG_NO_THREADS +#include #include #include #include @@ -61,15 +62,16 @@ BOOST_LOG_API sem_based_event::sem_based_event() : m_state(0U) { if (sem_init(&m_semaphore, 0, 0) != 0) { + const int err = errno; BOOST_THROW_EXCEPTION(system::system_error( - errno, system::system_category(), "Failed to initialize semaphore")); + err, system::system_category(), "Failed to initialize semaphore")); } } //! Destructor BOOST_LOG_API sem_based_event::~sem_based_event() { - sem_destroy(&m_semaphore); + BOOST_VERIFY(sem_destroy(&m_semaphore) == 0); } //! Waits for the object to become signalled @@ -79,10 +81,11 @@ BOOST_LOG_API void sem_based_event::wait() { if (sem_wait(&m_semaphore) != 0) { - if (errno != EINTR) + const int err = errno; + if (err != EINTR) { BOOST_THROW_EXCEPTION(system::system_error( - errno, system::system_category(), "Failed to block on the semaphore")); + err, system::system_category(), "Failed to block on the semaphore")); } } else @@ -98,9 +101,10 @@ BOOST_LOG_API void sem_based_event::set_signalled() { if (sem_post(&m_semaphore) != 0) { + const int err = errno; BOOST_LOG_EVENT_RESET(m_state); BOOST_THROW_EXCEPTION(system::system_error( - errno, system::system_category(), "Failed to wake the blocked thread")); + err, system::system_category(), "Failed to wake the blocked thread")); } } } @@ -114,15 +118,16 @@ BOOST_LOG_API winapi_based_event::winapi_based_event() : { if (!m_event) { + const DWORD err = GetLastError(); BOOST_THROW_EXCEPTION(system::system_error( - GetLastError(), system::system_category(), "Failed to create Windows event")); + err, system::system_category(), "Failed to create Windows event")); } } //! Destructor BOOST_LOG_API winapi_based_event::~winapi_based_event() { - CloseHandle(m_event); + BOOST_VERIFY(CloseHandle(m_event) != 0); } //! Waits for the object to become signalled @@ -133,8 +138,9 @@ BOOST_LOG_API void winapi_based_event::wait() { if (WaitForSingleObject(m_event, INFINITE) != 0) { + const DWORD err = GetLastError(); BOOST_THROW_EXCEPTION(system::system_error( - GetLastError(), system::system_category(), "Failed to block on Windows event")); + err, system::system_category(), "Failed to block on Windows event")); } } const_cast< volatile boost::uint32_t& >(m_state) = 0; @@ -147,9 +153,10 @@ BOOST_LOG_API void winapi_based_event::set_signalled() { if (SetEvent(m_event) == 0) { + const DWORD err = GetLastError(); const_cast< volatile boost::uint32_t& >(m_state) = 0; BOOST_THROW_EXCEPTION(system::system_error( - GetLastError(), system::system_category(), "Failed to wake the blocked thread")); + err, system::system_category(), "Failed to wake the blocked thread")); } } } diff --git a/src/event_log_registry.hpp b/src/event_log_registry.hpp index 4f7f77a..cd02dc3 100644 --- a/src/event_log_registry.hpp +++ b/src/event_log_registry.hpp @@ -10,7 +10,7 @@ * \date 16.11.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_EVENT_LOG_REGISTRY_HPP_INCLUDED_ diff --git a/src/exceptions.cpp b/src/exceptions.cpp index c935fe9..0d6b6d5 100644 --- a/src/exceptions.cpp +++ b/src/exceptions.cpp @@ -10,7 +10,7 @@ * \date 31.10.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/filter_parser.cpp b/src/filter_parser.cpp index 7e324f0..dcd85d6 100644 --- a/src/filter_parser.cpp +++ b/src/filter_parser.cpp @@ -10,7 +10,7 @@ * \date 31.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS @@ -23,23 +23,14 @@ #include #include #include -#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include #include #include #include @@ -54,8 +45,6 @@ #include "spirit_encoding.hpp" #include -namespace qi = boost::spirit::qi; - namespace boost { BOOST_LOG_OPEN_NAMESPACE @@ -125,23 +114,17 @@ private: } }; -//! Filter parsing grammar +//! Filter parser template< typename CharT > -class filter_grammar : - public qi::grammar< - const CharT*, - typename log::aux::encoding_specific< typename log::aux::encoding< CharT >::type >::space_type - > +class filter_parser { private: typedef CharT char_type; typedef const char_type* iterator_type; - typedef log::aux::encoding_specific< typename log::aux::encoding< char_type >::type > encoding_specific; + typedef typename log::aux::encoding< char_type >::type encoding; + typedef log::aux::encoding_specific< encoding > encoding_specific; typedef std::basic_string< char_type > string_type; typedef log::aux::char_constants< char_type > constants; - typedef filter_grammar< char_type > this_type; - typedef qi::grammar< iterator_type, typename encoding_specific::space_type > base_type; - typedef typename base_type::start_type rule_type; typedef filter_factory< char_type > filter_factory_type; typedef filter (filter_factory_type::*comparison_relation_handler_t)(attribute_name const&, string_type const&); @@ -159,147 +142,230 @@ private: //! Filter subexpressions as they are parsed mutable std::stack< filter > m_Subexpressions; - //! A parser for an attribute name in a single relation - rule_type attr_name; - //! A parser for a quoted string - rule_type quoted_string_operand; - //! A parser for an operand in a single relation - rule_type operand; - //! A parser for a single relation that consists of two operands and an operation between them - rule_type relation; - //! A set of comparison relation symbols with corresponding pointers to callbacks - qi::symbols< char_type, comparison_relation_handler_t > comparison_relation; - //! A parser for a custom relation word - rule_type custom_relation; - //! A parser for a term, which can be a relation, an expression in parenthesis or a negation thereof - rule_type term; - //! A parser for the complete filter expression that consists of one or several terms with boolean operations between them - rule_type expression; - public: //! Constructor - filter_grammar() : - base_type(expression), + filter_parser() : m_ComparisonRelation(NULL) { - attr_name = qi::lexeme - [ - // An attribute name in form %name% - qi::as< string_type >()[ qi::lit(constants::char_percent) >> +(encoding_specific::print - constants::char_percent) >> qi::lit(constants::char_percent) ] - [boost::bind(&filter_grammar::on_attribute_name, this, _1)] - ]; - - quoted_string_operand = qi::raw - [ - qi::lexeme - [ - // A quoted string with C-style escape sequences support - qi::lit(constants::char_quote) >> - *( - (qi::lit(constants::char_backslash) >> qi::char_) | - (qi::char_ - qi::lit(constants::char_quote)) - ) >> - qi::lit(constants::char_quote) - ] - ] - [boost::bind(&filter_grammar::on_quoted_string_operand, this, _1)]; - - operand = - ( - quoted_string_operand | - // A single word, enclosed with white spaces. It cannot contain parenthesis, since it is used by the filter parser. - qi::raw[ qi::lexeme[ +(encoding_specific::graph - qi::lit(constants::char_paren_bracket_left) - qi::lit(constants::char_paren_bracket_right)) ] ] - [boost::bind(&filter_grammar::on_operand, this, _1)] - ); - - // Custom relation is a keyword that may contain either alphanumeric characters or an underscore - custom_relation = qi::as< string_type >()[ qi::lexeme[ +(encoding_specific::alnum | qi::char_(constants::char_underline)) ] ] - [boost::bind(&filter_grammar::set_custom_relation, this, _1)]; - - comparison_relation.add - (constants::equal_keyword(), &filter_factory_type::on_equality_relation) - (constants::not_equal_keyword(), &filter_factory_type::on_inequality_relation) - (constants::greater_keyword(), &filter_factory_type::on_greater_relation) - (constants::less_keyword(), &filter_factory_type::on_less_relation) - (constants::greater_or_equal_keyword(), &filter_factory_type::on_greater_or_equal_relation) - (constants::less_or_equal_keyword(), &filter_factory_type::on_less_or_equal_relation); - - relation = - ( - attr_name >> // The relation may be as simple as a sole attribute name, in which case the filter checks for the attribute value presence - -( - (comparison_relation[boost::bind(&filter_grammar::set_comparison_relation, this, _1)] >> operand) | - (custom_relation >> operand) - ) - ) - [boost::bind(&filter_grammar::on_relation_complete, this)]; - - term = - ( - (qi::lit(constants::char_paren_bracket_left) >> expression >> constants::char_paren_bracket_right) | - ((qi::lit(constants::not_keyword()) | constants::char_exclamation) >> term)[boost::bind(&filter_grammar::on_negation, this)] | - relation - ); - - expression = - ( - term >> - *( - ((qi::lit(constants::and_keyword()) | constants::char_and) >> term)[boost::bind(&filter_grammar::on_and, this)] | - ((qi::lit(constants::or_keyword()) | constants::char_or) >> term)[boost::bind(&filter_grammar::on_or, this)] - ) - ); } //! The method returns the constructed filter filter get_filter() { - BOOST_ASSERT(!m_Subexpressions.empty()); + if (m_Subexpressions.empty()) + return filter(); return boost::move(m_Subexpressions.top()); } + //! The pethod parses filter from the string + void parse(iterator_type& begin, iterator_type end, unsigned int depth = 0) + { + typedef void (filter_parser::*logical_op_t)(); + logical_op_t logical_op = NULL; + iterator_type p = constants::trim_spaces_left(begin, end); + while (p != end) + { + // Parse subexpression + parse_subexpression(p, end, depth); + if (logical_op) + { + // This was the right-hand subexpression. Compose the two top subexpressions into a single filter. + (this->*logical_op)(); + logical_op = NULL; + } + + p = constants::trim_spaces_left(p, end); + if (p != end) + { + char_type c = *p; + iterator_type next = p + 1; + if (c == constants::char_paren_bracket_right) + { + // The subexpression has ended + if (depth == 0) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: unmatched closing parenthesis"); + + p = next; + --depth; + break; + } + else if (c == constants::char_and || scan_keyword(p, end, next, constants::and_keyword())) + { + logical_op = &filter_parser::on_and; + } + else if (c == constants::char_or || scan_keyword(p, end, next, constants::or_keyword())) + { + logical_op = &filter_parser::on_or; + } + else + { + BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: unexpected character encountered"); + } + + p = constants::trim_spaces_left(next, end); + } + else + break; + } + + if (logical_op) + { + BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: logical operation without the right-hand subexpression"); + } + + if (p == end && depth > 0) + { + BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: unterminated parenthesis"); + } + + begin = p; + } + private: + //! The method parses a single subexpression + void parse_subexpression(iterator_type& begin, iterator_type end, unsigned int depth) + { + bool negated = false, negation_present = false, done = false; + iterator_type p = begin; + + while (p != end) + { + char_type c = *p; + iterator_type next = p + 1; + if (c == constants::char_percent) + { + // We found an attribute placeholder + iterator_type start = constants::trim_spaces_left(next, end); + p = constants::scan_attr_placeholder(start, end); + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder in the filter string"); + + on_attribute_name(start, p); + + p = constants::trim_spaces_left(p, end); + if (p == end || *p != constants::char_percent) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder in the filter string"); + + // Skip the closing char_percent + p = constants::trim_spaces_left(++p, end); + + // If the filter has negation operator, do not expect a relation (i.e. "!%attr% > 1" is not valid because "!%attr%" is interpreted as an attribute presence test) + if (!negation_present) + p = parse_relation(p, end); + else + on_relation_complete(); + } + else if (c == constants::char_exclamation || scan_keyword(p, end, next, constants::not_keyword())) + { + // We found negation operation. Parse the subexpression to be negated. + negated ^= true; + negation_present = true; + p = constants::trim_spaces_left(next, end); + continue; + } + else if (c == constants::char_paren_bracket_left) + { + // We found a nested subexpression + parse(next, end, depth + 1); + p = next; + } + else + { + BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: unexpected character"); + } + + if (negated) + on_negation(); + + done = true; + + break; + } + + if (negation_present && !done) + { + // This would happen if a filter consists of a single '!' + BOOST_LOG_THROW_DESCR(parse_error, "Filter parsing error: negation operator applied to nothingness"); + } + + begin = p; + } + + //! Parses filtering relation + iterator_type parse_relation(iterator_type begin, iterator_type end) + { + iterator_type p = begin; + if (p != end) + { + iterator_type next = p; + if (scan_keyword(p, end, next, constants::equal_keyword())) + m_ComparisonRelation = &filter_factory_type::on_equality_relation; + else if (scan_keyword(p, end, next, constants::not_equal_keyword())) + m_ComparisonRelation = &filter_factory_type::on_inequality_relation; + else if (scan_keyword(p, end, next, constants::greater_keyword())) + m_ComparisonRelation = &filter_factory_type::on_greater_relation; + else if (scan_keyword(p, end, next, constants::less_keyword())) + m_ComparisonRelation = &filter_factory_type::on_less_relation; + else if (scan_keyword(p, end, next, constants::greater_or_equal_keyword())) + m_ComparisonRelation = &filter_factory_type::on_greater_or_equal_relation; + else if (scan_keyword(p, end, next, constants::less_or_equal_keyword())) + m_ComparisonRelation = &filter_factory_type::on_less_or_equal_relation; + else + { + // Check for custom relation + while (next != end && (encoding::isalnum(*next) || *next == constants::char_underline)) + ++next; + if (p == next) + goto DoneL; + m_CustomRelation.assign(p, next); + } + + // We have parsed a relation operator, there must be an operand + next = constants::trim_spaces_left(next, end); + string_type operand; + p = constants::parse_operand(next, end, operand); + if (next == p) + BOOST_LOG_THROW_DESCR(parse_error, "Missing operand for a relation in the filter string"); + + m_Operand = boost::in_place(operand); + } + + DoneL: + // The relation can be as simple as a sole attribute placeholder (which means that only attribute presence has to be checked). + // So regardless how we get here, the relation is parsed completely. + on_relation_complete(); + + return p; + } + + //! Checks if the string contains a keyword + static bool scan_keyword(iterator_type begin, iterator_type end, iterator_type& next, iterator_type keyword) + { + for (iterator_type p = begin; p != end; ++p, ++keyword) + { + char_type c1 = *p, c2 = *keyword; + if (c2 == 0) + { + if (encoding::isspace(c1)) + { + next = p; + return true; + } + break; + } + if (c1 != c2) + break; + } + + return false; + } + //! The attribute name handler - void on_attribute_name(string_type const& name) + void on_attribute_name(iterator_type begin, iterator_type end) { - m_AttributeName = attribute_name(log::aux::to_narrow(name)); - } - - //! The operand string handler - void on_operand(iterator_range< iterator_type > const& arg) - { - // An attribute name should have been parsed at this point - if (!m_AttributeName) - BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: operand is not expected"); - - m_Operand = boost::in_place(arg.begin(), arg.end()); - } - - //! The quoted string handler - void on_quoted_string_operand(iterator_range< iterator_type > const& arg) - { - // An attribute name should have been parsed at this point - if (!m_AttributeName) - BOOST_LOG_THROW_DESCR(parse_error, "Invalid filter definition: quoted string operand is not expected"); - - // Cut off the quotes - string_type str(arg.begin() + 1, arg.end() - 1); - - // Translate escape sequences - constants::translate_escape_sequences(str); - m_Operand = str; - } - - //! The method saves the relation word into an internal string - void set_comparison_relation(comparison_relation_handler_t rel) - { - m_ComparisonRelation = rel; - } - - //! The method saves the relation word into an internal string - void set_custom_relation(string_type const& rel) - { - m_CustomRelation = rel; + if (begin == end) + BOOST_LOG_THROW_DESCR(parse_error, "Empty attribute name encountered"); + m_AttributeName = attribute_name(log::aux::to_narrow(string_type(begin, end))); } //! The comparison relation handler @@ -357,8 +423,8 @@ private: } else { - // This would happen if a filter consists of a single '!' - BOOST_LOG_THROW_DESCR(parse_error, "Filter parsing error: a negation operator applied to nothingness"); + // This would happen if a filter consists of "!()" + BOOST_LOG_THROW_DESCR(parse_error, "Filter parsing error: negation operator applied to an empty subexpression"); } } @@ -401,8 +467,8 @@ private: } // Assignment and copying are prohibited - BOOST_LOG_DELETED_FUNCTION(filter_grammar(filter_grammar const&)) - BOOST_LOG_DELETED_FUNCTION(filter_grammar& operator= (filter_grammar const&)) + BOOST_DELETED_FUNCTION(filter_parser(filter_parser const&)) + BOOST_DELETED_FUNCTION(filter_parser& operator= (filter_parser const&)) }; } // namespace @@ -427,21 +493,15 @@ filter parse_filter(const CharT* begin, const CharT* end) typedef CharT char_type; typedef log::aux::encoding_specific< typename log::aux::encoding< char_type >::type > encoding_specific; - filter_grammar< char_type > gram; + filter_parser< char_type > parser; const char_type* p = begin; BOOST_LOG_EXPR_IF_MT(filters_repository< CharT >& repo = filters_repository< CharT >::get();) BOOST_LOG_EXPR_IF_MT(log::aux::shared_lock_guard< log::aux::light_rw_mutex > lock(repo.m_Mutex);) - bool result = qi::phrase_parse(p, end, gram, encoding_specific::space); - if (!result || p != end) - { - std::ostringstream strm; - strm << "Could not parse the filter, parsing stopped at position " << p - begin; - BOOST_LOG_THROW_DESCR(parse_error, strm.str()); - } + parser.parse(p, end); - return gram.get_filter(); + return parser.get_filter(); } #ifdef BOOST_LOG_USE_CHAR diff --git a/src/format_parser.cpp b/src/format_parser.cpp index 471f1f8..ddcce43 100644 --- a/src/format_parser.cpp +++ b/src/format_parser.cpp @@ -10,7 +10,7 @@ * \date 16.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/formatter_parser.cpp b/src/formatter_parser.cpp index 5d4b4bf..bac906e 100644 --- a/src/formatter_parser.cpp +++ b/src/formatter_parser.cpp @@ -10,12 +10,11 @@ * \date 07.04.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS -#include #include #include #include @@ -26,14 +25,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -56,8 +47,6 @@ #endif #include -namespace qi = boost::spirit::qi; - namespace boost { BOOST_LOG_OPEN_NAMESPACE @@ -161,18 +150,16 @@ private: //! Formatter parsing grammar template< typename CharT > -class formatter_grammar : - public qi::grammar< const CharT* > +class formatter_parser { private: typedef CharT char_type; typedef const char_type* iterator_type; - typedef qi::grammar< iterator_type > base_type; - typedef typename base_type::start_type rule_type; typedef std::basic_string< char_type > string_type; typedef basic_formatter< char_type > formatter_type; typedef boost::log::aux::char_constants< char_type > constants; - typedef log::aux::encoding_specific< typename log::aux::encoding< char_type >::type > encoding_specific; + typedef typename log::aux::encoding< char_type >::type encoding; + typedef log::aux::encoding_specific< encoding > encoding_specific; typedef formatter_factory< char_type > formatter_factory_type; typedef typename formatter_factory_type::args_map args_map; @@ -190,88 +177,74 @@ private: //! Argument value mutable string_type m_ArgValue; - //! A parser for a quoted string argument value - rule_type quoted_string_arg_value; - //! A parser for an argument value - rule_type arg_value; - //! A parser for a named argument - rule_type arg; - //! A parser for an optional argument list for a formatter - rule_type arg_list; - //! A parser for an attribute placeholder - rule_type attr_name; - //! A parser for the complete formatter expression - rule_type expression; - public: //! Constructor - formatter_grammar() : - base_type(expression) + formatter_parser() { - quoted_string_arg_value = qi::raw - [ - // A quoted string with C-style escape sequences support - qi::lit(constants::char_quote) >> - *( - (qi::lit(constants::char_backslash) >> qi::char_) | - (qi::char_ - qi::lit(constants::char_quote)) - ) >> - qi::lit(constants::char_quote) - ] - [boost::bind(&formatter_grammar::on_quoted_string_arg_value, this, _1)]; + } - arg_value = - ( - quoted_string_arg_value | - qi::raw[ *(encoding_specific::graph - constants::char_comma - constants::char_paren_bracket_left - constants::char_paren_bracket_right) ] - [boost::bind(&formatter_grammar::on_arg_value, this, _1)] - ); + //! Parses formatter + void parse(iterator_type& begin, iterator_type end) + { + iterator_type p = begin; - arg = - ( - *encoding_specific::space >> - qi::raw[ encoding_specific::alpha >> *encoding_specific::alnum ][boost::bind(&formatter_grammar::on_arg_name, this, _1)] >> - *encoding_specific::space >> - constants::char_equal >> - *encoding_specific::space >> - arg_value >> - *encoding_specific::space - ); + while (p != end) + { + // Find the end of a string literal + iterator_type start = p; + for (; p != end; ++p) + { + char_type c = *p; + if (c == constants::char_backslash) + { + // We found an escaped character + ++p; + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid escape sequence in the formatter string"); + } + else if (c == constants::char_percent) + { + // We found an attribute + break; + } + } - arg_list = - ( - qi::lit(constants::char_paren_bracket_left) >> - (arg[boost::bind(&formatter_grammar::push_arg, this)] % qi::lit(constants::char_comma)) >> - qi::lit(constants::char_paren_bracket_right) - ); + if (start != p) + push_string(start, p); - attr_name = - ( - qi::lit(constants::char_percent) >> - ( - qi::raw[ qi::lit(constants::message_text_keyword()) ] - [boost::bind(&formatter_grammar::on_attr_name, this, _1)] | - ( - qi::raw[ +(encoding_specific::print - constants::char_paren_bracket_left - constants::char_percent) ] - [boost::bind(&formatter_grammar::on_attr_name, this, _1)] >> - -arg_list - ) - ) >> - qi::lit(constants::char_percent) - ) - [boost::bind(&formatter_grammar::push_attr, this)]; + if (p != end) + { + // We found an attribute placeholder + iterator_type start = constants::trim_spaces_left(++p, end); + p = constants::scan_attr_placeholder(start, end); + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder in the formatter string"); - expression = - ( - qi::raw - [ - *( - (qi::lit(constants::char_backslash) >> qi::char_) | - (qi::char_ - qi::lit(constants::char_quote) - qi::lit(constants::char_percent)) - ) - ][boost::bind(&formatter_grammar::push_string, this, _1)] % - attr_name - ); + on_attribute_name(start, p); + + p = constants::trim_spaces_left(p, end); + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder in the formatter string"); + + if (*p == constants::char_paren_bracket_left) + { + // We found formatter arguments + p = parse_args(constants::trim_spaces_left(++p, end), end); + p = constants::trim_spaces_left(p, end); + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder in the formatter string"); + } + + if (*p != constants::char_percent) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder in the formatter string"); + + ++p; + + push_attr(); + } + } + + begin = p; } //! Returns the parsed formatter @@ -287,23 +260,79 @@ public: } private: + //! The method parses formatter arguments + iterator_type parse_args(iterator_type begin, iterator_type end) + { + iterator_type p = begin; + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder arguments description in the formatter string"); + if (*p == constants::char_paren_bracket_right) + return ++p; + + while (true) + { + char_type c = *p; + + // Read argument name + iterator_type start = p; + if (!encoding::isalpha(*p)) + BOOST_LOG_THROW_DESCR(parse_error, "Placeholder argument name is invalid"); + for (++p; p != end; ++p) + { + c = *p; + if (encoding::isspace(c) || c == constants::char_equal) + break; + if (!encoding::isalnum(c) && c != constants::char_underline) + BOOST_LOG_THROW_DESCR(parse_error, "Placeholder argument name is invalid"); + } + + if (start == p) + BOOST_LOG_THROW_DESCR(parse_error, "Placeholder argument name is empty"); + + on_arg_name(start, p); + + p = constants::trim_spaces_left(p, end); + if (p == end || *p != constants::char_equal) + BOOST_LOG_THROW_DESCR(parse_error, "Placeholder argument description is not valid"); + + // Read argument value + start = p = constants::trim_spaces_left(++p, end); + p = constants::parse_operand(p, end, m_ArgValue); + if (p == start) + BOOST_LOG_THROW_DESCR(parse_error, "Placeholder argument value is not specified"); + + push_arg(); + + p = constants::trim_spaces_left(p, end); + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder arguments description in the formatter string"); + + c = *p; + if (c == constants::char_paren_bracket_right) + { + break; + } + else if (c == constants::char_comma) + { + p = constants::trim_spaces_left(++p, end); + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Placeholder argument name is invalid"); + } + else + { + BOOST_LOG_THROW_DESCR(parse_error, "Invalid attribute placeholder arguments description in the formatter string"); + } + } + + return ++p; + } + //! The method is called when an argument name is discovered - void on_arg_name(iterator_range< iterator_type > const& name) + void on_arg_name(iterator_type begin, iterator_type end) { - m_ArgName.assign(name.begin(), name.end()); - } - //! The method is called when an argument value is discovered - void on_quoted_string_arg_value(iterator_range< iterator_type > const& value) - { - // Cut off the quotes - m_ArgValue.assign(value.begin() + 1, value.end() - 1); - constants::translate_escape_sequences(m_ArgValue); - } - //! The method is called when an argument value is discovered - void on_arg_value(iterator_range< iterator_type > const& value) - { - m_ArgValue.assign(value.begin(), value.end()); + m_ArgName.assign(begin, end); } + //! The method is called when an argument is filled void push_arg() { @@ -313,16 +342,22 @@ private: } //! The method is called when an attribute name is discovered - void on_attr_name(iterator_range< iterator_type > const& name) + void on_attribute_name(iterator_type begin, iterator_type end) { - if (name.empty()) + if (begin == end) BOOST_LOG_THROW_DESCR(parse_error, "Empty attribute name encountered"); // For compatibility with Boost.Log v1 we recognize %_% as the message attribute name - if (std::char_traits< char_type >::compare(constants::message_text_keyword(), name.begin(), name.size()) == 0) + const std::size_t len = end - begin; + if (std::char_traits< char_type >::length(constants::message_text_keyword()) == len && + std::char_traits< char_type >::compare(constants::message_text_keyword(), begin, len) == 0) + { m_AttrName = log::aux::default_attribute_names::message(); + } else - m_AttrName = attribute_name(log::aux::to_narrow(string_type(name.begin(), name.end()))); + { + m_AttrName = attribute_name(log::aux::to_narrow(string_type(begin, end))); + } } //! The method is called when an attribute is filled void push_attr() @@ -348,14 +383,11 @@ private: } //! The method is called when a string literal is discovered - void push_string(iterator_range< iterator_type > const& str) + void push_string(iterator_type begin, iterator_type end) { - if (!str.empty()) - { - string_type s(str.begin(), str.end()); - constants::translate_escape_sequences(s); - append_formatter(expressions::stream << s); - } + string_type s(begin, end); + constants::translate_escape_sequences(s); + append_formatter(expressions::stream << s); } //! The method appends a formatter part to the final formatter @@ -369,8 +401,8 @@ private: } // Assignment and copying are prohibited - BOOST_LOG_DELETED_FUNCTION(formatter_grammar(formatter_grammar const&)) - BOOST_LOG_DELETED_FUNCTION(formatter_grammar& operator= (formatter_grammar const&)) + BOOST_DELETED_FUNCTION(formatter_parser(formatter_parser const&)) + BOOST_DELETED_FUNCTION(formatter_parser& operator= (formatter_parser const&)) }; } // namespace @@ -383,7 +415,7 @@ void register_formatter_factory(attribute_name const& name, shared_ptr< formatte BOOST_ASSERT(!!factory); formatters_repository< CharT >& repo = formatters_repository< CharT >::get(); - BOOST_LOG_EXPR_IF_MT(log::aux::exclusive_lock_guard< log::aux::light_rw_mutex > _(repo.m_Mutex);) + BOOST_LOG_EXPR_IF_MT(log::aux::exclusive_lock_guard< log::aux::light_rw_mutex > lock(repo.m_Mutex);) repo.m_Map[name] = factory; } @@ -393,21 +425,15 @@ basic_formatter< CharT > parse_formatter(const CharT* begin, const CharT* end) { typedef CharT char_type; - formatter_grammar< char_type > gram; + formatter_parser< char_type > parser; const char_type* p = begin; BOOST_LOG_EXPR_IF_MT(formatters_repository< CharT >& repo = formatters_repository< CharT >::get();) - BOOST_LOG_EXPR_IF_MT(log::aux::shared_lock_guard< log::aux::light_rw_mutex > _(repo.m_Mutex);) + BOOST_LOG_EXPR_IF_MT(log::aux::shared_lock_guard< log::aux::light_rw_mutex > lock(repo.m_Mutex);) - bool result = qi::parse(p, end, gram); - if (!result || p != end) - { - std::ostringstream strm; - strm << "Could not parse the formatter, parsing stopped at position " << p - begin; - BOOST_LOG_THROW_DESCR(parse_error, strm.str()); - } + parser.parse(p, end); - return gram.get_formatter(); + return parser.get_formatter(); } #ifdef BOOST_LOG_USE_CHAR diff --git a/src/global_logger_storage.cpp b/src/global_logger_storage.cpp index 6e7a2eb..211adf1 100644 --- a/src/global_logger_storage.cpp +++ b/src/global_logger_storage.cpp @@ -10,7 +10,7 @@ * \date 21.04.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/init_from_settings.cpp b/src/init_from_settings.cpp index fac36cb..f4492f2 100644 --- a/src/init_from_settings.cpp +++ b/src/init_from_settings.cpp @@ -10,7 +10,7 @@ * \date 11.10.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS diff --git a/src/init_from_stream.cpp b/src/init_from_stream.cpp index a18bbb4..6a2e72b 100644 --- a/src/init_from_stream.cpp +++ b/src/init_from_stream.cpp @@ -10,7 +10,7 @@ * \date 22.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS diff --git a/src/light_rw_mutex.cpp b/src/light_rw_mutex.cpp index 0567cf6..55c2bb1 100644 --- a/src/light_rw_mutex.cpp +++ b/src/light_rw_mutex.cpp @@ -10,7 +10,7 @@ * \date 19.06.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ // This first include is to ensure that __MSVCRT_VERSION__ is defined properly diff --git a/src/matches_relation_factory.cpp b/src/matches_relation_factory.cpp new file mode 100644 index 0000000..b3e16dc --- /dev/null +++ b/src/matches_relation_factory.cpp @@ -0,0 +1,157 @@ +/* + * Copyright Andrey Semashev 2007 - 2013. + * 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 matches_relation_factory.hpp + * \author Andrey Semashev + * \date 03.08.2013 + * + * \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. + */ + +#if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) + +#include +#include +#include +#include +#include +#include +#include +#if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) +#include +#include +#include +#endif +#include "default_filter_factory.hpp" +#include + +namespace boost { + +BOOST_LOG_OPEN_NAMESPACE + +namespace aux { + +BOOST_LOG_ANONYMOUS_NAMESPACE { + +#if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) + +//! A special filtering predicate that adopts the string operand to the attribute value character type +struct matches_predicate : + public matches_fun +{ + template< typename CharT > + struct initializer + { + typedef void result_type; + typedef CharT char_type; + typedef std::basic_string< char_type > string_type; + + explicit initializer(string_type const& val) : m_initializer(val) + { + } + + template< typename T > + result_type operator() (T& val) const + { + try + { + typedef typename T::char_type target_char_type; + std::basic_string< target_char_type > str; + log::aux::code_convert(m_initializer, str); + val = T::compile(str.c_str(), str.size(), T::ECMAScript | T::optimize); + } + catch (...) + { + } + } + + private: + string_type const& m_initializer; + }; + + typedef matches_fun::result_type result_type; + + template< typename CharT > + explicit matches_predicate(std::basic_string< CharT > const& operand) + { + fusion::for_each(m_operands, initializer< CharT >(operand)); + } + + template< typename T > + result_type operator() (T const& val) const + { + typedef typename T::value_type char_type; + typedef xpressive::basic_regex< const char_type* > regex_type; + return matches_fun::operator() (val, fusion::at_key< regex_type >(m_operands)); + } + +private: + fusion::set< xpressive::cregex, xpressive::wcregex > m_operands; +}; + +#else + +//! A special filtering predicate that adopts the string operand to the attribute value character type +template< typename CharT > +struct matches_predicate : + public matches_fun +{ + typedef typename matches_fun::result_type result_type; + typedef CharT char_type; + typedef std::basic_string< char_type > string_type; + typedef xpressive::basic_regex< const char_type* > regex_type; + + explicit matches_predicate(string_type const& operand) : + m_operand(regex_type::compile(operand.c_str(), operand.size(), regex_type::ECMAScript | regex_type::optimize)) + { + } + + template< typename T > + result_type operator() (T const& val) const + { + return matches_fun::operator() (val, m_operand); + } + +private: + regex_type m_operand; +}; + +#endif + +} // namespace + +//! The function parses the "matches" relation +template< typename CharT > +filter parse_matches_relation(attribute_name const& name, std::basic_string< CharT > const& operand) +{ +#if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) + return predicate_wrapper< log::string_types::type, matches_predicate >(name, matches_predicate(operand)); +#else + return predicate_wrapper< std::basic_string< CharT >, matches_predicate< CharT > >(name, matches_predicate< CharT >(operand)); +#endif +} + +// Explicitly instantiate factory implementation +#ifdef BOOST_LOG_USE_CHAR +template +filter parse_matches_relation< char >(attribute_name const& name, std::basic_string< char > const& operand); +#endif +#ifdef BOOST_LOG_USE_WCHAR_T +template +filter parse_matches_relation< wchar_t >(attribute_name const& name, std::basic_string< wchar_t > const& operand); +#endif + +} // namespace aux + +BOOST_LOG_CLOSE_NAMESPACE // namespace log + +} // namespace boost + +#include + +#endif // !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) diff --git a/src/named_scope.cpp b/src/named_scope.cpp index c46b2c4..0941183 100644 --- a/src/named_scope.cpp +++ b/src/named_scope.cpp @@ -10,7 +10,7 @@ * \date 24.06.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include @@ -50,7 +50,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { public: //! The method pushes the scope to the back of the list - BOOST_LOG_FORCEINLINE void push_back(const_reference entry) BOOST_NOEXCEPT + BOOST_FORCEINLINE void push_back(const_reference entry) BOOST_NOEXCEPT { register aux::named_scope_list_node* top = this->m_RootNode._m_pPrev; entry._m_pPrev = top; @@ -64,7 +64,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { ++this->m_Size; } //! The method removes the top scope entry from the list - BOOST_LOG_FORCEINLINE void pop_back() BOOST_NOEXCEPT + BOOST_FORCEINLINE void pop_back() BOOST_NOEXCEPT { register aux::named_scope_list_node* top = this->m_RootNode._m_pPrev; top->_m_pPrev->_m_pNext = top->_m_pNext; @@ -126,7 +126,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { } // namespace //! Named scope attribute implementation -struct BOOST_LOG_VISIBLE named_scope::impl : +struct BOOST_SYMBOL_VISIBLE named_scope::impl : public attribute::impl, public log::aux::singleton< impl, diff --git a/src/named_scope_format_parser.cpp b/src/named_scope_format_parser.cpp index f503d4a..6d05c6c 100644 --- a/src/named_scope_format_parser.cpp +++ b/src/named_scope_format_parser.cpp @@ -10,7 +10,7 @@ * \date 14.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include @@ -113,7 +113,7 @@ private: formatters m_formatters; public: - BOOST_LOG_DEFAULTED_FUNCTION(named_scope_formatter(), {}) + BOOST_DEFAULTED_FUNCTION(named_scope_formatter(), {}) named_scope_formatter(named_scope_formatter const& that) : m_formatters(that.m_formatters) {} named_scope_formatter(BOOST_RV_REF(named_scope_formatter) that) { m_formatters.swap(that.m_formatters); } diff --git a/src/once_block.cpp b/src/once_block.cpp index f8bd64f..1c5a934 100644 --- a/src/once_block.cpp +++ b/src/once_block.cpp @@ -10,7 +10,7 @@ * \date 23.06.2010 * * \brief This file is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. * * The code in this file is based on the \c call_once function implementation in Boost.Thread. */ diff --git a/src/parser_utils.cpp b/src/parser_utils.cpp index 67e14ac..e86ae08 100644 --- a/src/parser_utils.cpp +++ b/src/parser_utils.cpp @@ -10,15 +10,20 @@ * \date 31.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS +#include #include #include +#include #include "parser_utils.hpp" #include +#ifdef BOOST_LOG_USE_WCHAR_T +#include +#endif namespace boost { @@ -32,6 +37,7 @@ namespace aux { const char_constants< char >::char_type char_constants< char >::char_comment; const char_constants< char >::char_type char_constants< char >::char_comma; +const char_constants< char >::char_type char_constants< char >::char_dot; const char_constants< char >::char_type char_constants< char >::char_quote; const char_constants< char >::char_type char_constants< char >::char_percent; const char_constants< char >::char_type char_constants< char >::char_exclamation; @@ -49,11 +55,98 @@ const char_constants< char >::char_type char_constants< char >::char_paren_brack #endif // BOOST_LOG_BROKEN_STATIC_CONSTANTS_LINKAGE -void char_constants< char >::translate_escape_sequences(std::basic_string< char_type >& str) +//! Skips spaces in the beginning of the input +const char* char_constants< char >::trim_spaces_left(const char_type* begin, const char_type* end) +{ + using namespace std; + while (begin != end && isspace(*begin)) + ++begin; + return begin; +} + +//! Skips spaces in the end of the input +const char* char_constants< char >::trim_spaces_right(const char_type* begin, const char_type* end) +{ + using namespace std; + while (begin != end && isspace(*(end - 1))) + --end; + return end; +} + +//! Scans for the attribute name placeholder in the input +const char* char_constants< char >::scan_attr_placeholder(const char_type* begin, const char_type* end) +{ + using namespace std; + while (begin != end) + { + char_type c = *begin; + if (!isalnum(c) && c != char_underline) + break; + ++begin; + } + + return begin; +} + +//! Parses an operand string (possibly quoted) from the input +const char* char_constants< char >::parse_operand(const char_type* begin, const char_type* end, string_type& operand) { using namespace std; // to make sure we can use C functions unqualified - std::basic_string< char_type >::iterator it = str.begin(); + const char_type* p = begin; + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Operand value is empty"); + + char_type c = *p; + if (c == char_quote) + { + // The value is specified as a quoted string + const char_type* start = ++p; + for (; p != end; ++p) + { + c = *p; + if (c == char_quote) + { + break; + } + else if (c == char_backslash) + { + ++p; + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid escape sequence in the argument value"); + } + } + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Unterminated quoted string in the argument value"); + + operand.assign(start, p); + translate_escape_sequences(operand); + + ++p; // skip the closing quote + } + else + { + // The value is specified as a single word + const char_type* start = p; + for (++p; p != end; ++p) + { + c = *p; + if (!isalnum(c) && c != '_' && c != '-' && c != '+' && c != '.') + break; + } + + operand.assign(start, p); + } + + return p; +} + +//! Converts escape sequences to the corresponding characters +void char_constants< char >::translate_escape_sequences(string_type& str) +{ + using namespace std; // to make sure we can use C functions unqualified + + string_type::iterator it = str.begin(); while (it != str.end()) { it = std::find(it, str.end(), '\\'); @@ -76,7 +169,7 @@ void char_constants< char >::translate_escape_sequences(std::basic_string< char_ *it = '\b'; break; case 'x': { - std::basic_string< char_type >::iterator b = it; + string_type::iterator b = it; if (std::distance(++b, str.end()) >= 2) { char_type c1 = *b++, c2 = *b++; @@ -92,7 +185,7 @@ void char_constants< char >::translate_escape_sequences(std::basic_string< char_ { if (*it >= '0' && *it <= '7') { - std::basic_string< char_type >::iterator b = it; + string_type::iterator b = it; int c = (*b++) - '0'; if (*b >= '0' && *b <= '7') c = c * 8 + (*b++) - '0'; @@ -117,6 +210,7 @@ void char_constants< char >::translate_escape_sequences(std::basic_string< char_ const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_comment; const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_comma; +const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_dot; const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_quote; const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_percent; const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_exclamation; @@ -134,9 +228,98 @@ const char_constants< wchar_t >::char_type char_constants< wchar_t >::char_paren #endif // BOOST_LOG_BROKEN_STATIC_CONSTANTS_LINKAGE -void char_constants< wchar_t >::translate_escape_sequences(std::basic_string< char_type >& str) +//! Skips spaces in the beginning of the input +const wchar_t* char_constants< wchar_t >::trim_spaces_left(const char_type* begin, const char_type* end) { - std::basic_string< char_type >::iterator it = str.begin(); + using namespace std; + while (begin != end && iswspace(*begin)) + ++begin; + return begin; +} + +//! Skips spaces in the end of the input +const wchar_t* char_constants< wchar_t >::trim_spaces_right(const char_type* begin, const char_type* end) +{ + using namespace std; + while (begin != end && iswspace(*(end - 1))) + --end; + return end; +} + +//! Scans for the attribute name placeholder in the input +const wchar_t* char_constants< wchar_t >::scan_attr_placeholder(const char_type* begin, const char_type* end) +{ + using namespace std; + while (begin != end) + { + char_type c = *begin; + if (!iswalnum(c) && c != char_underline) + break; + ++begin; + } + + return begin; +} + +//! Parses an operand string (possibly quoted) from the input +const wchar_t* char_constants< wchar_t >::parse_operand(const char_type* begin, const char_type* end, string_type& operand) +{ + using namespace std; // to make sure we can use C functions unqualified + + const char_type* p = begin; + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Operand value is empty"); + + char_type c = *p; + if (c == char_quote) + { + // The value is specified as a quoted string + const char_type* start = ++p; + for (; p != end; ++p) + { + c = *p; + if (c == char_quote) + { + break; + } + else if (c == char_backslash) + { + ++p; + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Invalid escape sequence in the argument value"); + } + } + if (p == end) + BOOST_LOG_THROW_DESCR(parse_error, "Unterminated quoted string in the argument value"); + + operand.assign(start, p); + translate_escape_sequences(operand); + + ++p; // skip the closing quote + } + else + { + // The value is specified as a single word + const char_type* start = p; + for (++p; p != end; ++p) + { + c = *p; + if (!iswalnum(c) && c != L'_' && c != L'-' && c != L'+' && c != L'.') + break; + } + + operand.assign(start, p); + } + + return p; +} + +//! Converts escape sequences to the corresponding characters +void char_constants< wchar_t >::translate_escape_sequences(string_type& str) +{ + using namespace std; // to make sure we can use C functions unqualified + + string_type::iterator it = str.begin(); while (it != str.end()) { it = std::find(it, str.end(), L'\\'); @@ -159,7 +342,7 @@ void char_constants< wchar_t >::translate_escape_sequences(std::basic_string< ch *it = L'\b'; break; case L'x': { - std::basic_string< char_type >::iterator b = it; + string_type::iterator b = it; if (std::distance(++b, str.end()) >= 2) { char_type c1 = *b++, c2 = *b++; @@ -173,7 +356,7 @@ void char_constants< wchar_t >::translate_escape_sequences(std::basic_string< ch } case L'u': { - std::basic_string< char_type >::iterator b = it; + string_type::iterator b = it; if (std::distance(++b, str.end()) >= 4) { char_type c1 = *b++, c2 = *b++, c3 = *b++, c4 = *b++; @@ -191,7 +374,7 @@ void char_constants< wchar_t >::translate_escape_sequences(std::basic_string< ch } case L'U': { - std::basic_string< char_type >::iterator b = it; + string_type::iterator b = it; if (std::distance(++b, str.end()) >= 8) { char_type c1 = *b++, c2 = *b++, c3 = *b++, c4 = *b++; @@ -217,7 +400,7 @@ void char_constants< wchar_t >::translate_escape_sequences(std::basic_string< ch { if (*it >= L'0' && *it <= L'7') { - std::basic_string< char_type >::iterator b = it; + string_type::iterator b = it; int c = (*b++) - L'0'; if (*b >= L'0' && *b <= L'7') c = c * 8 + (*b++) - L'0'; diff --git a/src/parser_utils.hpp b/src/parser_utils.hpp index 301a859..e7f5e61 100644 --- a/src/parser_utils.hpp +++ b/src/parser_utils.hpp @@ -10,7 +10,7 @@ * \date 31.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_PARSER_UTILS_HPP_INCLUDED_ @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -40,8 +40,11 @@ template< > struct char_constants< char > { typedef char char_type; + typedef std::basic_string< char_type > string_type; + static const char_type char_comment = '#'; static const char_type char_comma = ','; + static const char_type char_dot = '.'; static const char_type char_quote = '"'; static const char_type char_percent = '%'; static const char_type char_exclamation = '!'; @@ -147,7 +150,16 @@ struct char_constants< char > return n; } - static void translate_escape_sequences(std::basic_string< char_type >& str); + //! Skips spaces in the beginning of the input + static const char_type* trim_spaces_left(const char_type* begin, const char_type* end); + //! Skips spaces in the end of the input + static const char_type* trim_spaces_right(const char_type* begin, const char_type* end); + //! Scans for the attribute name placeholder in the input + static const char_type* scan_attr_placeholder(const char_type* begin, const char_type* end); + //! Parses an operand string (possibly quoted) from the input + static const char_type* parse_operand(const char_type* begin, const char_type* end, string_type& operand); + //! Converts escape sequences to the corresponding characters + static void translate_escape_sequences(string_type& str); }; #endif @@ -156,8 +168,11 @@ template< > struct char_constants< wchar_t > { typedef wchar_t char_type; + typedef std::basic_string< char_type > string_type; + static const char_type char_comment = L'#'; static const char_type char_comma = L','; + static const char_type char_dot = L'.'; static const char_type char_quote = L'"'; static const char_type char_percent = L'%'; static const char_type char_exclamation = L'!'; @@ -267,7 +282,16 @@ struct char_constants< wchar_t > return (c >= L'0' && c <= L'9') || (c >= L'a' && c <= L'f') || (c >= L'A' && c <= L'F'); } - static void translate_escape_sequences(std::basic_string< char_type >& str); + //! Skips spaces in the beginning of the input + static const char_type* trim_spaces_left(const char_type* begin, const char_type* end); + //! Skips spaces in the end of the input + static const char_type* trim_spaces_right(const char_type* begin, const char_type* end); + //! Scans for the attribute name placeholder in the input + static const char_type* scan_attr_placeholder(const char_type* begin, const char_type* end); + //! Parses an operand string (possibly quoted) from the input + static const char_type* parse_operand(const char_type* begin, const char_type* end, string_type& operand); + //! Converts escape sequences to the corresponding characters + static void translate_escape_sequences(string_type& str); }; #endif diff --git a/src/process_id.cpp b/src/process_id.cpp index fe048db..67700f2 100644 --- a/src/process_id.cpp +++ b/src/process_id.cpp @@ -10,7 +10,7 @@ * \date 12.09.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/process_name.cpp b/src/process_name.cpp index 59117ea..2d9b143 100644 --- a/src/process_name.cpp +++ b/src/process_name.cpp @@ -10,7 +10,7 @@ * \date 29.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. * * The code in this file is based on information on this page: * diff --git a/src/record_ostream.cpp b/src/record_ostream.cpp index 6749a5d..dcc7969 100644 --- a/src/record_ostream.cpp +++ b/src/record_ostream.cpp @@ -10,7 +10,7 @@ * \date 17.04.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/settings_parser.cpp b/src/settings_parser.cpp index bcbfbc1..3df7adb 100644 --- a/src/settings_parser.cpp +++ b/src/settings_parser.cpp @@ -10,62 +10,46 @@ * \date 20.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS #include -#include #include -#include +#include #include -#include -#include +#include #include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include +#include #include "parser_utils.hpp" #include "spirit_encoding.hpp" #include -namespace qi = boost::spirit::qi; - namespace boost { BOOST_LOG_OPEN_NAMESPACE BOOST_LOG_ANONYMOUS_NAMESPACE { -//! Settings parsing grammar +//! Settings parser template< typename CharT > -class settings_grammar : - public qi::grammar< - const CharT*, - typename log::aux::encoding_specific< typename log::aux::encoding< CharT >::type >::space_type - > +class settings_parser { private: typedef CharT char_type; typedef const char_type* iterator_type; - typedef log::aux::encoding_specific< typename log::aux::encoding< char_type >::type > encoding_specific; - typedef settings_grammar< char_type > this_type; - typedef qi::grammar< iterator_type, typename encoding_specific::space_type > base_type; - typedef typename base_type::start_type rule_type; + typedef typename log::aux::encoding< char_type >::type encoding; + typedef settings_parser< char_type > this_type; typedef std::basic_string< char_type > string_type; typedef log::aux::char_constants< char_type > constants; @@ -83,70 +67,101 @@ private: //! Current line number unsigned int& m_LineCounter; - //! A parser for a comment - rule_type comment; - //! A parser for a section name - rule_type section_name; - //! A parser for a quoted string - rule_type quoted_string; - //! A parser for a parameter name and value - rule_type parameter; - //! A parser for a single line - rule_type line; - public: //! Constructor - explicit settings_grammar(settings_type& setts, unsigned int& line_counter, std::locale const& loc) : - base_type(line, "settings_grammar"), + explicit settings_parser(settings_type& setts, unsigned int& line_counter, std::locale const& loc) : m_Settings(setts), m_Locale(loc), m_LineCounter(line_counter) { - comment = qi::lit(constants::char_comment) >> *qi::char_; + } - section_name = - qi::raw[ qi::lit(constants::char_section_bracket_left) >> +(encoding_specific::graph - constants::char_section_bracket_right) >> constants::char_section_bracket_right ] - [boost::bind(&this_type::set_section_name, this, _1)] >> - -comment; + //! Parses a line of the input + void parse_line(iterator_type& begin, iterator_type end) + { + iterator_type p = begin; + p = constants::trim_spaces_left(p, end); + if (p != end) + { + char_type c = *p; + if (c == constants::char_section_bracket_left) + { + // We have a section name + iterator_type start = ++p; + start = constants::trim_spaces_left(start, end); + iterator_type stop = std::find(start, end, constants::char_section_bracket_right); + if (stop == end) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Section header is invalid", (m_LineCounter)); - quoted_string = qi::lexeme - [ - qi::lit(constants::char_quote) >> - *( - (qi::lit(constants::char_backslash) >> qi::char_) | - (qi::char_ - qi::lit(constants::char_quote)) - ) >> - qi::lit(constants::char_quote) - ]; + p = stop + 1; + stop = constants::trim_spaces_right(start, stop); - parameter = - // Parameter name - qi::raw[ qi::lexeme[ encoding_specific::alpha >> *(encoding_specific::graph - constants::char_equal) ] ] - [boost::bind(&this_type::set_parameter_name, this, _1)] >> - qi::lit(constants::char_equal) >> - // Parameter value - ( - qi::raw[ quoted_string ][boost::bind(&this_type::set_parameter_quoted_value, this, _1)] | - qi::raw[ +encoding_specific::graph ][boost::bind(&this_type::set_parameter_value, this, _1)] - ) >> - -comment; + set_section_name(start, stop); + } + else if (c != constants::char_comment) + { + // We have a parameter + iterator_type eq = std::find(p, end, constants::char_equal); + if (eq == end) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameter description is invalid", (m_LineCounter)); - line = (comment | section_name | parameter) >> qi::eoi; + // Parameter name + set_parameter_name(p, constants::trim_spaces_right(p, eq)); + + // Parameter value + p = constants::trim_spaces_left(eq + 1, end); + if (p == end || *p == constants::char_comment) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameter value is not specified", (m_LineCounter)); + + try + { + string_type value; + p = constants::parse_operand(p, end, value); + set_parameter_value(value); + } + catch (parse_error& e) + { + throw boost::enable_error_info(e) << boost::errinfo_at_line(m_LineCounter); + } + } + + // In the end of the line we may have a comment + p = constants::trim_spaces_left(p, end); + if (p != end) + { + c = *p; + if (c == constants::char_comment) + { + // The comment spans until the end of the line + p = end; + } + else + { + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Unexpected characters in the end of the line", (m_LineCounter)); + } + } + } + + begin = p; } private: //! The method sets the parsed section name - void set_section_name(iterator_range< iterator_type > const& sec) + void set_section_name(iterator_type begin, iterator_type end) { - // Trim square brackets - m_SectionName = log::aux::to_narrow(string_type(sec.begin() + 1, sec.end() - 1), m_Locale); - algorithm::trim(m_SectionName, m_Locale); - if (m_SectionName.empty()) + // Check that the section name is valid + if (begin == end) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Section name is empty", (m_LineCounter)); + + for (iterator_type p = begin; p != end; ++p) { - // The section starter is broken - BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "The section header is invalid.", (m_LineCounter)); + char_type c = *p; + if (c != constants::char_dot && !encoding::isalnum(c)) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Section name is invalid", (m_LineCounter)); } + m_SectionName = log::aux::to_narrow(string_type(begin, end), m_Locale); + // For compatibility with Boost.Log v1, we replace the "Sink:" prefix with "Sinks." // so that all sink parameters are placed in the common Sinks section. if (m_SectionName.compare(0, 5, "Sink:") == 0) @@ -154,38 +169,41 @@ private: } //! The method sets the parsed parameter name - void set_parameter_name(iterator_range< iterator_type > const& name) + void set_parameter_name(iterator_type begin, iterator_type end) { if (m_SectionName.empty()) { // The parameter encountered before any section starter - BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameters are only allowed within sections.", (m_LineCounter)); + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameters are only allowed within sections", (m_LineCounter)); } - m_ParameterName = log::aux::to_narrow(string_type(name.begin(), name.end()), m_Locale); + // Check that the parameter name is valid + if (begin == end) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameter name is empty", (m_LineCounter)); + + iterator_type p = begin; + if (!encoding::isalpha(*p)) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameter name is invalid", (m_LineCounter)); + for (++p; p != end; ++p) + { + char_type c = *p; + if (!encoding::isgraph(c)) + BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Parameter name is invalid", (m_LineCounter)); + } + + m_ParameterName = log::aux::to_narrow(string_type(begin, end), m_Locale); } //! The method sets the parsed parameter value (non-quoted) - void set_parameter_value(iterator_range< iterator_type > const& value) + void set_parameter_value(string_type const& value) { - string_type val(value.begin(), value.end()); - m_Settings[m_SectionName][m_ParameterName] = val; - m_ParameterName.clear(); - } - - //! The method sets the parsed parameter value (quoted) - void set_parameter_quoted_value(iterator_range< iterator_type > const& value) - { - // Cut off the quotes - string_type val(value.begin() + 1, value.end() - 1); - constants::translate_escape_sequences(val); - m_Settings[m_SectionName][m_ParameterName] = val; + m_Settings[m_SectionName][m_ParameterName] = value; m_ParameterName.clear(); } // Assignment and copying are prohibited - BOOST_LOG_DELETED_FUNCTION(settings_grammar(settings_grammar const&)) - BOOST_LOG_DELETED_FUNCTION(settings_grammar& operator= (settings_grammar const&)) + BOOST_DELETED_FUNCTION(settings_parser(settings_parser const&)) + BOOST_DELETED_FUNCTION(settings_parser& operator= (settings_parser const&)) }; } // namespace @@ -196,9 +214,8 @@ basic_settings< CharT > parse_settings(std::basic_istream< CharT >& strm) { typedef CharT char_type; typedef std::basic_string< char_type > string_type; - typedef settings_grammar< char_type > settings_grammar_type; + typedef settings_parser< char_type > settings_parser_type; typedef basic_settings< char_type > settings_type; - typedef log::aux::encoding_specific< typename log::aux::encoding< char_type >::type > encoding_specific; if (!strm.good()) BOOST_THROW_EXCEPTION(std::invalid_argument("The input stream for parsing settings is not valid")); @@ -209,23 +226,17 @@ basic_settings< CharT > parse_settings(std::basic_istream< CharT >& strm) settings_type settings; unsigned int line_number = 1; std::locale loc = strm.getloc(); - settings_grammar_type gram(settings, line_number, loc); + settings_parser_type parser(settings, line_number, loc); string_type line; while (!strm.eof()) { std::getline(strm, line); - algorithm::trim(line, loc); - if (!line.empty()) - { - if (!qi::phrase_parse(line.c_str(), line.c_str() + line.size(), gram, encoding_specific::space)) - { - BOOST_LOG_THROW_DESCR_PARAMS(parse_error, "Could not parse settings from stream.", (line_number)); - } - line.clear(); - } + const char_type* p = line.c_str(); + parser.parse_line(p, p + line.size()); + line.clear(); ++line_number; } diff --git a/src/severity_level.cpp b/src/severity_level.cpp index accc896..4bea650 100644 --- a/src/severity_level.cpp +++ b/src/severity_level.cpp @@ -10,7 +10,7 @@ * \date 10.05.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/spirit_encoding.cpp b/src/spirit_encoding.cpp index 1c22c19..05c94aa 100644 --- a/src/spirit_encoding.cpp +++ b/src/spirit_encoding.cpp @@ -10,7 +10,7 @@ * \date 20.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/spirit_encoding.hpp b/src/spirit_encoding.hpp index d7eb09b..cf66661 100644 --- a/src/spirit_encoding.hpp +++ b/src/spirit_encoding.hpp @@ -10,7 +10,7 @@ * \date 20.07.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_SPIRIT_ENCODING_HPP_INCLUDED_ @@ -24,7 +24,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/src/stateless_allocator.hpp b/src/stateless_allocator.hpp index 5f0c6d7..5e457ef 100644 --- a/src/stateless_allocator.hpp +++ b/src/stateless_allocator.hpp @@ -10,7 +10,7 @@ * \date 11.02.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_STATELESS_ALLOCATOR_HPP_INCLUDED_ @@ -22,7 +22,7 @@ #include #include -#ifdef BOOST_LOG_HAS_PRAGMA_ONCE +#ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif diff --git a/src/syslog_backend.cpp b/src/syslog_backend.cpp index ebd746e..489191b 100644 --- a/src/syslog_backend.cpp +++ b/src/syslog_backend.cpp @@ -10,7 +10,7 @@ * \date 08.01.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WITHOUT_SYSLOG diff --git a/src/text_file_backend.cpp b/src/text_file_backend.cpp index a6cb769..3d025dc 100644 --- a/src/text_file_backend.cpp +++ b/src/text_file_backend.cpp @@ -10,7 +10,7 @@ * \date 09.06.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/text_ostream_backend.cpp b/src/text_ostream_backend.cpp index 875c532..395f7c0 100644 --- a/src/text_ostream_backend.cpp +++ b/src/text_ostream_backend.cpp @@ -10,7 +10,7 @@ * \date 19.04.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/thread_id.cpp b/src/thread_id.cpp index 9722de1..baee88e 100644 --- a/src/thread_id.cpp +++ b/src/thread_id.cpp @@ -10,7 +10,7 @@ * \date 08.1.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/thread_specific.cpp b/src/thread_specific.cpp index ec1ca3b..355867f 100644 --- a/src/thread_specific.cpp +++ b/src/thread_specific.cpp @@ -10,7 +10,7 @@ * \date 01.03.2008 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/threadsafe_queue.cpp b/src/threadsafe_queue.cpp index 9734261..4d27e03 100644 --- a/src/threadsafe_queue.cpp +++ b/src/threadsafe_queue.cpp @@ -10,7 +10,7 @@ * \date 05.11.2010 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. * * The implementation is based on algorithms published in the "Simple, Fast, * and Practical Non-Blocking and Blocking Concurrent Queue Algorithms" article @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -53,7 +52,7 @@ private: * A structure that contains a pointer to the node and the associated mutex. * The alignment below allows to eliminate false sharing, it should not be less than CPU cache line size. */ - struct BOOST_LOG_ALIGNAS(BOOST_LOG_CPU_CACHE_LINE_SIZE) pointer + struct BOOST_ALIGNMENT(BOOST_LOG_CPU_CACHE_LINE_SIZE) pointer { //! Pointer to the either end of the queue node_base* node; @@ -121,11 +120,11 @@ private: threadsafe_queue_impl_generic(threadsafe_queue_impl_generic const&); threadsafe_queue_impl_generic& operator= (threadsafe_queue_impl_generic const&); - BOOST_LOG_FORCEINLINE static void set_next(node_base* p, node_base* next) + BOOST_FORCEINLINE static void set_next(node_base* p, node_base* next) { p->next.data[0] = next; } - BOOST_LOG_FORCEINLINE static node_base* get_next(node_base* p) + BOOST_FORCEINLINE static node_base* get_next(node_base* p) { return static_cast< node_base* >(p->next.data[0]); } diff --git a/src/timer.cpp b/src/timer.cpp index dd02a4b..ff6a960 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -10,7 +10,7 @@ * \date 02.12.2007 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include @@ -20,12 +20,13 @@ #if defined(BOOST_WINDOWS) && !defined(BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER) #include "windows_version.hpp" -#include #include #include -#include +#include +#if !defined(BOOST_LOG_NO_THREADS) #include -#include +#include +#endif #include #include @@ -36,18 +37,18 @@ BOOST_LOG_OPEN_NAMESPACE namespace attributes { //! Factory implementation -class BOOST_LOG_VISIBLE timer::impl : +class BOOST_SYMBOL_VISIBLE timer::impl : public attribute::impl { private: #if !defined(BOOST_LOG_NO_THREADS) //! Synchronization mutex type - typedef log::aux::spin_mutex mutex_type; + typedef boost::mutex mutex_type; //! Synchronization mutex mutex_type m_Mutex; #endif //! Frequency factor for calculating duration - uint64_t m_FrequencyFactor; + double m_FrequencyFactor; //! Last value of the performance counter uint64_t m_LastCounter; //! Elapsed time duration, in microseconds @@ -60,7 +61,7 @@ public: LARGE_INTEGER li; QueryPerformanceFrequency(&li); BOOST_ASSERT(li.QuadPart != 0LL); - m_FrequencyFactor = static_cast< uint64_t >(li.QuadPart) / 1000000ULL; + m_FrequencyFactor = 1000000.0 / static_cast< double >(li.QuadPart); QueryPerformanceCounter(&li); m_LastCounter = static_cast< uint64_t >(li.QuadPart); @@ -69,43 +70,20 @@ public: //! The method returns the actual attribute value. It must not return NULL. attribute_value get_value() { - LARGE_INTEGER li; - QueryPerformanceCounter(&li); - uint64_t duration; { - BOOST_LOG_EXPR_IF_MT(log::aux::exclusive_lock_guard< mutex_type > _(m_Mutex);) + BOOST_LOG_EXPR_IF_MT(log::aux::exclusive_lock_guard< mutex_type > lock(m_Mutex);) - const uint64_t counts = static_cast< uint64_t >(li.QuadPart) - m_LastCounter; - m_LastCounter = static_cast< uint64_t >(li.QuadPart); - m_Duration += counts / m_FrequencyFactor; - duration = m_Duration; + LARGE_INTEGER li; + QueryPerformanceCounter(&li); + const uint64_t counter = static_cast< uint64_t >(li.QuadPart); + const uint64_t counts = counter - m_LastCounter; + m_LastCounter = counter; + duration = m_Duration + static_cast< uint64_t >(counts * m_FrequencyFactor); + m_Duration = duration; } - // All these dances are needed simply to construct Boost.DateTime duration without truncating the value - value_type res; - if (duration < static_cast< uint64_t >((std::numeric_limits< value_type::fractional_seconds_type >::max)())) - { - res = value_type(0, 0, 0, static_cast< value_type::fractional_seconds_type >( - duration * (1000000 / value_type::traits_type::ticks_per_second))); - } - else - { - uint64_t total_seconds = duration / 1000000ULL; - value_type::fractional_seconds_type usec = static_cast< value_type::fractional_seconds_type >(duration % 1000000ULL); - if (total_seconds < static_cast< uint64_t >((std::numeric_limits< value_type::sec_type >::max)())) - { - res = value_type(0, 0, static_cast< value_type::sec_type >(total_seconds), usec); - } - else - { - uint64_t total_hours = total_seconds / 3600ULL; - value_type::sec_type seconds = static_cast< value_type::sec_type >(total_seconds % 3600ULL); - res = value_type(static_cast< value_type::hour_type >(total_hours), 0, seconds, usec); - } - } - - return attribute_value(new attribute_value_impl< value_type >(res)); + return attribute_value(new attribute_value_impl< value_type >(boost::posix_time::microseconds(duration))); } }; @@ -138,7 +116,7 @@ BOOST_LOG_OPEN_NAMESPACE namespace attributes { //! Factory implementation -class BOOST_LOG_VISIBLE timer::impl : +class BOOST_SYMBOL_VISIBLE timer::impl : public attribute::impl { public: diff --git a/src/timestamp.cpp b/src/timestamp.cpp index 4365da2..f715b63 100644 --- a/src/timestamp.cpp +++ b/src/timestamp.cpp @@ -10,13 +10,12 @@ * \date 31.07.2011 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include #if defined(BOOST_WINDOWS) && !defined(__CYGWIN__) -#include #include #include "windows_version.hpp" #include @@ -57,7 +56,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { # if defined(_M_IX86) # if defined(_M_IX86_FP) && _M_IX86_FP >= 2 //! Atomically loads and stores the 64-bit value through SSE2 instructions -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { __asm { @@ -69,7 +68,7 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) } # else // defined(_M_IX86_FP) && _M_IX86_FP >= 2 //! Atomically loads and stores the 64-bit value through FPU instructions -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { __asm { @@ -82,7 +81,7 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) # endif // defined(_M_IX86_FP) && _M_IX86_FP >= 2 # elif defined(_M_AMD64) || defined(_M_IA64) //! Atomically loads and stores the 64-bit value -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { *to = *from; } @@ -95,7 +94,7 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) # if defined(__i386__) # if defined(__SSE2__) //! Atomically loads and stores the 64-bit value through SSE2 instructions -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { __asm__ __volatile__ ( @@ -108,7 +107,7 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) } # else // defined(__SSE2__) //! Atomically loads and stores the 64-bit value through FPU instructions -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { __asm__ __volatile__ ( @@ -122,7 +121,7 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) # endif // defined(__SSE2__) # elif defined(__x86_64__) //! Atomically loads and stores the 64-bit value -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { *to = *from; } @@ -138,10 +137,10 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) #if defined(BOOST_LOG_GENERIC_MOVE64) -BOOST_LOG_ALIGNAS(16) long g_spin_lock = 0; +BOOST_ALIGNMENT(16) long g_spin_lock = 0; //! Atomically loads and stores the 64-bit value -BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) +BOOST_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) { while (BOOST_INTERLOCKED_COMPARE_EXCHANGE(&g_spin_lock, 1, 0) != 0); *to = *from; @@ -150,7 +149,7 @@ BOOST_LOG_FORCEINLINE void move64(const uint64_t* from, uint64_t* to) #endif // defined(BOOST_LOG_GENERIC_MOVE64) -BOOST_LOG_ALIGNAS(16) uint64_t g_ticks = 0; +BOOST_ALIGNMENT(16) uint64_t g_ticks = 0; union ticks_caster { @@ -223,8 +222,9 @@ timestamp get_timestamp_realtime_clock() timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts) != 0) { + const int err = errno; BOOST_THROW_EXCEPTION(boost::system::system_error( - errno, boost::system::system_category(), "Failed to acquire current time")); + err, boost::system::system_category(), "Failed to acquire current time")); } return timestamp(static_cast< uint64_t >(ts.tv_sec) * 1000000000ULL + ts.tv_nsec); @@ -238,7 +238,7 @@ timestamp get_timestamp_monotonic_clock() timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { - int err = errno; + const int err = errno; if (err == EINVAL) { // The current platform does not support monotonic timer. diff --git a/src/trivial.cpp b/src/trivial.cpp index 1087be6..b60ebd6 100644 --- a/src/trivial.cpp +++ b/src/trivial.cpp @@ -10,7 +10,7 @@ * \date 07.11.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #include diff --git a/src/unhandled_exception_count.cpp b/src/unhandled_exception_count.cpp index 012c85b..882dd32 100644 --- a/src/unhandled_exception_count.cpp +++ b/src/unhandled_exception_count.cpp @@ -10,7 +10,7 @@ * \date 05.11.2012 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. * * The code in this file is based on the implementation by Evgeny Panasyuk: * diff --git a/src/windows_version.hpp b/src/windows_version.hpp index 03dff3d..922e57d 100644 --- a/src/windows_version.hpp +++ b/src/windows_version.hpp @@ -10,7 +10,7 @@ * \date 07.03.2009 * * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/libs/log/doc/log.html. + * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_WINDOWS_VERSION_HPP_INCLUDED_ diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 1a2a883..5052a0a 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -21,6 +21,7 @@ project intel-win:_CRT_SECURE_NO_DEPRECATE gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log + /boost/log//boost_log_setup /boost/date_time//boost_date_time /boost/regex//boost_regex /boost/filesystem//boost_filesystem diff --git a/test/run/setup_filter_parser.cpp b/test/run/setup_filter_parser.cpp new file mode 100644 index 0000000..46d5d82 --- /dev/null +++ b/test/run/setup_filter_parser.cpp @@ -0,0 +1,794 @@ +/* + * Copyright Andrey Semashev 2007 - 2013. + * 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 setup_filter_parser.cpp + * \author Andrey Semashev + * \date 24.08.2013 + * + * \brief This header contains tests for the filter parser. + */ + +#define BOOST_TEST_MODULE setup_filter_parser + +#include +#include +#include + +#if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) + +#include +#include +#include +#include +#include +#include + +namespace logging = boost::log; +namespace attrs = logging::attributes; + +typedef logging::attribute_set attr_set; +typedef logging::attribute_value_set attr_values; + +// Tests for attribute presence check +BOOST_AUTO_TEST_CASE(attr_presence) +{ + attrs::constant< int > attr1(10); + attr_set set1, set2, set3; + + attr_values values1(set1, set2, set3); + values1.freeze(); + + set1["MyAttr"] = attr1; + attr_values values2(set1, set2, set3); + values2.freeze(); + + { + logging::filter f = logging::parse_filter("%MyAttr%"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + { + logging::filter f = logging::parse_filter(" % MyAttr % "); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } +} + +// Tests for integer relation filter +BOOST_AUTO_TEST_CASE(int_relation) +{ + attrs::constant< int > attr1(10); + attrs::constant< long > attr2(20); + attrs::constant< int > attr3(-2); + attr_set set1, set2, set3; + + attr_values values1(set1, set2, set3); + values1.freeze(); + + set1["MyAttr"] = attr1; + attr_values values2(set1, set2, set3); + values2.freeze(); + + set1["MyAttr"] = attr2; + attr_values values3(set1, set2, set3); + values3.freeze(); + + set1["MyAttr"] = attr3; + attr_values values4(set1, set2, set3); + values4.freeze(); + + { + logging::filter f = logging::parse_filter("%MyAttr% = 10"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% != 10"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% < 20"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% < -7"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > 10"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(!f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > -5"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% <= 20"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(f(values4)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% >= 20"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(!f(values4)); + } +} + +// Tests for floating point relation filter +BOOST_AUTO_TEST_CASE(fp_relation) +{ + attrs::constant< float > attr1(2.5); + attrs::constant< float > attr2(8.8); + attrs::constant< double > attr3(-9.1); + attrs::constant< float > attr4(0); + attr_set set1, set2, set3; + + attr_values values1(set1, set2, set3); + values1.freeze(); + + set1["MyAttr"] = attr1; + attr_values values2(set1, set2, set3); + values2.freeze(); + + set1["MyAttr"] = attr2; + attr_values values3(set1, set2, set3); + values3.freeze(); + + set1["MyAttr"] = attr3; + attr_values values4(set1, set2, set3); + values4.freeze(); + + set1["MyAttr"] = attr4; + attr_values values5(set1, set2, set3); + values5.freeze(); + + { + logging::filter f = logging::parse_filter("%MyAttr% = 10.3"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(!f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% != 10"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% < 5.5"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% < -7"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(!f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > 5.6"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(!f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > -5"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% <= 20"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% >= 20"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(!f(values5)); + } +} + +// Tests for string relation filter +BOOST_AUTO_TEST_CASE(string_relation) +{ + attrs::constant< std::string > attr1("hello"); + attr_set set1, set2, set3; + + attr_values values1(set1, set2, set3); + values1.freeze(); + + set1["MyStr"] = attr1; + attr_values values2(set1, set2, set3); + values2.freeze(); + + { + logging::filter f = logging::parse_filter("%MyStr% = hello"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% = \"hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + { + logging::filter f = logging::parse_filter(" % MyStr % = \"hello\" "); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% = \" hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% = \"hello \""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% = \"world\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% = \"Hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% != hello"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% != world"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% < world"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + { + logging::filter f = logging::parse_filter("%MyStr% > world"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + } + + // Check that strings that look like numbers can still be used in filters + attrs::constant< std::string > attr2("55"); + set1["MyStr"] = attr2; + attr_values values3(set1, set2, set3); + values3.freeze(); + + { + logging::filter f = logging::parse_filter("%MyStr% = \"55\""); + BOOST_CHECK(f(values3)); + } + { + logging::filter f = logging::parse_filter("%MyStr% < \"555\""); + BOOST_CHECK(f(values3)); + } + { + logging::filter f = logging::parse_filter("%MyStr% > \"44\""); + BOOST_CHECK(f(values3)); + } +} + +// Tests for multiple expression filter +BOOST_AUTO_TEST_CASE(multi_expression) +{ + attrs::constant< int > attr1(10); + attrs::constant< int > attr2(20); + attrs::constant< std::string > attr3("hello"); + attrs::constant< std::string > attr4("world"); + attr_set set1, set2, set3; + + attr_values values1(set1, set2, set3); + values1.freeze(); + + set1["MyAttr"] = attr1; + attr_values values2(set1, set2, set3); + values2.freeze(); + + set1["MyAttr"] = attr2; + attr_values values3(set1, set2, set3); + values3.freeze(); + + set1["MyStr"] = attr3; + attr_values values4(set1, set2, set3); + values4.freeze(); + + set1["MyStr"] = attr4; + attr_values values5(set1, set2, set3); + values5.freeze(); + + { + logging::filter f = logging::parse_filter("%MyAttr% = 10 & %MyStr% = \"hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(!f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > 10 & %MyStr% = \"hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(!f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > 10 and %MyStr% = \"hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(!f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% = 10 | %MyStr% = \"world\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > 10 | %MyStr% = \"world\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% = 10 or %MyStr% = \"world\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(!f(values4)); + BOOST_CHECK(f(values5)); + } + { + logging::filter f = logging::parse_filter("%MyAttr% > 0 & %MyAttr% < 20 | %MyStr% = \"hello\""); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(!f(values3)); + BOOST_CHECK(f(values4)); + BOOST_CHECK(!f(values5)); + } +} + +// Tests for negation +BOOST_AUTO_TEST_CASE(negation) +{ + attrs::constant< int > attr1(10); + attrs::constant< int > attr2(20); + attrs::constant< std::string > attr3("hello"); + attr_set set1, set2, set3; + + attr_values values1(set1, set2, set3); + values1.freeze(); + + set1["MyAttr"] = attr1; + attr_values values2(set1, set2, set3); + values2.freeze(); + + set1["MyAttr"] = attr2; + attr_values values3(set1, set2, set3); + values3.freeze(); + + set1["MyStr"] = attr3; + attr_values values4(set1, set2, set3); + values4.freeze(); + + // Test with presence filter + { + logging::filter f = logging::parse_filter("!%MyAttr%"); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter(" ! % MyAttr % "); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("not %MyAttr%"); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + } + { + logging::filter f = logging::parse_filter("!!%MyAttr%"); + BOOST_CHECK(!f(values1)); + BOOST_CHECK(f(values2)); + } + + // Test with relations + { + logging::filter f = logging::parse_filter("!(%MyAttr% = 10)"); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + } + { + logging::filter f = logging::parse_filter("not ( %MyAttr% = 10 ) "); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + } + { + logging::filter f = logging::parse_filter("!(%MyAttr% < 20)"); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + } + + // Test with multiple subexpressions + { + logging::filter f = logging::parse_filter("!(%MyAttr% = 20 & %MyStr% = hello)"); + BOOST_CHECK(f(values1)); + BOOST_CHECK(f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(!f(values4)); + } + { + logging::filter f = logging::parse_filter("!(%MyAttr% = 10 | %MyStr% = hello)"); + BOOST_CHECK(f(values1)); + BOOST_CHECK(!f(values2)); + BOOST_CHECK(f(values3)); + BOOST_CHECK(!f(values4)); + } +} + +// Tests for begins_with relation filter +BOOST_AUTO_TEST_CASE(begins_with_relation) +{ + attrs::constant< std::string > attr1("abcdABCD"); + attr_set set1, set2, set3; + + set1["MyStr"] = attr1; + attr_values values1(set1, set2, set3); + values1.freeze(); + + { + logging::filter f = logging::parse_filter("%MyStr% begins_with \"abcd\""); + BOOST_CHECK(f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% begins_with \"ABCD\""); + BOOST_CHECK(!f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% begins_with \"efgh\""); + BOOST_CHECK(!f(values1)); + } +} + +// Tests for ends_with relation filter +BOOST_AUTO_TEST_CASE(ends_with_relation) +{ + attrs::constant< std::string > attr1("abcdABCD"); + attr_set set1, set2, set3; + + set1["MyStr"] = attr1; + attr_values values1(set1, set2, set3); + values1.freeze(); + + { + logging::filter f = logging::parse_filter("%MyStr% ends_with \"abcd\""); + BOOST_CHECK(!f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% ends_with \"ABCD\""); + BOOST_CHECK(f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% ends_with \"efgh\""); + BOOST_CHECK(!f(values1)); + } +} + +// Tests for contains relation filter +BOOST_AUTO_TEST_CASE(contains_relation) +{ + attrs::constant< std::string > attr1("abcdABCD"); + attr_set set1, set2, set3; + + set1["MyStr"] = attr1; + attr_values values1(set1, set2, set3); + values1.freeze(); + + { + logging::filter f = logging::parse_filter("%MyStr% contains \"abcd\""); + BOOST_CHECK(f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% contains \"ABCD\""); + BOOST_CHECK(f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% contains \"cdAB\""); + BOOST_CHECK(f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% contains \"efgh\""); + BOOST_CHECK(!f(values1)); + } +} + +// Tests for regex matching relation filter +BOOST_AUTO_TEST_CASE(matches_relation) +{ + attrs::constant< std::string > attr1("hello"); + attr_set set1, set2, set3; + + set1["MyStr"] = attr1; + attr_values values1(set1, set2, set3); + values1.freeze(); + + { + logging::filter f = logging::parse_filter("%MyStr% matches \"h.*\""); + BOOST_CHECK(f(values1)); + } + { + logging::filter f = logging::parse_filter("%MyStr% matches \"w.*\""); + BOOST_CHECK(!f(values1)); + } +} + +namespace { + +class test_filter_factory : + public logging::filter_factory< char > +{ +private: + typedef logging::filter_factory< char > base_type; + +public: + enum relation_type + { + custom, + exists, + equality, + inequality, + less, + greater, + less_or_equal, + greater_or_equal + }; + + typedef base_type::string_type string_type; + +public: + explicit test_filter_factory(logging::attribute_name const& name) : m_name(name), m_rel(custom), m_called(false) + { + } + + void expect_relation(relation_type rel, string_type const& arg) + { + m_rel = rel; + m_arg = arg; + m_custom_rel.clear(); + } + + void expect_relation(string_type const& rel, string_type const& arg) + { + m_rel = custom; + m_arg = arg; + m_custom_rel = rel; + } + + void check_called() + { + BOOST_CHECK(m_called); + m_called = false; + } + + logging::filter on_exists_test(logging::attribute_name const& name) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, exists); + m_called = true; + return logging::filter(); + } + logging::filter on_equality_relation(logging::attribute_name const& name, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, equality); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + logging::filter on_inequality_relation(logging::attribute_name const& name, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, inequality); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + logging::filter on_less_relation(logging::attribute_name const& name, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, less); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + logging::filter on_greater_relation(logging::attribute_name const& name, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, greater); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + logging::filter on_less_or_equal_relation(logging::attribute_name const& name, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, less_or_equal); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + logging::filter on_greater_or_equal_relation(logging::attribute_name const& name, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, greater_or_equal); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + logging::filter on_custom_relation(logging::attribute_name const& name, string_type const& rel, string_type const& arg) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_rel, custom); + BOOST_CHECK_EQUAL(m_custom_rel, rel); + BOOST_CHECK_EQUAL(m_arg, arg); + m_called = true; + return logging::filter(); + } + +private: + logging::attribute_name m_name; + relation_type m_rel; + string_type m_arg; + string_type m_custom_rel; + bool m_called; +}; + +} // namespace + +// Tests for filter factory +BOOST_AUTO_TEST_CASE(filter_factory) +{ + logging::attribute_name attr_name("MyCustomAttr"); + boost::shared_ptr< test_filter_factory > factory(new test_filter_factory(attr_name)); + logging::register_filter_factory(attr_name, factory); + + BOOST_TEST_CHECKPOINT("filter_factory::exists"); + factory->expect_relation(test_filter_factory::exists, ""); + logging::parse_filter("%MyCustomAttr%"); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::equality"); + factory->expect_relation(test_filter_factory::equality, "15"); + logging::parse_filter("%MyCustomAttr% = 15"); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::equality"); + factory->expect_relation(test_filter_factory::equality, "hello"); + logging::parse_filter("%MyCustomAttr% = hello"); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::equality"); + factory->expect_relation(test_filter_factory::equality, "hello"); + logging::parse_filter("%MyCustomAttr% = \"hello\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::equality"); + factory->expect_relation(test_filter_factory::equality, "hello\nworld"); + logging::parse_filter("%MyCustomAttr% = \"hello\\nworld\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::inequality"); + factory->expect_relation(test_filter_factory::inequality, "hello"); + logging::parse_filter("%MyCustomAttr% != \"hello\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::less"); + factory->expect_relation(test_filter_factory::less, "hello"); + logging::parse_filter("%MyCustomAttr% < \"hello\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::greater"); + factory->expect_relation(test_filter_factory::greater, "hello"); + logging::parse_filter("%MyCustomAttr% > \"hello\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::less_or_equal"); + factory->expect_relation(test_filter_factory::less_or_equal, "hello"); + logging::parse_filter("%MyCustomAttr% <= \"hello\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::greater_or_equal"); + factory->expect_relation(test_filter_factory::greater_or_equal, "hello"); + logging::parse_filter("%MyCustomAttr% >= \"hello\""); + factory->check_called(); + + BOOST_TEST_CHECKPOINT("filter_factory::custom"); + factory->expect_relation("my_relation", "hello"); + logging::parse_filter("%MyCustomAttr% my_relation \"hello\""); + factory->check_called(); +} + +// Tests for invalid filters +BOOST_AUTO_TEST_CASE(invalid) +{ + BOOST_CHECK_THROW(logging::parse_filter("%MyStr"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("MyStr%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%MyStr% abcd"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("(%MyStr%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%MyStr%)"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("!"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("!()"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("\"xxx\" == %MyStr%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%MyStr% == \"xxx"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%MyStr% === \"xxx\""), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%MyStr% ! \"xxx\""), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_filter("%MyStr% %MyStr2%"), logging::parse_error); +} + +#endif // !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) diff --git a/test/run/setup_formatter_parser.cpp b/test/run/setup_formatter_parser.cpp new file mode 100644 index 0000000..352d312 --- /dev/null +++ b/test/run/setup_formatter_parser.cpp @@ -0,0 +1,257 @@ +/* + * Copyright Andrey Semashev 2007 - 2013. + * 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 setup_formatter_parser.cpp + * \author Andrey Semashev + * \date 25.08.2013 + * + * \brief This header contains tests for the formatter parser. + */ + +#define BOOST_TEST_MODULE setup_formatter_parser + +#include +#include +#include + +#if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "make_record.hpp" + +namespace logging = boost::log; +namespace attrs = logging::attributes; + +typedef logging::attribute_set attr_set; +typedef logging::attribute_value_set attr_values; +typedef logging::record_view record_view; + +typedef logging::basic_formatting_ostream< char > osstream; +typedef logging::basic_formatter< char > formatter; + +// Tests for simple attribute placeholders in formatters +BOOST_AUTO_TEST_CASE(attr_placeholders) +{ + attrs::constant< int > attr1(10); + attrs::constant< std::string > attr2("hello"); + attr_set set1; + + set1["MyAttr"] = attr1; + set1["MyStr"] = attr2; + + record_view rec = make_record_view(set1); + + { + formatter f = logging::parse_formatter("String literal"); + std::string str1, str2; + osstream strm1(str1), strm2(str2); + f(rec, strm1); + strm2 << "String literal"; + BOOST_CHECK_EQUAL(strm1.str(), strm2.str()); + } + { + formatter f = logging::parse_formatter("MyAttr: %MyAttr%, MyStr: %MyStr%"); + std::string str1, str2; + osstream strm1(str1), strm2(str2); + f(rec, strm1); + strm2 << "MyAttr: " << attr1.get() << ", MyStr: " << attr2.get(); + BOOST_CHECK_EQUAL(strm1.str(), strm2.str()); + } + { + formatter f = logging::parse_formatter("MyAttr: % MyAttr %, MyStr: % MyStr %"); + std::string str1, str2; + osstream strm1(str1), strm2(str2); + f(rec, strm1); + strm2 << "MyAttr: " << attr1.get() << ", MyStr: " << attr2.get(); + BOOST_CHECK_EQUAL(strm1.str(), strm2.str()); + } + { + formatter f = logging::parse_formatter("%MyAttr%%MyStr%"); + std::string str1, str2; + osstream strm1(str1), strm2(str2); + f(rec, strm1); + strm2 << attr1.get() << attr2.get(); + BOOST_CHECK_EQUAL(strm1.str(), strm2.str()); + } + { + formatter f = logging::parse_formatter("MyAttr: %MyAttr%, MissingAttr: %MissingAttr%"); + std::string str1, str2; + osstream strm1(str1), strm2(str2); + f(rec, strm1); + strm2 << "MyAttr: " << attr1.get() << ", MissingAttr: "; + BOOST_CHECK_EQUAL(strm1.str(), strm2.str()); + } +} + +namespace { + +class test_formatter_factory : + public logging::formatter_factory< char > +{ +private: + typedef logging::formatter_factory< char > base_type; + +public: + typedef base_type::string_type string_type; + typedef base_type::args_map args_map; + typedef base_type::formatter_type formatter_type; + +public: + explicit test_formatter_factory(logging::attribute_name const& name) : m_name(name), m_called(false) + { + } + + void expect_args(args_map const& args) + { + m_args = args; + } + + void check_called() + { + BOOST_CHECK(m_called); + m_called = false; + } + + formatter_type create_formatter(logging::attribute_name const& name, args_map const& args) + { + BOOST_CHECK_EQUAL(m_name, name); + BOOST_CHECK_EQUAL(m_args.size(), args.size()); + + for (args_map::const_iterator it = m_args.begin(), end = m_args.end(); it != end; ++it) + { + args_map::const_iterator parsed_it = args.find(it->first); + if (parsed_it != args.end()) + { + BOOST_TEST_CHECKPOINT(("Arg: " + it->first)); + BOOST_CHECK_EQUAL(it->second, parsed_it->second); + } + else + { + BOOST_ERROR(("Arg not found: " + it->first)); + } + } + + m_called = true; + return formatter_type(); + } + +private: + logging::attribute_name m_name; + args_map m_args; + bool m_called; +}; + +} // namespace + +// Tests for formatter factory +BOOST_AUTO_TEST_CASE(formatter_factory) +{ + logging::attribute_name attr_name("MyCustomAttr"); + boost::shared_ptr< test_formatter_factory > factory(new test_formatter_factory(attr_name)); + logging::register_formatter_factory(attr_name, factory); + + { + BOOST_TEST_CHECKPOINT("formatter 1"); + test_formatter_factory::args_map args; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr%"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 2"); + test_formatter_factory::args_map args; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr()%"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 3"); + test_formatter_factory::args_map args; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr ( ) %"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 4"); + test_formatter_factory::args_map args; + args["param1"] = "10"; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr(param1=10)%"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 5"); + test_formatter_factory::args_map args; + args["param1"] = "10"; + factory->expect_args(args); + logging::parse_formatter("Hello: % MyCustomAttr ( param1 = 10 ) % "); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 6"); + test_formatter_factory::args_map args; + args["param1"] = " 10 "; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr(param1=\" 10 \")%"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 7"); + test_formatter_factory::args_map args; + args["param1"] = "10"; + args["param2"] = "abcd"; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr(param1 = 10, param2 = abcd)%"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 8"); + test_formatter_factory::args_map args; + args["param1"] = "10"; + args["param2"] = "abcd"; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr(param1=10,param2=abcd)%"); + factory->check_called(); + } + { + BOOST_TEST_CHECKPOINT("formatter 9"); + test_formatter_factory::args_map args; + args["param1"] = "10"; + args["param2"] = "abcd"; + args["param_last"] = "-2.2"; + factory->expect_args(args); + logging::parse_formatter("Hello: %MyCustomAttr(param1 = 10, param2 = \"abcd\", param_last = -2.2)%"); + factory->check_called(); + } +} + +// Tests for invalid formatters +BOOST_AUTO_TEST_CASE(invalid) +{ + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("MyStr%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr)%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param=%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param)%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param=)%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(=value)%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param,param2)%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param=value,)%"), logging::parse_error); + BOOST_CHECK_THROW(logging::parse_formatter("%MyStr(param=value,param2)%"), logging::parse_error); +} + +#endif // !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) diff --git a/test/run/setup_settings_parser.cpp b/test/run/setup_settings_parser.cpp new file mode 100644 index 0000000..7d930fc --- /dev/null +++ b/test/run/setup_settings_parser.cpp @@ -0,0 +1,294 @@ +/* + * Copyright Andrey Semashev 2007 - 2013. + * 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 setup_settings_parser.cpp + * \author Andrey Semashev + * \date 25.08.2013 + * + * \brief This header contains tests for the settings parser. + */ + +#define BOOST_TEST_MODULE setup_settings_parser + +#include +#include +#include +#include + +#if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) + +#include + +namespace logging = boost::log; + +typedef logging::basic_settings< char > settings; + +// Tests for single-level settings +BOOST_AUTO_TEST_CASE(single_level) +{ + { + std::istringstream strm + ( + "[Section1]\n" + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + settings s = logging::parse_settings(strm); + + BOOST_CHECK(s.has_section("Section1")); + BOOST_CHECK(s.has_section("Section2")); + BOOST_CHECK(!s.has_section("Section3")); + + BOOST_CHECK(s.has_parameter("Section1", "Param1")); + BOOST_CHECK(s.has_parameter("Section1", "Param2")); + + BOOST_CHECK(s.has_parameter("Section2", "Param1")); + BOOST_CHECK(s.has_parameter("Section2", "Param2")); + + BOOST_CHECK_EQUAL(s["Section1"]["Param1"].or_default(std::string()), "Value1"); + BOOST_CHECK_EQUAL(s["Section1"]["Param2"].or_default(std::string()), "hello, \"world\""); + + BOOST_CHECK_EQUAL(s["Section2"]["Param1"].or_default(std::string()), "10"); + BOOST_CHECK_EQUAL(s["Section2"]["Param2"].or_default(std::string()), "-2.2"); + } +} + +// Tests for multi-level settings +BOOST_AUTO_TEST_CASE(multi_level) +{ + { + std::istringstream strm + ( + " [Section1]\n" + "\n" + "Param1 = Value1 \n" + "Param2=\"hello, \\\"world\\\"\" \n" + "\n" + "[Section1.Subsection2] \n" + "\n" + "Param1=10\n" + "Param2=-2.2\n" + ); + settings s = logging::parse_settings(strm); + + BOOST_CHECK(s.has_section("Section1")); + BOOST_CHECK(s.has_section("Section1.Subsection2")); + BOOST_CHECK(!s.has_section("Subsection2")); + + BOOST_CHECK(s.has_parameter("Section1", "Param1")); + BOOST_CHECK(s.has_parameter("Section1", "Param2")); + + BOOST_CHECK(s.has_parameter("Section1.Subsection2", "Param1")); + BOOST_CHECK(s.has_parameter("Section1.Subsection2", "Param2")); + BOOST_CHECK(!s.has_parameter("Subsection2", "Param1")); + BOOST_CHECK(!s.has_parameter("Subsection2", "Param2")); + + BOOST_CHECK_EQUAL(s["Section1"]["Param1"].or_default(std::string()), "Value1"); + BOOST_CHECK_EQUAL(s["Section1"]["Param2"].or_default(std::string()), "hello, \"world\""); + + BOOST_CHECK_EQUAL(s["Section1.Subsection2"]["Param1"].or_default(std::string()), "10"); + BOOST_CHECK_EQUAL(s["Section1.Subsection2"]["Param2"].or_default(std::string()), "-2.2"); + } +} + +// Tests for comments +BOOST_AUTO_TEST_CASE(comments) +{ + { + std::istringstream strm + ( + "# Some comment\n" + "[ Section1 ] # another comment\n" + "\n" + "Param1 = Value1 ### yet another comment \n" + "Param2=\"hello, \\\"world\\\"\" # comment after a quoted string\n" + "\n" + "[ Section2 ]\n" + "\n" + "Param1=10#comment after a number\n" + "Param2=-2.2#comment without a terminating newline" + "\n" + "#[Section3]\n" + "#\n" + "#Param1=10#comment after a number\n" + "#Param2=-2.2#comment without a terminating newline" + ); + settings s = logging::parse_settings(strm); + + BOOST_CHECK(s.has_section("Section1")); + BOOST_CHECK(s.has_section("Section2")); + BOOST_CHECK(!s.has_section("Section3")); + + BOOST_CHECK(s.has_parameter("Section1", "Param1")); + BOOST_CHECK(s.has_parameter("Section1", "Param2")); + + BOOST_CHECK(s.has_parameter("Section2", "Param1")); + BOOST_CHECK(s.has_parameter("Section2", "Param2")); + + BOOST_CHECK_EQUAL(s["Section1"]["Param1"].or_default(std::string()), "Value1"); + BOOST_CHECK_EQUAL(s["Section1"]["Param2"].or_default(std::string()), "hello, \"world\""); + + BOOST_CHECK_EQUAL(s["Section2"]["Param1"].or_default(std::string()), "10"); + BOOST_CHECK_EQUAL(s["Section2"]["Param2"].or_default(std::string()), "-2.2"); + } +} + +// Tests for invalid settings +BOOST_AUTO_TEST_CASE(invalid) +{ + { + std::istringstream strm + ( + "Param1 = Value1\n" // parameters outside sections + "Param2 = \"hello, \\\"world\\\"\"\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1\n" // missing closing brace + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "Section1]\n" // missing opening brace + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1=xyz]\n" // invalid characters in the section name + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1# hello?]\n" // invalid characters in the section name + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "(Section1)\n" // invalid braces + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1]\n" + "\n" + "Param1 =\n" // no parameter value + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1]\n" + "\n" + "Param1\n" // no parameter value + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1]\n" + "\n" + "Param1 = Value1\n" + "Param2 = \"hello, \\\"world\\\"\n" // unterminated quote + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } + { + std::istringstream strm + ( + "[Section1]\n" + "\n" + "Param1 = Value1 Value2\n" // multi-word value + "Param2 = \"hello, \\\"world\\\"\"\n" + "\n" + "[Section2]\n" + "\n" + "Param1 = 10\n" + "Param2 = -2.2\n" + ); + BOOST_CHECK_THROW(logging::parse_settings(strm), logging::parse_error); + } +} + +#endif // !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS)