diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 685a0af..6b8c585 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -69,6 +69,7 @@ local doxygen_params = BOOST_LOG_CLOSE_NAMESPACE=\"}\" \\ BOOST_DEFAULTED_FUNCTION(x,y)=\"x = default;\" \\ BOOST_DELETED_FUNCTION(x)=\"x = delete;\" \\ + BOOST_EXPLICIT_OPERATOR_BOOL()=\"explicit operator bool() const;\" \\ BOOST_LOG_USE_CHAR \\ BOOST_LOG_USE_WCHAR_T \\ BOOST_LOG_API= \\ diff --git a/doc/changelog.qbk b/doc/changelog.qbk index b522cd5..cb1391f 100644 --- a/doc/changelog.qbk +++ b/doc/changelog.qbk @@ -14,7 +14,10 @@ [*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. +* Rewritten some of the parsers to reduce the compiled binary size. The rewritten parsers are more robust in detecting ambiguous and incorrect input. +* The header `boost/log/utility/intrusive_ref_counter.hpp` is deprecated and will be removed in future releases. Its contents have been reworked and moved to __boost_smart_ptr__, as `boost/smart_ptr/intrusive_ref_counter.hpp`. +* The header `boost/log/utility/explicit_operator_bool.hpp` is deprecated and will be removed in future releases. Its contents have been moved to __boost_utility__, as `boost/utility/explicit_operator_bool.hpp`. +* The header `boost/log/utility/empty_deleter.hpp` is deprecated and will be removed in future releases. Its contents have been moved to __boost_utility__, as `boost/utility/empty_deleter.hpp`. [*Bug fixes:] diff --git a/doc/log.qbk b/doc/log.qbk index 273a2a4..e35ef0e 100644 --- a/doc/log.qbk +++ b/doc/log.qbk @@ -46,6 +46,7 @@ [def __boost_asio__ [@http://www.boost.org/doc/libs/release/doc/html/boost_asio.html Boost.ASIO]] [def __boost_move__ [@http://www.boost.org/doc/libs/release/doc/html/move.html Boost.Move]] [def __boost_locale__ [@http://www.boost.org/doc/libs/release/libs/locale/doc/html/index.html Boost.Locale]] +[def __boost_utility__ [@http://www.boost.org/doc/libs/release/libs/utility/utility.htm Boost.Utility]] [def __boost_quickbook__ [@http://www.boost.org/doc/libs/release/doc/html/quickbook.html Boost.Quickbook]] [template ticket[key] '''#'''[key]''''''] diff --git a/example/advanced_usage/Jamfile.v2 b/example/advanced_usage/Jamfile.v2 index 4392721..a541881 100644 --- a/example/advanced_usage/Jamfile.v2 +++ b/example/advanced_usage/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/advanced_usage/main.cpp b/example/advanced_usage/main.cpp index a30427a..5d677f3 100644 --- a/example/advanced_usage/main.cpp +++ b/example/advanced_usage/main.cpp @@ -21,14 +21,14 @@ #include #include #include -#include +#include +#include #include #include #include #include #include #include -#include #include #include #include @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) // interference of other threads that might be trying to log. // Next we add streams to which logging records should be output - shared_ptr< std::ostream > pStream(&std::clog, logging::empty_deleter()); + shared_ptr< std::ostream > pStream(&std::clog, boost::empty_deleter()); pBackend->add_stream(pStream); // We can add more than one stream to the sink backend diff --git a/example/async_log/Jamfile.v2 b/example/async_log/Jamfile.v2 index 713aeee..b5dcc6c 100644 --- a/example/async_log/Jamfile.v2 +++ b/example/async_log/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/async_log/main.cpp b/example/async_log/main.cpp index 51c53b1..0998947 100644 --- a/example/async_log/main.cpp +++ b/example/async_log/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -31,7 +31,6 @@ #include #include #include -#include #include namespace logging = boost::log; diff --git a/example/basic_usage/Jamfile.v2 b/example/basic_usage/Jamfile.v2 index 4c72d06..8d8da97 100644 --- a/example/basic_usage/Jamfile.v2 +++ b/example/basic_usage/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + 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 diff --git a/example/bounded_async_log/Jamfile.v2 b/example/bounded_async_log/Jamfile.v2 index 5e118d5..55678a9 100644 --- a/example/bounded_async_log/Jamfile.v2 +++ b/example/bounded_async_log/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/bounded_async_log/main.cpp b/example/bounded_async_log/main.cpp index 5fef573..a579548 100644 --- a/example/bounded_async_log/main.cpp +++ b/example/bounded_async_log/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -31,7 +31,6 @@ #include #include #include -#include #include namespace logging = boost::log; diff --git a/example/doc/Jamfile.v2 b/example/doc/Jamfile.v2 index 838624e..1160670 100644 --- a/example/doc/Jamfile.v2 +++ b/example/doc/Jamfile.v2 @@ -15,12 +15,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + 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 diff --git a/example/doc/core_core_manual.cpp b/example/doc/core_core_manual.cpp index 53d78d1..6b49bbe 100644 --- a/example/doc/core_core_manual.cpp +++ b/example/doc/core_core_manual.cpp @@ -5,7 +5,7 @@ * http://www.boost.org/LICENSE_1_0.txt) */ -#include +#include #include #include #include diff --git a/example/doc/exception_handling.cpp b/example/doc/exception_handling.cpp index d3ff4a1..6db86e6 100644 --- a/example/doc/exception_handling.cpp +++ b/example/doc/exception_handling.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/expressions_has_attr_stat_accum.cpp b/example/doc/expressions_has_attr_stat_accum.cpp index 6ada84a..164b895 100644 --- a/example/doc/expressions_has_attr_stat_accum.cpp +++ b/example/doc/expressions_has_attr_stat_accum.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/extension_app_launcher.cpp b/example/doc/extension_app_launcher.cpp index 35c8978..c7eba67 100644 --- a/example/doc/extension_app_launcher.cpp +++ b/example/doc/extension_app_launcher.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/example/doc/extension_filter_parser.cpp b/example/doc/extension_filter_parser.cpp index 7cc41fb..e60d8ad 100644 --- a/example/doc/extension_filter_parser.cpp +++ b/example/doc/extension_filter_parser.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/extension_filter_parser_custom_rel.cpp b/example/doc/extension_filter_parser_custom_rel.cpp index d384414..068b308 100644 --- a/example/doc/extension_filter_parser_custom_rel.cpp +++ b/example/doc/extension_filter_parser_custom_rel.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/extension_formatter_parser.cpp b/example/doc/extension_formatter_parser.cpp index c96f8fc..7d65602 100644 --- a/example/doc/extension_formatter_parser.cpp +++ b/example/doc/extension_formatter_parser.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/extension_record_tagger.cpp b/example/doc/extension_record_tagger.cpp index 73244e5..e7454ee 100644 --- a/example/doc/extension_record_tagger.cpp +++ b/example/doc/extension_record_tagger.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/extension_stat_collector.cpp b/example/doc/extension_stat_collector.cpp index a9dc791..e100a50 100644 --- a/example/doc/extension_stat_collector.cpp +++ b/example/doc/extension_stat_collector.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/example/doc/extension_stat_collector_settings.cpp b/example/doc/extension_stat_collector_settings.cpp index be30418..f9da850 100644 --- a/example/doc/extension_stat_collector_settings.cpp +++ b/example/doc/extension_stat_collector_settings.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/extension_system_uptime_attr.cpp b/example/doc/extension_system_uptime_attr.cpp index 3121c30..826688d 100644 --- a/example/doc/extension_system_uptime_attr.cpp +++ b/example/doc/extension_system_uptime_attr.cpp @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -20,7 +21,6 @@ #include #include #include -#include // Includes for get_uptime() #include @@ -85,7 +85,7 @@ void init_logging() // Initialize the sink typedef sinks::synchronous_sink< sinks::text_ostream_backend > sink_t; boost::shared_ptr< sink_t > sink(new sink_t()); - sink->locked_backend()->add_stream(boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + sink->locked_backend()->add_stream(boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); sink->set_formatter(expr::stream << expr::attr< unsigned int >("SystemUptime") << ": " << expr::smessage); core->add_sink(sink); //-> diff --git a/example/doc/sinks_async.cpp b/example/doc/sinks_async.cpp index c17f770..d09b0d5 100644 --- a/example/doc/sinks_async.cpp +++ b/example/doc/sinks_async.cpp @@ -8,14 +8,14 @@ #include #include #include -#include +#include +#include #include #include #include #include #include #include -#include namespace logging = boost::log; namespace src = boost::log::sources; @@ -42,7 +42,7 @@ boost::shared_ptr< sink_t > init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t(backend)); diff --git a/example/doc/sinks_async_bounded.cpp b/example/doc/sinks_async_bounded.cpp index 06abba8..a102e0a 100644 --- a/example/doc/sinks_async_bounded.cpp +++ b/example/doc/sinks_async_bounded.cpp @@ -8,7 +8,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include namespace logging = boost::log; namespace src = boost::log::sources; @@ -50,7 +50,7 @@ boost::shared_ptr< sink_t > init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t(backend)); diff --git a/example/doc/sinks_async_ordering.cpp b/example/doc/sinks_async_ordering.cpp index 57ad90a..7db2325 100644 --- a/example/doc/sinks_async_ordering.cpp +++ b/example/doc/sinks_async_ordering.cpp @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -18,7 +19,6 @@ #include #include #include -#include #include #include @@ -55,7 +55,7 @@ boost::shared_ptr< sink_t > init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t( diff --git a/example/doc/sinks_debugger.cpp b/example/doc/sinks_debugger.cpp index 4912656..39bf757 100644 --- a/example/doc/sinks_debugger.cpp +++ b/example/doc/sinks_debugger.cpp @@ -5,7 +5,7 @@ * http://www.boost.org/LICENSE_1_0.txt) */ -#include +#include #include #include #include diff --git a/example/doc/sinks_file.cpp b/example/doc/sinks_file.cpp index ef497e2..2480a9d 100644 --- a/example/doc/sinks_file.cpp +++ b/example/doc/sinks_file.cpp @@ -8,13 +8,12 @@ #include #include #include -#include +#include #include #include #include #include #include -#include namespace logging = boost::log; namespace src = boost::log::sources; diff --git a/example/doc/sinks_multifile.cpp b/example/doc/sinks_multifile.cpp index 7b0d77f..b44f09f 100644 --- a/example/doc/sinks_multifile.cpp +++ b/example/doc/sinks_multifile.cpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/sinks_ostream.cpp b/example/doc/sinks_ostream.cpp index e5faeb9..fd25882 100644 --- a/example/doc/sinks_ostream.cpp +++ b/example/doc/sinks_ostream.cpp @@ -8,13 +8,13 @@ #include #include #include -#include +#include +#include #include #include #include #include #include -#include namespace logging = boost::log; namespace src = boost::log::sources; @@ -30,7 +30,7 @@ void init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); backend->add_stream( boost::shared_ptr< std::ostream >(new std::ofstream("sample.log"))); diff --git a/example/doc/sinks_simple_event_log.cpp b/example/doc/sinks_simple_event_log.cpp index bdd62d4..a0de7f2 100644 --- a/example/doc/sinks_simple_event_log.cpp +++ b/example/doc/sinks_simple_event_log.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/doc/sinks_sync.cpp b/example/doc/sinks_sync.cpp index 9eeac7f..4356703 100644 --- a/example/doc/sinks_sync.cpp +++ b/example/doc/sinks_sync.cpp @@ -8,14 +8,14 @@ #include #include #include -#include +#include +#include #include #include #include #include #include #include -#include namespace logging = boost::log; namespace src = boost::log::sources; @@ -42,7 +42,7 @@ void init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t(backend)); diff --git a/example/doc/sinks_syslog.cpp b/example/doc/sinks_syslog.cpp index b4cf7ee..ba0f4d9 100644 --- a/example/doc/sinks_syslog.cpp +++ b/example/doc/sinks_syslog.cpp @@ -6,8 +6,8 @@ */ #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/sinks_unlocked.cpp b/example/doc/sinks_unlocked.cpp index 57f06bf..72007ee 100644 --- a/example/doc/sinks_unlocked.cpp +++ b/example/doc/sinks_unlocked.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/example/doc/sinks_xml_file.cpp b/example/doc/sinks_xml_file.cpp index f585e72..7cde266 100644 --- a/example/doc/sinks_xml_file.cpp +++ b/example/doc/sinks_xml_file.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/doc/sources_net_connection.cpp b/example/doc/sources_net_connection.cpp index b43c4d9..5a59690 100644 --- a/example/doc/sources_net_connection.cpp +++ b/example/doc/sources_net_connection.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/sources_net_connection_chan.cpp b/example/doc/sources_net_connection_chan.cpp index 9978f95..49afa9a 100644 --- a/example/doc/sources_net_connection_chan.cpp +++ b/example/doc/sources_net_connection_chan.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/sources_net_connection_dynamic_chan.cpp b/example/doc/sources_net_connection_dynamic_chan.cpp index 9adcd13..a9c5ab0 100644 --- a/example/doc/sources_net_connection_dynamic_chan.cpp +++ b/example/doc/sources_net_connection_dynamic_chan.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/sources_severity.cpp b/example/doc/sources_severity.cpp index c1f88db..8528fb5 100644 --- a/example/doc/sources_severity.cpp +++ b/example/doc/sources_severity.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/sources_severity_channel.cpp b/example/doc/sources_severity_channel.cpp index d50f25f..52dd388 100644 --- a/example/doc/sources_severity_channel.cpp +++ b/example/doc/sources_severity_channel.cpp @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/tutorial_attributes.cpp b/example/doc/tutorial_attributes.cpp index 7d5905c..8e5d95f 100644 --- a/example/doc/tutorial_attributes.cpp +++ b/example/doc/tutorial_attributes.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/tutorial_file_manual.cpp b/example/doc/tutorial_file_manual.cpp index 6226457..5df0c21 100644 --- a/example/doc/tutorial_file_manual.cpp +++ b/example/doc/tutorial_file_manual.cpp @@ -6,8 +6,8 @@ */ #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/tutorial_filtering.cpp b/example/doc/tutorial_filtering.cpp index 3826687..7a19d18 100644 --- a/example/doc/tutorial_filtering.cpp +++ b/example/doc/tutorial_filtering.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/tutorial_fmt_custom.cpp b/example/doc/tutorial_fmt_custom.cpp index df5bbe5..9a2624a 100644 --- a/example/doc/tutorial_fmt_custom.cpp +++ b/example/doc/tutorial_fmt_custom.cpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/tutorial_fmt_format.cpp b/example/doc/tutorial_fmt_format.cpp index d2c98aa..36f903c 100644 --- a/example/doc/tutorial_fmt_format.cpp +++ b/example/doc/tutorial_fmt_format.cpp @@ -6,8 +6,8 @@ */ #include -#include -#include +#include +#include #include #include #include diff --git a/example/doc/tutorial_fmt_stream_manual.cpp b/example/doc/tutorial_fmt_stream_manual.cpp index 210ad27..217aba9 100644 --- a/example/doc/tutorial_fmt_stream_manual.cpp +++ b/example/doc/tutorial_fmt_stream_manual.cpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/example/event_log/Jamfile.v2 b/example/event_log/Jamfile.v2 index 5c7ee0a..3d53cdf 100644 --- a/example/event_log/Jamfile.v2 +++ b/example/event_log/Jamfile.v2 @@ -14,12 +14,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/event_log/main.cpp b/example/event_log/main.cpp index b393753..f354549 100644 --- a/example/event_log/main.cpp +++ b/example/event_log/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/keywords/Jamfile.v2 b/example/keywords/Jamfile.v2 index d22f948..e08493a 100644 --- a/example/keywords/Jamfile.v2 +++ b/example/keywords/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + 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 diff --git a/example/multiple_files/Jamfile.v2 b/example/multiple_files/Jamfile.v2 index 7f00476..9ea4e4a 100644 --- a/example/multiple_files/Jamfile.v2 +++ b/example/multiple_files/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/multiple_files/main.cpp b/example/multiple_files/main.cpp index af1e72e..4859309 100644 --- a/example/multiple_files/main.cpp +++ b/example/multiple_files/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/multiple_threads/Jamfile.v2 b/example/multiple_threads/Jamfile.v2 index 2081248..4aefaea 100644 --- a/example/multiple_threads/Jamfile.v2 +++ b/example/multiple_threads/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/multiple_threads/main.cpp b/example/multiple_threads/main.cpp index dfc4273..c37818d 100644 --- a/example/multiple_threads/main.cpp +++ b/example/multiple_threads/main.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -33,7 +33,6 @@ #include #include #include -#include namespace logging = boost::log; namespace attrs = boost::log::attributes; diff --git a/example/native_syslog/Jamfile.v2 b/example/native_syslog/Jamfile.v2 index 66eef02..a3bd2c6 100644 --- a/example/native_syslog/Jamfile.v2 +++ b/example/native_syslog/Jamfile.v2 @@ -13,12 +13,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/native_syslog/main.cpp b/example/native_syslog/main.cpp index 4540b1d..4974968 100644 --- a/example/native_syslog/main.cpp +++ b/example/native_syslog/main.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/rotating_file/Jamfile.v2 b/example/rotating_file/Jamfile.v2 index e862500..b85ac92 100644 --- a/example/rotating_file/Jamfile.v2 +++ b/example/rotating_file/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/rotating_file/main.cpp b/example/rotating_file/main.cpp index 1312dc2..651e399 100644 --- a/example/rotating_file/main.cpp +++ b/example/rotating_file/main.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/settings_file/Jamfile.v2 b/example/settings_file/Jamfile.v2 index 70b11f2..986a5a7 100644 --- a/example/settings_file/Jamfile.v2 +++ b/example/settings_file/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + 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 diff --git a/example/settings_file_formatter_factory/Jamfile.v2 b/example/settings_file_formatter_factory/Jamfile.v2 index 9d13278..ffe5073 100644 --- a/example/settings_file_formatter_factory/Jamfile.v2 +++ b/example/settings_file_formatter_factory/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + 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 diff --git a/example/settings_file_formatter_factory/main.cpp b/example/settings_file_formatter_factory/main.cpp index 3f2d9d1..2b23923 100644 --- a/example/settings_file_formatter_factory/main.cpp +++ b/example/settings_file_formatter_factory/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/example/syslog/Jamfile.v2 b/example/syslog/Jamfile.v2 index 035a30c..cd89d6a 100644 --- a/example/syslog/Jamfile.v2 +++ b/example/syslog/Jamfile.v2 @@ -13,12 +13,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/syslog/main.cpp b/example/syslog/main.cpp index 980b880..54d4cf6 100644 --- a/example/syslog/main.cpp +++ b/example/syslog/main.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/example/trivial/Jamfile.v2 b/example/trivial/Jamfile.v2 index 5f0cf7a..249e9d2 100644 --- a/example/trivial/Jamfile.v2 +++ b/example/trivial/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem diff --git a/example/wide_char/Jamfile.v2 b/example/wide_char/Jamfile.v2 index 306042a..a1ea558 100644 --- a/example/wide_char/Jamfile.v2 +++ b/example/wide_char/Jamfile.v2 @@ -12,12 +12,15 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE - gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components + darwin:-ftemplate-depth-1024 gcc:-ftemplate-depth-1024 + 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 diff --git a/include/boost/log/attributes/attribute.hpp b/include/boost/log/attributes/attribute.hpp index 905739f..b21764a 100644 --- a/include/boost/log/attributes/attribute.hpp +++ b/include/boost/log/attributes/attribute.hpp @@ -16,11 +16,11 @@ #define BOOST_LOG_ATTRIBUTES_ATTRIBUTE_HPP_INCLUDED_ #include -#include #include +#include +#include #include -#include -#include +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -67,8 +67,13 @@ public: * All attributes must derive their implementation from this class. */ struct BOOST_LOG_NO_VTABLE BOOST_SYMBOL_VISIBLE impl : - public intrusive_ref_counter + public boost::intrusive_ref_counter< impl > { + /*! + * \brief Virtual destructor + */ + virtual ~impl() {} + /*! * \return The actual attribute value. It shall not return empty values (exceptions * shall be used to indicate errors). @@ -132,7 +137,7 @@ public: /*! * Verifies that the factory is not in empty state */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Verifies that the factory is in empty state diff --git a/include/boost/log/attributes/attribute_name.hpp b/include/boost/log/attributes/attribute_name.hpp index f69ee2c..5f738b7 100644 --- a/include/boost/log/attributes/attribute_name.hpp +++ b/include/boost/log/attributes/attribute_name.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -140,7 +140,7 @@ public: * * \return \c true if *this was constructed with an attribute name, \c false otherwise */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Checks if the object was default-constructed * diff --git a/include/boost/log/attributes/attribute_value.hpp b/include/boost/log/attributes/attribute_value.hpp index 81e1a26..cc1ae66 100644 --- a/include/boost/log/attributes/attribute_value.hpp +++ b/include/boost/log/attributes/attribute_value.hpp @@ -15,11 +15,10 @@ #ifndef BOOST_LOG_ATTRIBUTE_VALUE_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTE_VALUE_HPP_INCLUDED_ -#include #include +#include #include -#include -#include +#include #include #include #include @@ -155,7 +154,7 @@ public: /*! * The operator checks if the attribute value is empty */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * The operator checks if the attribute value is empty */ diff --git a/include/boost/log/attributes/current_thread_id.hpp b/include/boost/log/attributes/current_thread_id.hpp index c16a507..ad2ea6f 100644 --- a/include/boost/log/attributes/current_thread_id.hpp +++ b/include/boost/log/attributes/current_thread_id.hpp @@ -25,7 +25,7 @@ #error Boost.Log: The current_thread_id attribute is only available in multithreaded builds #endif -#include +#include #include #include #include diff --git a/include/boost/log/attributes/mutable_constant.hpp b/include/boost/log/attributes/mutable_constant.hpp index bba5637..b80e7c3 100644 --- a/include/boost/log/attributes/mutable_constant.hpp +++ b/include/boost/log/attributes/mutable_constant.hpp @@ -15,9 +15,8 @@ #ifndef BOOST_LOG_ATTRIBUTES_MUTABLE_CONSTANT_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTES_MUTABLE_CONSTANT_HPP_INCLUDED_ -#include -#include #include +#include #include #include #include diff --git a/include/boost/log/attributes/value_visitation.hpp b/include/boost/log/attributes/value_visitation.hpp index 1e3ed0f..78e77d9 100644 --- a/include/boost/log/attributes/value_visitation.hpp +++ b/include/boost/log/attributes/value_visitation.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -71,7 +71,7 @@ public: * * \return \c true if the value was visited successfully, \c false otherwise. */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Checks if the visitation was unsuccessful. * diff --git a/include/boost/log/core/core.hpp b/include/boost/log/core/core.hpp index 9840627..a614465 100644 --- a/include/boost/log/core/core.hpp +++ b/include/boost/log/core/core.hpp @@ -16,7 +16,7 @@ #define BOOST_LOG_CORE_CORE_HPP_INCLUDED_ #include -#include +#include #include #include #include diff --git a/include/boost/log/core/record.hpp b/include/boost/log/core/record.hpp index bd4fb61..d3fc9bc 100644 --- a/include/boost/log/core/record.hpp +++ b/include/boost/log/core/record.hpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -115,7 +115,7 @@ public: * * \return \c true, if the *this identifies a log record, \c false, if the *this is not valid */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Inverted conversion to an unspecified boolean type diff --git a/include/boost/log/core/record_view.hpp b/include/boost/log/core/record_view.hpp index 1edb99c..fcc3aa4 100644 --- a/include/boost/log/core/record_view.hpp +++ b/include/boost/log/core/record_view.hpp @@ -15,10 +15,10 @@ #ifndef BOOST_LOG_CORE_RECORD_VIEW_HPP_INCLUDED_ #define BOOST_LOG_CORE_RECORD_VIEW_HPP_INCLUDED_ -#include +#include #include #include -#include +#include #include #include #ifndef BOOST_LOG_NO_THREADS @@ -184,7 +184,7 @@ public: * * \return \c true, if the *this identifies a log record, \c false, if the *this is not valid */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Inverted conversion to an unspecified boolean type diff --git a/include/boost/log/detail/light_function.hpp b/include/boost/log/detail/light_function.hpp index ba09dde..b16cf4d 100644 --- a/include/boost/log/detail/light_function.hpp +++ b/include/boost/log/detail/light_function.hpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #include @@ -244,7 +244,7 @@ public: return m_pImpl->invoke(m_pImpl, args...); } - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const BOOST_NOEXCEPT { return (m_pImpl == NULL); } bool empty() const BOOST_NOEXCEPT { return (m_pImpl == NULL); } void clear() BOOST_NOEXCEPT @@ -444,7 +444,7 @@ public: m_pImpl->invoke(m_pImpl, args...); } - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const BOOST_NOEXCEPT { return (m_pImpl == NULL); } bool empty() const BOOST_NOEXCEPT { return (m_pImpl == NULL); } void clear() BOOST_NOEXCEPT diff --git a/include/boost/log/detail/light_function_pp.hpp b/include/boost/log/detail/light_function_pp.hpp index d6aa2d4..ee776ea 100644 --- a/include/boost/log/detail/light_function_pp.hpp +++ b/include/boost/log/detail/light_function_pp.hpp @@ -189,7 +189,7 @@ public: return m_pImpl->invoke(m_pImpl BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), arg)); } - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const BOOST_NOEXCEPT { return (m_pImpl == NULL); } bool empty() const BOOST_NOEXCEPT { return (m_pImpl == NULL); } void clear() BOOST_NOEXCEPT @@ -391,7 +391,7 @@ public: m_pImpl->invoke(m_pImpl BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), arg)); } - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const BOOST_NOEXCEPT { return (m_pImpl == NULL); } bool empty() const BOOST_NOEXCEPT { return (m_pImpl == NULL); } void clear() BOOST_NOEXCEPT diff --git a/include/boost/log/detail/locking_ptr.hpp b/include/boost/log/detail/locking_ptr.hpp index 62a9c6f..c856094 100644 --- a/include/boost/log/detail/locking_ptr.hpp +++ b/include/boost/log/detail/locking_ptr.hpp @@ -16,9 +16,9 @@ #ifndef BOOST_LOG_DETAIL_LOCKING_PTR_HPP_INCLUDED_ #define BOOST_LOG_DETAIL_LOCKING_PTR_HPP_INCLUDED_ -#include +#include #include -#include +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -31,120 +31,120 @@ BOOST_LOG_OPEN_NAMESPACE namespace aux { - //! Shared lock object to support locking_ptr - struct BOOST_LOG_NO_VTABLE locking_ptr_counter_base +//! Shared lock object to support locking_ptr +struct BOOST_LOG_NO_VTABLE locking_ptr_counter_base +{ + unsigned int m_RefCounter; + + locking_ptr_counter_base() : m_RefCounter(0) { - unsigned int m_RefCounter; + } - locking_ptr_counter_base() : m_RefCounter(0) - { - } + virtual ~locking_ptr_counter_base() {} + virtual void lock() = 0; + virtual bool try_lock() = 0; + virtual void unlock() = 0; - virtual ~locking_ptr_counter_base() {} - virtual void lock() = 0; - virtual bool try_lock() = 0; - virtual void unlock() = 0; +private: + locking_ptr_counter_base(locking_ptr_counter_base const&); + locking_ptr_counter_base& operator= (locking_ptr_counter_base const&); +}; - private: - locking_ptr_counter_base(locking_ptr_counter_base const&); - locking_ptr_counter_base& operator= (locking_ptr_counter_base const&); - }; +struct try_lock_tag {}; +BOOST_CONSTEXPR_OR_CONST try_lock_tag try_lock = {}; - struct try_lock_tag {}; - const try_lock_tag try_lock = {}; +//! A pointer type that locks the backend until it's destroyed +template< typename T > +class locking_ptr +{ +public: + //! Pointed type + typedef T element_type; - //! A pointer type that locks the backend until it's destroyed - template< typename T > - class locking_ptr +private: + //! The pointer to the backend + shared_ptr< element_type > m_pElement; + //! Reference to the shared lock control object + locking_ptr_counter_base* m_pLock; + +public: + //! Constructor + locking_ptr(shared_ptr< element_type > const& p, locking_ptr_counter_base& l) + : m_pElement(p), m_pLock(&l) { - public: - //! Pointed type - typedef T element_type; - - private: - //! The pointer to the backend - shared_ptr< element_type > m_pElement; - //! Reference to the shared lock control object - locking_ptr_counter_base* m_pLock; - - public: - //! Constructor - locking_ptr(shared_ptr< element_type > const& p, locking_ptr_counter_base& l) - : m_pElement(p), m_pLock(&l) + if (m_pLock->m_RefCounter == 0) + m_pLock->lock(); + ++m_pLock->m_RefCounter; + } + //! Constructor + locking_ptr(shared_ptr< element_type > const& p, locking_ptr_counter_base& l, try_lock_tag const&) + : m_pElement(p), m_pLock(&l) + { + if (m_pLock->m_RefCounter > 0 || m_pLock->try_lock()) { - if (m_pLock->m_RefCounter == 0) - m_pLock->lock(); ++m_pLock->m_RefCounter; } - //! Constructor - locking_ptr(shared_ptr< element_type > const& p, locking_ptr_counter_base& l, try_lock_tag const&) - : m_pElement(p), m_pLock(&l) + else { - if (m_pLock->m_RefCounter > 0 || m_pLock->try_lock()) - { - ++m_pLock->m_RefCounter; - } - else - { - m_pElement.reset(); - m_pLock = NULL; - } + m_pElement.reset(); + m_pLock = NULL; } - //! Copy constructor - locking_ptr(locking_ptr const& that) : m_pElement(that.m_pElement), m_pLock(that.m_pLock) - { - if (m_pLock) - ++m_pLock->m_RefCounter; - } - //! Destructor - ~locking_ptr() - { - if (m_pLock && --m_pLock->m_RefCounter == 0) - m_pLock->unlock(); - } - - //! Assignment - locking_ptr& operator= (locking_ptr that) - { - this->swap(that); - return *this; - } - - //! Indirection - element_type* operator-> () const { return m_pElement.get(); } - //! Dereferencing - element_type& operator* () const { return *m_pElement; } - - //! Accessor to the raw pointer - element_type* get() const { return m_pElement.get(); } - - //! Checks for null pointer - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() - //! Checks for null pointer - bool operator! () const { return !m_pElement; } - - //! Swaps two pointers - void swap(locking_ptr& that) - { - m_pElement.swap(that.m_pElement); - register locking_ptr_counter_base* p = m_pLock; - m_pLock = that.m_pLock; - that.m_pLock = p; - } - }; - - //! Free raw pointer getter to assist generic programming - template< typename T > - inline T* get_pointer(locking_ptr< T > const& p) - { - return p.get(); } - //! Free swap operation - template< typename T > - inline void swap(locking_ptr< T >& left, locking_ptr< T >& right) + //! Copy constructor + locking_ptr(locking_ptr const& that) : m_pElement(that.m_pElement), m_pLock(that.m_pLock) { - left.swap(right); + if (m_pLock) + ++m_pLock->m_RefCounter; } + //! Destructor + ~locking_ptr() + { + if (m_pLock && --m_pLock->m_RefCounter == 0) + m_pLock->unlock(); + } + + //! Assignment + locking_ptr& operator= (locking_ptr that) + { + this->swap(that); + return *this; + } + + //! Indirection + element_type* operator-> () const { return m_pElement.get(); } + //! Dereferencing + element_type& operator* () const { return *m_pElement; } + + //! Accessor to the raw pointer + element_type* get() const { return m_pElement.get(); } + + //! Checks for null pointer + BOOST_EXPLICIT_OPERATOR_BOOL() + //! Checks for null pointer + bool operator! () const { return !m_pElement; } + + //! Swaps two pointers + void swap(locking_ptr& that) + { + m_pElement.swap(that.m_pElement); + register locking_ptr_counter_base* p = m_pLock; + m_pLock = that.m_pLock; + that.m_pLock = p; + } +}; + +//! Free raw pointer getter to assist generic programming +template< typename T > +inline T* get_pointer(locking_ptr< T > const& p) +{ + return p.get(); +} +//! Free swap operation +template< typename T > +inline void swap(locking_ptr< T >& left, locking_ptr< T >& right) +{ + left.swap(right); +} } // namespace aux diff --git a/include/boost/log/sinks/async_frontend.hpp b/include/boost/log/sinks/async_frontend.hpp index c64092b..7dab9b4 100644 --- a/include/boost/log/sinks/async_frontend.hpp +++ b/include/boost/log/sinks/async_frontend.hpp @@ -15,9 +15,6 @@ #ifndef BOOST_LOG_SINKS_ASYNC_FRONTEND_HPP_INCLUDED_ #define BOOST_LOG_SINKS_ASYNC_FRONTEND_HPP_INCLUDED_ -#include -#include -#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -29,6 +26,9 @@ #endif #include +#include +#include +#include #include #include #include diff --git a/include/boost/log/sinks/sync_frontend.hpp b/include/boost/log/sinks/sync_frontend.hpp index 3f70ba3..4dcef08 100644 --- a/include/boost/log/sinks/sync_frontend.hpp +++ b/include/boost/log/sinks/sync_frontend.hpp @@ -25,9 +25,9 @@ #error Boost.Log: Synchronous sink frontend is only supported in multithreaded environment #endif -#include -#include #include +#include +#include #include #include #include diff --git a/include/boost/log/sinks/syslog_backend.hpp b/include/boost/log/sinks/syslog_backend.hpp index 8778ca3..83a3ce3 100644 --- a/include/boost/log/sinks/syslog_backend.hpp +++ b/include/boost/log/sinks/syslog_backend.hpp @@ -24,7 +24,6 @@ #ifndef BOOST_LOG_WITHOUT_SYSLOG #include -#include #include #include #include diff --git a/include/boost/log/sinks/text_file_backend.hpp b/include/boost/log/sinks/text_file_backend.hpp index 9250f6f..63123e4 100644 --- a/include/boost/log/sinks/text_file_backend.hpp +++ b/include/boost/log/sinks/text_file_backend.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/boost/log/sinks/text_ostream_backend.hpp b/include/boost/log/sinks/text_ostream_backend.hpp index 8298109..3813d1b 100644 --- a/include/boost/log/sinks/text_ostream_backend.hpp +++ b/include/boost/log/sinks/text_ostream_backend.hpp @@ -16,7 +16,7 @@ #define BOOST_LOG_SINKS_TEXT_OSTREAM_BACKEND_HPP_INCLUDED_ #include -#include +#include #include #include #include diff --git a/include/boost/log/sinks/unlocked_frontend.hpp b/include/boost/log/sinks/unlocked_frontend.hpp index 0646092..53022f7 100644 --- a/include/boost/log/sinks/unlocked_frontend.hpp +++ b/include/boost/log/sinks/unlocked_frontend.hpp @@ -15,9 +15,9 @@ #ifndef BOOST_LOG_SINKS_UNLOCKED_FRONTEND_HPP_INCLUDED_ #define BOOST_LOG_SINKS_UNLOCKED_FRONTEND_HPP_INCLUDED_ -#include -#include #include +#include +#include #include #include #include diff --git a/include/boost/log/sources/basic_logger.hpp b/include/boost/log/sources/basic_logger.hpp index 86faa10..b653bb8 100644 --- a/include/boost/log/sources/basic_logger.hpp +++ b/include/boost/log/sources/basic_logger.hpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/include/boost/log/sources/global_logger_storage.hpp b/include/boost/log/sources/global_logger_storage.hpp index eff4815..d1cea91 100644 --- a/include/boost/log/sources/global_logger_storage.hpp +++ b/include/boost/log/sources/global_logger_storage.hpp @@ -17,8 +17,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/include/boost/log/sources/record_ostream.hpp b/include/boost/log/sources/record_ostream.hpp index 3ac1cef..31c0556 100644 --- a/include/boost/log/sources/record_ostream.hpp +++ b/include/boost/log/sources/record_ostream.hpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -103,7 +103,7 @@ public: * \return \c true, if stream is valid and ready for formatting, \c false, if the stream is not valid. The latter also applies to * the case when the stream is not attached to a log record. */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Inverted conversion to an unspecified boolean type diff --git a/include/boost/log/sources/severity_feature.hpp b/include/boost/log/sources/severity_feature.hpp index f846fd3..bec3837 100644 --- a/include/boost/log/sources/severity_feature.hpp +++ b/include/boost/log/sources/severity_feature.hpp @@ -16,8 +16,8 @@ #define BOOST_LOG_SOURCES_SEVERITY_FEATURE_HPP_INCLUDED_ #include -#include #include +#include #include #include #include diff --git a/include/boost/log/utility/empty_deleter.hpp b/include/boost/log/utility/empty_deleter.hpp index 60aafab..1acfd63 100644 --- a/include/boost/log/utility/empty_deleter.hpp +++ b/include/boost/log/utility/empty_deleter.hpp @@ -9,36 +9,31 @@ * \author Andrey Semashev * \date 22.04.2007 * - * This header contains an \c empty_deleter implementation. This is an empty - * function object that receives a pointer and does nothing with it. - * Such empty deletion strategy may be convenient, for example, when - * constructing shared_ptrs that point to some object that should not be - * deleted (i.e. a variable on the stack or some global singleton, like std::cout). + * This header is deprecated, use boost/utility/empty_deleter.hpp instead. The header is left for + * backward compatibility and will be removed in future versions. */ #ifndef BOOST_LOG_UTILITY_EMPTY_DELETER_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_EMPTY_DELETER_HPP_INCLUDED_ +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif +#if defined(__GNUC__) +#pragma message "Boost.Log: This header is deprecated, use boost/utility/empty_deleter.hpp instead." +#elif defined(_MSC_VER) +#pragma message("Boost.Log: This header is deprecated, use boost/utility/empty_deleter.hpp instead.") +#endif + namespace boost { BOOST_LOG_OPEN_NAMESPACE -//! A function object that does nothing and can be used as an empty deleter for \c shared_ptr -struct empty_deleter -{ - //! Function object result type - typedef void result_type; - /*! - * Does nothing - */ - void operator() (const volatile void*) const {} -}; +using boost::empty_deleter BOOST_LOG_CLOSE_NAMESPACE // namespace log diff --git a/include/boost/log/utility/explicit_operator_bool.hpp b/include/boost/log/utility/explicit_operator_bool.hpp index c9aec45..ce7c98a 100644 --- a/include/boost/log/utility/explicit_operator_bool.hpp +++ b/include/boost/log/utility/explicit_operator_bool.hpp @@ -9,22 +9,25 @@ * \author Andrey Semashev * \date 08.03.2009 * - * This header defines a compatibility macro that implements an unspecified - * \c bool operator idiom, which is superseded with explicit conversion operators in - * C++0x. + * This header is deprecated, use boost/utility/explicit_operator_bool.hpp instead. The header is left for + * backward compatibility and will be removed in future versions. */ #ifndef BOOST_LOG_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP_INCLUDED_ +#include #include -#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -#if defined(BOOST_LOG_DOXYGEN_PASS) || !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) +#if defined(__GNUC__) +#pragma message "Boost.Log: This header is deprecated, use boost/utility/explicit_operator_bool.hpp instead." +#elif defined(_MSC_VER) +#pragma message("Boost.Log: This header is deprecated, use boost/utility/explicit_operator_bool.hpp instead.") +#endif /*! * \brief The macro defines an explicit operator of conversion to \c bool @@ -34,71 +37,6 @@ * in terms of which the conversion operator will be implemented. */ #define BOOST_LOG_EXPLICIT_OPERATOR_BOOL()\ - BOOST_FORCEINLINE explicit operator bool () const\ - {\ - return !this->operator! ();\ - } - -#elif !defined(BOOST_LOG_NO_UNSPECIFIED_BOOL) - -namespace boost { - -BOOST_LOG_OPEN_NAMESPACE - -namespace aux { - -#if !defined(_MSC_VER) - - struct unspecified_bool - { - // NOTE TO THE USER: If you see this in error messages then you tried - // to apply an unsupported operator on the object that supports - // explicit conversion to bool. - struct OPERATORS_NOT_ALLOWED; - static void true_value(OPERATORS_NOT_ALLOWED*) {} - }; - typedef void (*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*); - -#else - - // MSVC is too eager to convert pointer to function to void* even though it shouldn't - struct unspecified_bool - { - // NOTE TO THE USER: If you see this in error messages then you tried - // to apply an unsupported operator on the object that supports - // explicit conversion to bool. - struct OPERATORS_NOT_ALLOWED; - void true_value(OPERATORS_NOT_ALLOWED*) {} - }; - typedef void (unspecified_bool::*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*); - -#endif - -} // namespace aux - -BOOST_LOG_CLOSE_NAMESPACE // namespace log - -} // namespace boost - -#define BOOST_LOG_EXPLICIT_OPERATOR_BOOL()\ - BOOST_FORCEINLINE operator boost::log::aux::unspecified_bool_type () const\ - {\ - if (!this->operator!())\ - return &boost::log::aux::unspecified_bool::true_value;\ - else\ - return 0;\ - } - -#else - -#define BOOST_LOG_EXPLICIT_OPERATOR_BOOL()\ - BOOST_FORCEINLINE operator bool () const\ - {\ - return !this->operator! ();\ - } - -#endif - -#include + BOOST_EXPLICIT_OPERATOR_BOOL() #endif // BOOST_LOG_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP_INCLUDED_ diff --git a/include/boost/log/utility/formatting_ostream.hpp b/include/boost/log/utility/formatting_ostream.hpp index cec46d9..f3dfd0a 100644 --- a/include/boost/log/utility/formatting_ostream.hpp +++ b/include/boost/log/utility/formatting_ostream.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -276,7 +276,7 @@ public: static bool sync_with_stdio(bool sync = true) { return ostream_type::sync_with_stdio(sync); } // std::basic_ios method forwarders - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const { return !m_stream; } iostate rdstate() const { return m_stream.rdstate(); } @@ -545,6 +545,24 @@ private: m_stream.fill(static_cast< char_type >(' ')); } + basic_formatting_ostream& formatted_write(const char_type* p, std::streamsize size) + { + sentry guard(*this); + if (guard) + { + m_stream.flush(); + + if (m_stream.width() <= size) + m_streambuf.storage()->append(p, static_cast< std::size_t >(size)); + else + this->aligned_write(p, size); + + m_stream.width(0); + } + + return *this; + } + template< typename OtherCharT > basic_formatting_ostream& formatted_write(const OtherCharT* p, std::streamsize size) { @@ -552,26 +570,11 @@ private: if (guard) { m_stream.flush(); - string_type* const storage = m_streambuf.storage(); - const std::streamsize w = m_stream.width(); - if (w <= size) - { - aux::code_convert(p, static_cast< std::size_t >(size), *storage, m_stream.getloc()); - } + if (m_stream.width() <= size) + aux::code_convert(p, static_cast< std::size_t >(size), *m_streambuf.storage(), m_stream.getloc()); else - { - const bool align_left = (m_stream.flags() & ostream_type::adjustfield) == ostream_type::left; - typename string_type::size_type const alignment_size = - static_cast< typename string_type::size_type >(w - size); - if (!align_left) - storage->append(alignment_size, m_stream.fill()); - - aux::code_convert(p, static_cast< std::size_t >(size), *storage, m_stream.getloc()); - - if (align_left) - storage->append(alignment_size, m_stream.fill()); - } + this->aligned_write(p, size); m_stream.width(0); } @@ -579,6 +582,11 @@ private: return *this; } + void aligned_write(const char_type* p, std::streamsize size); + + template< typename OtherCharT > + void aligned_write(const OtherCharT* p, std::streamsize size); + //! Copy constructor (closed) BOOST_DELETED_FUNCTION(basic_formatting_ostream(basic_formatting_ostream const& that)) //! Assignment (closed) @@ -656,6 +664,44 @@ BOOST_CONSTEXPR_OR_CONST typename basic_formatting_ostream< CharT, TraitsT, Allo template< typename CharT, typename TraitsT, typename AllocatorT > BOOST_CONSTEXPR_OR_CONST typename basic_formatting_ostream< CharT, TraitsT, AllocatorT >::event basic_formatting_ostream< CharT, TraitsT, AllocatorT >::copyfmt_event; +template< typename CharT, typename TraitsT, typename AllocatorT > +void basic_formatting_ostream< CharT, TraitsT, AllocatorT >::aligned_write(const char_type* p, std::streamsize size) +{ + string_type* const storage = m_streambuf.storage(); + typename string_type::size_type const alignment_size = + static_cast< typename string_type::size_type >(m_stream.width() - size); + const bool align_left = (m_stream.flags() & ostream_type::adjustfield) == ostream_type::left; + if (align_left) + { + storage->append(p, static_cast< std::size_t >(size)); + storage->append(alignment_size, m_stream.fill()); + } + else + { + storage->append(alignment_size, m_stream.fill()); + storage->append(p, static_cast< std::size_t >(size)); + } +} + +template< typename CharT, typename TraitsT, typename AllocatorT > +template< typename OtherCharT > +void basic_formatting_ostream< CharT, TraitsT, AllocatorT >::aligned_write(const OtherCharT* p, std::streamsize size) +{ + string_type* const storage = m_streambuf.storage(); + typename string_type::size_type const alignment_size = + static_cast< typename string_type::size_type >(m_stream.width() - size); + const bool align_left = (m_stream.flags() & ostream_type::adjustfield) == ostream_type::left; + if (align_left) + { + aux::code_convert(p, static_cast< std::size_t >(size), *storage, m_stream.getloc()); + storage->append(alignment_size, m_stream.fill()); + } + else + { + storage->append(alignment_size, m_stream.fill()); + aux::code_convert(p, static_cast< std::size_t >(size), *storage, m_stream.getloc()); + } +} template< typename CharT, typename TraitsT, typename AllocatorT, typename T > inline basic_formatting_ostream< CharT, TraitsT, AllocatorT >& diff --git a/include/boost/log/utility/functional/nop.hpp b/include/boost/log/utility/functional/nop.hpp index 4cd876b..aae10f9 100644 --- a/include/boost/log/utility/functional/nop.hpp +++ b/include/boost/log/utility/functional/nop.hpp @@ -31,18 +31,18 @@ struct nop { typedef void result_type; - void operator() () const {} + void operator() () const BOOST_NOEXCEPT {} #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template< typename... ArgsT > - void operator() (ArgsT const&...) const {} + void operator() (ArgsT const&...) const BOOST_NOEXCEPT {} #else template< typename T > - void operator() (T const&) const {} + void operator() (T const&) const BOOST_NOEXCEPT {} template< typename T1, typename T2 > - void operator() (T1 const&, T2 const&) const {} + void operator() (T1 const&, T2 const&) const BOOST_NOEXCEPT {} template< typename T1, typename T2, typename T3 > - void operator() (T1 const&, T2 const&, T3 const&) const {} + void operator() (T1 const&, T2 const&, T3 const&) const BOOST_NOEXCEPT {} #endif }; diff --git a/include/boost/log/utility/intrusive_ref_counter.hpp b/include/boost/log/utility/intrusive_ref_counter.hpp index 006fff2..71d513d 100644 --- a/include/boost/log/utility/intrusive_ref_counter.hpp +++ b/include/boost/log/utility/intrusive_ref_counter.hpp @@ -9,109 +9,42 @@ * \author Andrey Semashev * \date 12.03.2009 * - * This header contains a reference counter class for \c intrusive_ptr. + * This header is deprecated, use boost/smart_ptr/intrusive_ref_counter.hpp instead. The header is left for + * backward compatibility and will be removed in future versions. */ #ifndef BOOST_LOG_UTILITY_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_ -#include +#include +#include #include -#ifndef BOOST_LOG_NO_THREADS -#include -#endif // BOOST_LOG_NO_THREADS #include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif +#if defined(__GNUC__) +#pragma message "Boost.Log: This header is deprecated, use boost/smart_ptr/intrusive_ref_counter.hpp instead." +#elif defined(_MSC_VER) +#pragma message("Boost.Log: This header is deprecated, use boost/smart_ptr/intrusive_ref_counter.hpp instead.") +#endif + namespace boost { BOOST_LOG_OPEN_NAMESPACE -class intrusive_ref_counter; +namespace aux { -#ifndef BOOST_LOG_DOXYGEN_PASS -void intrusive_ptr_add_ref(const intrusive_ref_counter* p); -void intrusive_ptr_release(const intrusive_ref_counter* p); -#endif // BOOST_LOG_DOXYGEN_PASS - -/*! - * \brief A reference counter base class - * - * This base class can be used with user-defined classes to add support - * for \c intrusive_ptr. The class contains a thread-safe reference counter - * and a virtual destructor, which makes the derived class polymorphic. - * Upon releasing the last \c intrusive_ptr referencing the object - * derived from the \c intrusive_ref_counter class, operator \c delete - * is automatically called on the pointer to the object. - */ -class intrusive_ref_counter +struct legacy_intrusive_ref_counter_root { -private: - //! Reference counter -#ifndef BOOST_LOG_NO_THREADS - mutable boost::detail::atomic_count m_RefCounter; -#else - mutable unsigned long m_RefCounter; -#endif // BOOST_LOG_NO_THREADS - -public: - /*! - * Default constructor - * - * \post use_count() == 0 - */ - intrusive_ref_counter() : m_RefCounter(0) - { - } - /*! - * Copy constructor - * - * \post use_count() == 0 - */ - intrusive_ref_counter(intrusive_ref_counter const&) : m_RefCounter(0) - { - } - - /*! - * Virtual destructor - */ - virtual ~intrusive_ref_counter() {} - - /*! - * Assignment - * - * \post The reference counter is not modified after assignment - */ - intrusive_ref_counter& operator= (intrusive_ref_counter const&) { return *this; } - - /*! - * \return The reference counter - */ - unsigned long use_count() const - { - return static_cast< unsigned long >(static_cast< long >(m_RefCounter)); - } - -#ifndef BOOST_LOG_DOXYGEN_PASS - friend void intrusive_ptr_add_ref(const intrusive_ref_counter* p); - friend void intrusive_ptr_release(const intrusive_ref_counter* p); -#endif // BOOST_LOG_DOXYGEN_PASS + virtual ~legacy_intrusive_ref_counter_root() {} }; -#ifndef BOOST_LOG_DOXYGEN_PASS -inline void intrusive_ptr_add_ref(const intrusive_ref_counter* p) -{ - ++p->m_RefCounter; -} -inline void intrusive_ptr_release(const intrusive_ref_counter* p) -{ - if (--p->m_RefCounter == 0) - delete p; -} -#endif // BOOST_LOG_DOXYGEN_PASS +} // namespace aux + +typedef boost::intrusive_ref_counter< aux::legacy_intrusive_ref_counter_root > intrusive_ref_counter; BOOST_LOG_CLOSE_NAMESPACE // namespace log diff --git a/include/boost/log/utility/setup/console.hpp b/include/boost/log/utility/setup/console.hpp index ee8d219..6d537ce 100644 --- a/include/boost/log/utility/setup/console.hpp +++ b/include/boost/log/utility/setup/console.hpp @@ -16,8 +16,9 @@ #define BOOST_LOG_UTILITY_SETUP_CONSOLE_HPP_INCLUDED_ #include -#include -#include +#include +#include +#include #include #include #ifndef BOOST_LOG_NO_THREADS @@ -26,7 +27,6 @@ #include #endif #include -#include #include #include #include @@ -59,7 +59,7 @@ shared_ptr< > > add_console_log(std::basic_ostream< CharT >& strm, ArgsT const& args) { - shared_ptr< std::basic_ostream< CharT > > pStream(&strm, empty_deleter()); + shared_ptr< std::basic_ostream< CharT > > pStream(&strm, boost::empty_deleter()); typedef sinks::basic_text_ostream_backend< CharT > backend_t; shared_ptr< backend_t > pBackend = boost::make_shared< backend_t >(); diff --git a/include/boost/log/utility/setup/file.hpp b/include/boost/log/utility/setup/file.hpp index 6ecb70a..cec5cd8 100644 --- a/include/boost/log/utility/setup/file.hpp +++ b/include/boost/log/utility/setup/file.hpp @@ -15,8 +15,8 @@ #ifndef BOOST_LOG_UTILITY_SETUP_FILE_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_SETUP_FILE_HPP_INCLUDED_ -#include -#include +#include +#include #include // for is_named_argument #include #include diff --git a/include/boost/log/utility/setup/filter_parser.hpp b/include/boost/log/utility/setup/filter_parser.hpp index 6c9d1c4..090dfd2 100644 --- a/include/boost/log/utility/setup/filter_parser.hpp +++ b/include/boost/log/utility/setup/filter_parser.hpp @@ -16,9 +16,9 @@ #define BOOST_LOG_UTILITY_SETUP_FILTER_PARSER_HPP_INCLUDED_ #include -#include -#include #include +#include +#include #include #include #include diff --git a/include/boost/log/utility/setup/formatter_parser.hpp b/include/boost/log/utility/setup/formatter_parser.hpp index 66a1561..b6d8fe3 100644 --- a/include/boost/log/utility/setup/formatter_parser.hpp +++ b/include/boost/log/utility/setup/formatter_parser.hpp @@ -19,8 +19,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/include/boost/log/utility/setup/from_settings.hpp b/include/boost/log/utility/setup/from_settings.hpp index 83f91a4..1aaa8e1 100644 --- a/include/boost/log/utility/setup/from_settings.hpp +++ b/include/boost/log/utility/setup/from_settings.hpp @@ -17,7 +17,7 @@ #define BOOST_LOG_UTILITY_SETUP_FROM_SETTINGS_HPP_INCLUDED_ #include -#include +#include #include #include #include diff --git a/include/boost/log/utility/setup/settings.hpp b/include/boost/log/utility/setup/settings.hpp index b6ff0d1..e7eca3d 100644 --- a/include/boost/log/utility/setup/settings.hpp +++ b/include/boost/log/utility/setup/settings.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #if !defined(BOOST_LOG_TYPEOF) #include #endif @@ -175,7 +175,7 @@ private: return *this; } - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const { @@ -368,7 +368,7 @@ public: /*! * Checks if the section refers to the container. */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Checks if the section refers to the container. diff --git a/include/boost/log/utility/string_literal.hpp b/include/boost/log/utility/string_literal.hpp index f476895..14efbfe 100644 --- a/include/boost/log/utility/string_literal.hpp +++ b/include/boost/log/utility/string_literal.hpp @@ -92,7 +92,7 @@ public: * * \post empty() == true */ - basic_string_literal() { clear(); } + basic_string_literal() BOOST_NOEXCEPT { clear(); } /*! * Constructor from a string literal @@ -105,7 +105,7 @@ public: //! \cond , typename enable_if< is_same< T, const value_type >, int >::type = 0 //! \endcond - ) + ) BOOST_NOEXCEPT : m_pStart(p), m_Len(LenV - 1) { } @@ -116,7 +116,7 @@ public: * \post *this == that * \param that Source literal to copy string from */ - basic_string_literal(basic_string_literal const& that) : m_pStart(that.m_pStart), m_Len(that.m_Len) {} + basic_string_literal(basic_string_literal const& that) BOOST_NOEXCEPT : m_pStart(that.m_pStart), m_Len(that.m_Len) {} /*! * Assignment operator @@ -124,7 +124,7 @@ public: * \post *this == that * \param that Source literal to copy string from */ - this_type& operator= (this_type const& that) + this_type& operator= (this_type const& that) BOOST_NOEXCEPT { return assign(that); } @@ -143,7 +143,7 @@ public: #else this_type& #endif // BOOST_LOG_DOXYGEN_PASS - operator= (T(&p)[LenV]) + operator= (T(&p)[LenV]) BOOST_NOEXCEPT { return assign(p); } @@ -154,7 +154,7 @@ public: * \param that Comparand * \return \c true if the comparand string equals to this string, \c false otherwise */ - bool operator== (this_type const& that) const + bool operator== (this_type const& that) const BOOST_NOEXCEPT { return (compare_internal(m_pStart, m_Len, that.m_pStart, that.m_Len) == 0); } @@ -164,7 +164,7 @@ public: * \param str Comparand. Must point to a zero-terminated sequence of characters, must not be NULL. * \return \c true if the comparand string equals to this string, \c false otherwise */ - bool operator== (const_pointer str) const + bool operator== (const_pointer str) const BOOST_NOEXCEPT { return (compare_internal(m_pStart, m_Len, str, traits_type::length(str)) == 0); } @@ -185,7 +185,7 @@ public: * \param that Comparand * \return \c true if this string is less than the comparand, \c false otherwise */ - bool operator< (this_type const& that) const + bool operator< (this_type const& that) const BOOST_NOEXCEPT { return (compare_internal(m_pStart, m_Len, that.m_pStart, that.m_Len) < 0); } @@ -195,7 +195,7 @@ public: * \param str Comparand. Must point to a zero-terminated sequence of characters, must not be NULL. * \return \c true if this string is less than the comparand, \c false otherwise */ - bool operator< (const_pointer str) const + bool operator< (const_pointer str) const BOOST_NOEXCEPT { return (compare_internal(m_pStart, m_Len, str, traits_type::length(str)) < 0); } @@ -216,7 +216,7 @@ public: * \param that Comparand * \return \c true if this string is greater than the comparand, \c false otherwise */ - bool operator> (this_type const& that) const + bool operator> (this_type const& that) const BOOST_NOEXCEPT { return (compare_internal(m_pStart, m_Len, that.m_pStart, that.m_Len) > 0); } @@ -226,7 +226,7 @@ public: * \param str Comparand. Must point to a zero-terminated sequence of characters, must not be NULL. * \return \c true if this string is greater than the comparand, \c false otherwise */ - bool operator> (const_pointer str) const + bool operator> (const_pointer str) const BOOST_NOEXCEPT { return (compare_internal(m_pStart, m_Len, str, traits_type::length(str)) > 0); } @@ -248,7 +248,7 @@ public: * \param i Requested character index * \return Constant reference to the requested character */ - const_reference operator[] (size_type i) const + const_reference operator[] (size_type i) const BOOST_NOEXCEPT { return m_pStart[i]; } @@ -270,24 +270,24 @@ public: /*! * \return Pointer to the beginning of the literal */ - const_pointer c_str() const { return m_pStart; } + const_pointer c_str() const BOOST_NOEXCEPT { return m_pStart; } /*! * \return Pointer to the beginning of the literal */ - const_pointer data() const { return m_pStart; } + const_pointer data() const BOOST_NOEXCEPT { return m_pStart; } /*! * \return Length of the literal */ - size_type size() const { return m_Len; } + size_type size() const BOOST_NOEXCEPT { return m_Len; } /*! * \return Length of the literal */ - size_type length() const { return m_Len; } + size_type length() const BOOST_NOEXCEPT { return m_Len; } /*! * \return \c true if the literal is an empty string, \c false otherwise */ - bool empty() const + bool empty() const BOOST_NOEXCEPT { return (m_Len == 0); } @@ -295,19 +295,19 @@ public: /*! * \return Iterator that points to the first character of the literal */ - const_iterator begin() const { return m_pStart; } + const_iterator begin() const BOOST_NOEXCEPT { return m_pStart; } /*! * \return Iterator that points after the last character of the literal */ - const_iterator end() const { return m_pStart + m_Len; } + const_iterator end() const BOOST_NOEXCEPT { return m_pStart + m_Len; } /*! * \return Reverse iterator that points to the last character of the literal */ - const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } + const_reverse_iterator rbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); } /*! * \return Reverse iterator that points before the first character of the literal */ - const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } + const_reverse_iterator rend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); } /*! * \return STL string constructed from the literal @@ -322,7 +322,7 @@ public: * * \post empty() == true */ - void clear() + void clear() BOOST_NOEXCEPT { m_pStart = g_EmptyString; m_Len = 0; @@ -330,7 +330,7 @@ public: /*! * The method swaps two literals */ - void swap(this_type& that) + void swap(this_type& that) BOOST_NOEXCEPT { register const_pointer p = m_pStart; m_pStart = that.m_pStart; @@ -347,7 +347,7 @@ public: * \post *this == that * \param that Source literal to copy string from */ - this_type& assign(this_type const& that) + this_type& assign(this_type const& that) BOOST_NOEXCEPT { m_pStart = that.m_pStart; m_Len = that.m_Len; @@ -368,7 +368,7 @@ public: #else this_type& #endif // BOOST_LOG_DOXYGEN_PASS - assign(T(&p)[LenV]) + assign(T(&p)[LenV]) BOOST_NOEXCEPT { m_pStart = p; m_Len = LenV - 1; @@ -436,7 +436,7 @@ public: * * \b Throws: An std::exception-based exception if \a pos is out of range. */ - int compare(size_type pos, size_type n, const_pointer str) const + int compare(size_type pos, size_type n, const_pointer str) const BOOST_NOEXCEPT { return compare(pos, n, str, traits_type::length(str)); } @@ -452,7 +452,7 @@ public: * * \b Throws: An std::exception-based exception if \a pos is out of range. */ - int compare(size_type pos, size_type n, this_type const& that) const + int compare(size_type pos, size_type n, this_type const& that) const BOOST_NOEXCEPT { return compare(pos, n, that.c_str(), that.size()); } @@ -464,7 +464,7 @@ public: * \return Zero if the comparand equals this string, a negative value if this string is less than the comparand, * a positive value if this string is greater than the comparand. */ - int compare(const_pointer str, size_type len) const + int compare(const_pointer str, size_type len) const BOOST_NOEXCEPT { return compare(0, m_Len, str, len); } @@ -475,7 +475,7 @@ public: * \return Zero if the comparand equals this string, a negative value if this string is less than the comparand, * a positive value if this string is greater than the comparand. */ - int compare(const_pointer str) const + int compare(const_pointer str) const BOOST_NOEXCEPT { return compare(0, m_Len, str, traits_type::length(str)); } @@ -486,7 +486,7 @@ public: * \return Zero if the comparand equals this string, a negative value if this string is less than the comparand, * a positive value if this string is greater than the comparand. */ - int compare(this_type const& that) const + int compare(this_type const& that) const BOOST_NOEXCEPT { return compare(0, m_Len, that.c_str(), that.size()); } @@ -494,7 +494,7 @@ public: private: #ifndef BOOST_LOG_DOXYGEN_PASS //! Internal comparison implementation - static int compare_internal(const_pointer pLeft, size_type LeftLen, const_pointer pRight, size_type RightLen) + static int compare_internal(const_pointer pLeft, size_type LeftLen, const_pointer pRight, size_type RightLen) BOOST_NOEXCEPT { if (pLeft != pRight) { @@ -503,7 +503,7 @@ private: if (result != 0) return result; } - return static_cast< int >(LeftLen - RightLen); + return LeftLen < RightLen ? -1 : (LeftLen > RightLen ? 1 : 0); } #endif // BOOST_LOG_DOXYGEN_PASS }; @@ -512,20 +512,64 @@ template< typename CharT, typename TraitsT > typename basic_string_literal< CharT, TraitsT >::value_type const basic_string_literal< CharT, TraitsT >::g_EmptyString[1] = { 0 }; +namespace aux { + +template< typename CharT, typename TraitsT > +inline void insert_fill_chars(std::basic_ostream< CharT, TraitsT >& strm, std::size_t n) +{ + enum { chunk_size = 8 }; + CharT fill_chars[chunk_size]; + const CharT filler = strm.fill(); + for (unsigned int i = 0; i < chunk_size; ++i) + fill_chars[i] = filler; + for (; n >= chunk_size && strm.good(); n -= chunk_size) + strm.write(fill_chars, static_cast< std::size_t >(chunk_size)); + if (n > 0 && strm.good()) + strm.write(fill_chars, n); +} + +template< typename CharT, typename TraitsT > +void insert_aligned(std::basic_ostream< CharT, TraitsT >& strm, const CharT* p, std::size_t size) +{ + const std::size_t alignment_size = static_cast< std::size_t >(strm.width()) - size; + const bool align_left = (strm.flags() & std::basic_ostream< CharT, TraitsT >::adjustfield) == std::basic_ostream< CharT, TraitsT >::left; + if (align_left) + { + strm.write(p, size); + if (strm.good()) + aux::insert_fill_chars(strm, alignment_size); + } + else + { + aux::insert_fill_chars(strm, alignment_size); + if (strm.good()) + strm.write(p, size); + } +} + +} // namespace aux + //! Output operator template< typename CharT, typename StrmTraitsT, typename LitTraitsT > inline std::basic_ostream< CharT, StrmTraitsT >& operator<< ( std::basic_ostream< CharT, StrmTraitsT >& strm, basic_string_literal< CharT, LitTraitsT > const& lit) { - strm.write(lit.c_str(), static_cast< std::streamsize >(lit.size())); + if (strm.good()) + { + const std::size_t size = lit.size(); + const std::size_t w = static_cast< std::size_t >(strm.width()); + if (w <= size) + strm.write(lit.c_str(), static_cast< std::streamsize >(size)); + else + aux::insert_aligned(strm, lit.c_str(), lit.size()); + strm.width(0); + } return strm; } //! External swap template< typename CharT, typename TraitsT > -inline void swap( - basic_string_literal< CharT, TraitsT >& left, - basic_string_literal< CharT, TraitsT >& right) +inline void swap(basic_string_literal< CharT, TraitsT >& left, basic_string_literal< CharT, TraitsT >& right) BOOST_NOEXCEPT { left.swap(right); } 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 312760f..422b221 100644 --- a/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp @@ -19,8 +19,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/include/boost/log/utility/type_dispatch/type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/type_dispatcher.hpp index fc4c642..8ff3610 100644 --- a/include/boost/log/utility/type_dispatch/type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/type_dispatcher.hpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -112,7 +112,7 @@ public: (caster.as_trampoline)(this->m_pVisitor, value); } - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() bool operator! () const { return (this->m_pVisitor == 0); } }; @@ -136,7 +136,7 @@ public: /*! * The operator checks if the visitor is attached to a receiver */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * The operator checks if the visitor is not attached to a receiver diff --git a/include/boost/log/utility/type_info_wrapper.hpp b/include/boost/log/utility/type_info_wrapper.hpp index d075289..c5d2112 100644 --- a/include/boost/log/utility/type_info_wrapper.hpp +++ b/include/boost/log/utility/type_info_wrapper.hpp @@ -17,8 +17,8 @@ #include #include +#include #include -#include #ifdef BOOST_LOG_HAS_CXXABI_H #include @@ -93,7 +93,7 @@ public: * \return \c true if the type info wrapper was initialized with a particular type, * \c false if the wrapper was default-constructed and not yet initialized */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * Stored type info getter diff --git a/include/boost/log/utility/value_ref.hpp b/include/boost/log/utility/value_ref.hpp index 79aaf58..5013d22 100644 --- a/include/boost/log/utility/value_ref.hpp +++ b/include/boost/log/utility/value_ref.hpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -447,7 +447,7 @@ public: /*! * The operator verifies if the wrapper refers to a value. */ - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() + BOOST_EXPLICIT_OPERATOR_BOOL() /*! * The operator verifies if the wrapper does not refer to a value. diff --git a/src/attribute_name.cpp b/src/attribute_name.cpp index 9a4ab16..52965a8 100644 --- a/src/attribute_name.cpp +++ b/src/attribute_name.cpp @@ -18,9 +18,9 @@ #include #include #include -#include -#include #include +#include +#include #include #include #include diff --git a/src/core.cpp b/src/core.cpp index be2ab2a..c4c5cc4 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -20,9 +20,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/default_attribute_names.cpp b/src/default_attribute_names.cpp index 6fb1170..9bb364c 100644 --- a/src/default_attribute_names.cpp +++ b/src/default_attribute_names.cpp @@ -13,7 +13,7 @@ * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ -#include +#include #include #include #include diff --git a/src/init_from_settings.cpp b/src/init_from_settings.cpp index f4492f2..e1f3c51 100644 --- a/src/init_from_settings.cpp +++ b/src/init_from_settings.cpp @@ -29,8 +29,9 @@ #include #include #include -#include -#include +#include +#include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -312,7 +312,7 @@ private: typedef boost::log::aux::char_constants< BackendCharT > constants; typedef sinks::basic_text_ostream_backend< BackendCharT > backend_t; shared_ptr< backend_t > backend = boost::make_shared< backend_t >(); - backend->add_stream(shared_ptr< typename backend_t::stream_type >(&constants::get_console_log_stream(), empty_deleter())); + backend->add_stream(shared_ptr< typename backend_t::stream_type >(&constants::get_console_log_stream(), boost::empty_deleter())); // Auto flush if (optional< string_type > auto_flush_param = params["AutoFlush"]) diff --git a/src/named_scope.cpp b/src/named_scope.cpp index 0941183..34daeaa 100644 --- a/src/named_scope.cpp +++ b/src/named_scope.cpp @@ -15,10 +15,7 @@ #include #include -#include -#include -#include -#include +#include #include #include #include diff --git a/src/syslog_backend.cpp b/src/syslog_backend.cpp index 489191b..79931ae 100644 --- a/src/syslog_backend.cpp +++ b/src/syslog_backend.cpp @@ -22,9 +22,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #if !defined(BOOST_LOG_NO_ASIO) #include diff --git a/src/text_file_backend.cpp b/src/text_file_backend.cpp index 3d025dc..534d7ec 100644 --- a/src/text_file_backend.cpp +++ b/src/text_file_backend.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/unhandled_exception_count.cpp b/src/unhandled_exception_count.cpp index 882dd32..10bd914 100644 --- a/src/unhandled_exception_count.cpp +++ b/src/unhandled_exception_count.cpp @@ -31,7 +31,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { #if defined(BOOST_LOG_HAS_CXXABI_H) // MinGW GCC 4.4 seem to not work the same way the newer GCC versions do. As a result, __cxa_get_globals based implementation will always return 0. -// Just disable it for now and fall back to std::unhandled_exception(). +// Just disable it for now and fall back to std::uncaught_exception(). #if !defined(__MINGW32__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))) // Only GCC 4.7 declares __cxa_get_globals() in cxxabi.h, older compilers do not expose this function but it's there #define BOOST_LOG_HAS_CXA_GET_GLOBALS @@ -55,7 +55,7 @@ BOOST_LOG_API unsigned int unhandled_exception_count() BOOST_NOEXCEPT return *(reinterpret_cast< const unsigned int* >(static_cast< const char* >(_getptd()) + (sizeof(void*) == 8 ? 0x100 : 0x90))); // _tiddata::_ProcessingThrow, x32 offset - 0x90, x64 - 0x100 #else // Portable implementation. Does not allow to detect multiple nested exceptions. - return static_cast< unsigned int >(std::unhandled_exception()); + return static_cast< unsigned int >(std::uncaught_exception()); #endif } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 5052a0a..3d6561d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -15,10 +15,14 @@ project msvc:_SCL_SECURE_NO_DEPRECATE 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 intel-win:_CRT_SECURE_NO_DEPRECATE + darwin:-ftemplate-depth-1024 + gcc:-ftemplate-depth-1024 gcc:-fno-strict-aliasing # avoids strict aliasing violations in other Boost components /boost/log//boost_log /boost/log//boost_log_setup diff --git a/test/compile/util_explicit_operator_bool.cpp b/test/compile/util_explicit_operator_bool.cpp deleted file mode 100644 index 61f812d..0000000 --- a/test/compile/util_explicit_operator_bool.cpp +++ /dev/null @@ -1,43 +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 util_explicit_operator_bool.cpp - * \author Andrey Semashev - * \date 17.07.2010 - * - * \brief This test checks that explicit operator bool can be used in - * the valid contexts. - */ - -#define BOOST_TEST_MODULE util_explicit_operator_bool - -#include - -namespace { - - // A test object that has the operator of explicit conversion to bool - struct checkable - { - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() - bool operator! () const - { - return false; - } - }; - -} // namespace - -int main(int, char*[]) -{ - checkable val; - if (val) - { - return 1; - } - - return 0; -} diff --git a/test/compile_fail/util_explicit_operator_bool_conv_int.cpp b/test/compile_fail/util_explicit_operator_bool_conv_int.cpp deleted file mode 100644 index 5ac5631..0000000 --- a/test/compile_fail/util_explicit_operator_bool_conv_int.cpp +++ /dev/null @@ -1,40 +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 util_explicit_operator_bool_conv_int.cpp - * \author Andrey Semashev - * \date 17.07.2010 - * - * \brief This test checks that explicit operator bool cannot be used in - * an unintended context. - */ - -#define BOOST_TEST_MODULE util_explicit_operator_bool_conv_int - -#include - -namespace { - - // A test object that has the operator of explicit conversion to bool - struct checkable - { - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() - bool operator! () const - { - return false; - } - }; - -} // namespace - -int main(int, char*[]) -{ - checkable val; - int n = val; - - return 0; -} diff --git a/test/compile_fail/util_explicit_operator_bool_conv_pvoid.cpp b/test/compile_fail/util_explicit_operator_bool_conv_pvoid.cpp deleted file mode 100644 index 7046b4b..0000000 --- a/test/compile_fail/util_explicit_operator_bool_conv_pvoid.cpp +++ /dev/null @@ -1,40 +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 util_explicit_operator_bool_conv_pvoid.cpp - * \author Andrey Semashev - * \date 17.07.2010 - * - * \brief This test checks that explicit operator bool cannot be used in - * an unintended context. - */ - -#define BOOST_TEST_MODULE util_explicit_operator_bool_conv_pvoid - -#include - -namespace { - - // A test object that has the operator of explicit conversion to bool - struct checkable - { - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() - bool operator! () const - { - return false; - } - }; - -} // namespace - -int main(int, char*[]) -{ - checkable val; - void* p = val; - - return 0; -} diff --git a/test/compile_fail/util_explicit_operator_bool_delete.cpp b/test/compile_fail/util_explicit_operator_bool_delete.cpp deleted file mode 100644 index 9bd58d1..0000000 --- a/test/compile_fail/util_explicit_operator_bool_delete.cpp +++ /dev/null @@ -1,40 +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 util_explicit_operator_bool_delete.cpp - * \author Andrey Semashev - * \date 17.07.2010 - * - * \brief This test checks that explicit operator bool cannot be used in - * an unintended context. - */ - -#define BOOST_TEST_MODULE util_explicit_operator_bool_delete - -#include - -namespace { - - // A test object that has the operator of explicit conversion to bool - struct checkable - { - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() - bool operator! () const - { - return false; - } - }; - -} // namespace - -int main(int, char*[]) -{ - checkable val; - delete val; - - return 0; -} diff --git a/test/compile_fail/util_explicit_operator_bool_shift.cpp b/test/compile_fail/util_explicit_operator_bool_shift.cpp deleted file mode 100644 index 3098458..0000000 --- a/test/compile_fail/util_explicit_operator_bool_shift.cpp +++ /dev/null @@ -1,40 +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 util_explicit_operator_bool_shift.cpp - * \author Andrey Semashev - * \date 17.07.2010 - * - * \brief This test checks that explicit operator bool cannot be used in - * an unintended context. - */ - -#define BOOST_TEST_MODULE util_explicit_operator_bool_shift - -#include - -namespace { - - // A test object that has the operator of explicit conversion to bool - struct checkable - { - BOOST_LOG_EXPLICIT_OPERATOR_BOOL() - bool operator! () const - { - return false; - } - }; - -} // namespace - -int main(int, char*[]) -{ - checkable val; - val << 2; - - return 0; -} diff --git a/test/performance/record_emission.cpp b/test/performance/record_emission.cpp index 46229cd..f27e720 100644 --- a/test/performance/record_emission.cpp +++ b/test/performance/record_emission.cpp @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/test/run/core.cpp b/test/run/core.cpp index 983fb12..ec2e52d 100644 --- a/test/run/core.cpp +++ b/test/run/core.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/run/util_stp_filter_parser.cpp b/test/run/util_stp_filter_parser.cpp index 46d5d82..59170f1 100644 --- a/test/run/util_stp_filter_parser.cpp +++ b/test/run/util_stp_filter_parser.cpp @@ -20,7 +20,7 @@ #if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) -#include +#include #include #include #include diff --git a/test/run/util_stp_formatter_parser.cpp b/test/run/util_stp_formatter_parser.cpp index 352d312..ed66373 100644 --- a/test/run/util_stp_formatter_parser.cpp +++ b/test/run/util_stp_formatter_parser.cpp @@ -20,7 +20,7 @@ #if !defined(BOOST_LOG_WITHOUT_SETTINGS_PARSERS) && !defined(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES) -#include +#include #include #include #include