diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d4e116..3122845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,6 @@ set(boost_log_sources src/bit_tools.hpp src/code_conversion.cpp src/stateless_allocator.hpp - src/unique_ptr.hpp src/core.cpp src/record_ostream.cpp src/severity_level.cpp diff --git a/src/core.cpp b/src/core.cpp index 1da9d30..40014bf 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,6 @@ #include #include #endif -#include "unique_ptr.hpp" #include "default_sink.hpp" #include "stateless_allocator.hpp" #include "alignment_gap_between.hpp" @@ -282,7 +282,7 @@ public: #else //! Thread-specific data - log::aux::unique_ptr< thread_data > m_thread_data; + std::unique_ptr< thread_data > m_thread_data; #endif //! The global state of logging @@ -427,7 +427,7 @@ private: BOOST_LOG_EXPR_IF_MT(scoped_write_lock lock(m_mutex);) if (!m_thread_data.get()) { - log::aux::unique_ptr< thread_data > p(new thread_data()); + std::unique_ptr< thread_data > p(new thread_data()); m_thread_data.reset(p.get()); #if defined(BOOST_LOG_USE_COMPILER_TLS) m_thread_data_cache = p.release(); diff --git a/src/named_scope.cpp b/src/named_scope.cpp index 8121cbf..22c60f6 100644 --- a/src/named_scope.cpp +++ b/src/named_scope.cpp @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -27,7 +28,6 @@ #if !defined(BOOST_LOG_NO_THREADS) #include #endif -#include "unique_ptr.hpp" #include namespace boost { @@ -153,7 +153,7 @@ struct BOOST_SYMBOL_VISIBLE named_scope::impl : #else //! Pointer to the scope stack - log::aux::unique_ptr< scope_list > pScopes; + std::unique_ptr< scope_list > pScopes; #endif //! The method returns current thread scope stack @@ -166,7 +166,7 @@ struct BOOST_SYMBOL_VISIBLE named_scope::impl : #endif if (!p) { - log::aux::unique_ptr< scope_list > pNew(new scope_list()); + std::unique_ptr< scope_list > pNew(new scope_list()); pScopes.reset(pNew.get()); #if defined(BOOST_LOG_USE_COMPILER_TLS) pScopesCache = p = pNew.release(); diff --git a/src/record_ostream.cpp b/src/record_ostream.cpp index 27ed3d0..28f3e52 100644 --- a/src/record_ostream.cpp +++ b/src/record_ostream.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -23,7 +24,6 @@ #if !defined(BOOST_LOG_NO_THREADS) #include #endif -#include "unique_ptr.hpp" #include namespace boost { @@ -75,7 +75,7 @@ class stream_compound_pool : #if !defined(BOOST_LOG_NO_THREADS) thread_specific_ptr< stream_compound_pool< CharT > > #else - log::aux::unique_ptr< stream_compound_pool< CharT > > + std::unique_ptr< stream_compound_pool< CharT > > #endif > { @@ -86,7 +86,7 @@ class stream_compound_pool : typedef thread_specific_ptr< this_type > tls_ptr_type; #else //! Thread-specific pointer type - typedef log::aux::unique_ptr< this_type > tls_ptr_type; + typedef std::unique_ptr< this_type > tls_ptr_type; #endif //! Singleton base type typedef log::aux::lazy_singleton< @@ -117,7 +117,7 @@ public: this_type* p = ptr.get(); if (!p) { - log::aux::unique_ptr< this_type > pNew(new this_type()); + std::unique_ptr< this_type > pNew(new this_type()); ptr.reset(pNew.get()); p = pNew.release(); } diff --git a/src/severity_level.cpp b/src/severity_level.cpp index 9ba01cc..21fdf58 100644 --- a/src/severity_level.cpp +++ b/src/severity_level.cpp @@ -14,6 +14,7 @@ */ #include +#include #include #include @@ -22,7 +23,6 @@ #include #include #endif -#include "unique_ptr.hpp" #include namespace boost { @@ -61,7 +61,7 @@ BOOST_LOG_API uintmax_t& get_severity_level() uintmax_t* p = tss.get(); if (BOOST_UNLIKELY(!p)) { - log::aux::unique_ptr< uintmax_t > ptr(new uintmax_t(0)); + std::unique_ptr< uintmax_t > ptr(new uintmax_t(0)); tss.set(ptr.get()); p = ptr.release(); boost::this_thread::at_thread_exit([p]() { delete p; }); diff --git a/src/syslog_backend.cpp b/src/syslog_backend.cpp index b93e574..8f383e1 100644 --- a/src/syslog_backend.cpp +++ b/src/syslog_backend.cpp @@ -18,6 +18,7 @@ #ifndef BOOST_LOG_WITHOUT_SYSLOG #include +#include #include #include #include @@ -45,7 +46,6 @@ #if !defined(BOOST_LOG_NO_THREADS) #include #endif -#include "unique_ptr.hpp" #ifdef BOOST_LOG_USE_NATIVE_SYSLOG #include @@ -422,7 +422,7 @@ struct syslog_backend::implementation::udp_socket_based : //! Pointer to the list of sockets shared_ptr< syslog_udp_service > m_pService; //! Pointer to the socket being used - log::aux::unique_ptr< syslog_udp_socket > m_pSocket; + std::unique_ptr< syslog_udp_socket > m_pSocket; //! The target host to send packets to asio::ip::udp::endpoint m_TargetHost; diff --git a/src/text_file_backend.cpp b/src/text_file_backend.cpp index 1fb3a49..924f3cd 100644 --- a/src/text_file_backend.cpp +++ b/src/text_file_backend.cpp @@ -56,7 +56,6 @@ #include #include #include -#include "unique_ptr.hpp" #if !defined(BOOST_LOG_NO_THREADS) #include diff --git a/src/unique_ptr.hpp b/src/unique_ptr.hpp deleted file mode 100644 index 091bb9c..0000000 --- a/src/unique_ptr.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Andrey Semashev 2007 - 2015. - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - */ -/*! - * \file unique_ptr.hpp - * \author Andrey Semashev - * \date 18.07.2015 - * - * \brief This header is the Boost.Log library implementation, see the library documentation - * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. - */ - -#ifndef BOOST_LOG_UNIQUE_PTR_HPP_INCLUDED_ -#define BOOST_LOG_UNIQUE_PTR_HPP_INCLUDED_ - -#include - -#if !defined(BOOST_NO_CXX11_SMART_PTR) - -#include - -namespace boost { - -BOOST_LOG_OPEN_NAMESPACE - -namespace aux { - -using std::unique_ptr; - -} // namespace aux - -BOOST_LOG_CLOSE_NAMESPACE // namespace log - -} // namespace boost - -#else // !defined(BOOST_NO_CXX11_SMART_PTR) - -#include - -namespace boost { - -BOOST_LOG_OPEN_NAMESPACE - -namespace aux { - -using boost::movelib::unique_ptr; - -} // namespace aux - -BOOST_LOG_CLOSE_NAMESPACE // namespace log - -} // namespace boost - -#endif // !defined(BOOST_NO_CXX11_SMART_PTR) - -#endif // BOOST_LOG_UNIQUE_PTR_HPP_INCLUDED_ diff --git a/src/windows/event_log_backend.cpp b/src/windows/event_log_backend.cpp index 7515f8b..6f9d81c 100644 --- a/src/windows/event_log_backend.cpp +++ b/src/windows/event_log_backend.cpp @@ -17,6 +17,7 @@ #ifndef BOOST_LOG_WITHOUT_EVENT_LOG +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include "unique_ptr.hpp" #include "windows/event_log_registry.hpp" #include "windows/simple_event_log.h" #include @@ -262,7 +262,7 @@ BOOST_LOG_API void basic_simple_event_log_backend< CharT >::construct( aux::init_event_log_registry(log_name, source_name, reg_mode == event_log::forced, reg_params); } - log::aux::unique_ptr< implementation > p(new implementation()); + std::unique_ptr< implementation > p(new implementation()); const char_type* target_unc = NULL; if (!target.empty()) @@ -518,7 +518,7 @@ BOOST_LOG_API void basic_event_log_backend< CharT >::construct( aux::init_event_log_registry(log_name, source_name, reg_mode == event_log::forced, reg_params); } - log::aux::unique_ptr< implementation > p(new implementation()); + std::unique_ptr< implementation > p(new implementation()); const char_type* target_unc = NULL; if (!target.empty()) diff --git a/src/windows/ipc_sync_wrappers.cpp b/src/windows/ipc_sync_wrappers.cpp index 77ec34b..6848809 100644 --- a/src/windows/ipc_sync_wrappers.cpp +++ b/src/windows/ipc_sync_wrappers.cpp @@ -26,6 +26,7 @@ #include // for error codes #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include "unique_ptr.hpp" #include "windows/ipc_sync_wrappers.hpp" #include @@ -413,7 +413,7 @@ interprocess_condition_variable::semaphore_info* interprocess_condition_variable { // We need to open the semaphore. It is possible that the semaphore does not exist because all processes that had it opened terminated. // Because of this we also attempt to create it. - boost::log::aux::unique_ptr< semaphore_info > p(new semaphore_info(id)); + std::unique_ptr< semaphore_info > p(new semaphore_info(id)); generate_semaphore_name(id); p->m_semaphore.create_or_open(m_semaphore_name.c_str(), m_perms);