diff options
Diffstat (limited to 'boost/interprocess/detail')
42 files changed, 609 insertions, 766 deletions
diff --git a/boost/interprocess/detail/atomic.hpp b/boost/interprocess/detail/atomic.hpp index 96b7729d7e..e32f056c3d 100644 --- a/boost/interprocess/detail/atomic.hpp +++ b/boost/interprocess/detail/atomic.hpp @@ -15,7 +15,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_ATOMIC_HPP #define BOOST_INTERPROCESS_DETAIL_ATOMIC_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/cast_tags.hpp b/boost/interprocess/detail/cast_tags.hpp index 0019af7933..e47b86344c 100644 --- a/boost/interprocess/detail/cast_tags.hpp +++ b/boost/interprocess/detail/cast_tags.hpp @@ -8,16 +8,17 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTERPROCESS_CAST_TAGS_HPP -#define BOOST_INTERPROCESS_CAST_TAGS_HPP +#ifndef BOOST_INTERPROCESS_DETAIL_CAST_TAGS_HPP +#define BOOST_INTERPROCESS_DETAIL_CAST_TAGS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif -#include <boost/interprocess/detail/config_begin.hpp> -#include <boost/interprocess/detail/workaround.hpp> - namespace boost { namespace interprocess { namespace ipcdetail { struct static_cast_tag {}; @@ -27,7 +28,4 @@ struct reinterpret_cast_tag {}; }}} //namespace boost { namespace interprocess { namespace ipcdetail { -#include <boost/interprocess/detail/config_end.hpp> - -#endif //#ifndef BOOST_INTERPROCESS_CAST_TAGS_HPP - +#endif //#ifndef BOOST_INTERPROCESS_DETAIL_CAST_TAGS_HPP diff --git a/boost/interprocess/detail/config_begin.hpp b/boost/interprocess/detail/config_begin.hpp index 8bcdcac587..b1cf078e00 100644 --- a/boost/interprocess/detail/config_begin.hpp +++ b/boost/interprocess/detail/config_begin.hpp @@ -24,6 +24,7 @@ #pragma warning (disable : 4267) // conversion from "X" to "Y", possible loss of data #pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier" #pragma warning (disable : 4355) // "this" : used in base member initializer list + #pragma warning (disable : 4345) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized #pragma warning (disable : 4503) // "identifier" : decorated name length exceeded, name was truncated #pragma warning (disable : 4511) // copy constructor could not be generated #pragma warning (disable : 4512) // assignment operator could not be generated diff --git a/boost/interprocess/detail/file_locking_helpers.hpp b/boost/interprocess/detail/file_locking_helpers.hpp index 6a7ce8ef3b..c6688e619c 100644 --- a/boost/interprocess/detail/file_locking_helpers.hpp +++ b/boost/interprocess/detail/file_locking_helpers.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_FILE_LOCKING_HELPERS_HPP #define BOOST_INTERPROCESS_FILE_LOCKING_HELPERS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif diff --git a/boost/interprocess/detail/file_wrapper.hpp b/boost/interprocess/detail/file_wrapper.hpp index 507ec478dc..58f28e97f8 100644 --- a/boost/interprocess/detail/file_wrapper.hpp +++ b/boost/interprocess/detail/file_wrapper.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_FILE_WRAPPER_HPP #define BOOST_INTERPROCESS_DETAIL_FILE_WRAPPER_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -21,6 +25,7 @@ #include <boost/interprocess/creation_tags.hpp> #include <boost/move/utility_core.hpp> #include <boost/interprocess/creation_tags.hpp> +#include <boost/interprocess/detail/simple_swap.hpp> namespace boost { namespace interprocess { @@ -127,8 +132,8 @@ inline bool file_wrapper::get_size(offset_t &size) const inline void file_wrapper::swap(file_wrapper &other) { - std::swap(m_handle, other.m_handle); - std::swap(m_mode, other.m_mode); + (simple_swap)(m_handle, other.m_handle); + (simple_swap)(m_mode, other.m_mode); m_filename.swap(other.m_filename); } diff --git a/boost/interprocess/detail/in_place_interface.hpp b/boost/interprocess/detail/in_place_interface.hpp index 5af5a0d2df..013691ad78 100644 --- a/boost/interprocess/detail/in_place_interface.hpp +++ b/boost/interprocess/detail/in_place_interface.hpp @@ -11,14 +11,18 @@ #ifndef BOOST_INTERPROCESS_IN_PLACE_INTERFACE_HPP #define BOOST_INTERPROCESS_IN_PLACE_INTERFACE_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> #include <boost/interprocess/detail/type_traits.hpp> -#include <boost/type_traits/alignment_of.hpp> +#include <boost/container/detail/type_traits.hpp> //alignment_of, aligned_storage #include <typeinfo> //typeid //!\file @@ -47,7 +51,7 @@ template<class T> struct placement_destroy : public in_place_interface { placement_destroy() - : in_place_interface(::boost::alignment_of<T>::value, sizeof(T), typeid(T).name()) + : in_place_interface(::boost::container::container_detail::alignment_of<T>::value, sizeof(T), typeid(T).name()) {} virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed) diff --git a/boost/interprocess/detail/intermodule_singleton.hpp b/boost/interprocess/detail/intermodule_singleton.hpp index a99934893d..9279e92b4c 100644 --- a/boost/interprocess/detail/intermodule_singleton.hpp +++ b/boost/interprocess/detail/intermodule_singleton.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP #define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif diff --git a/boost/interprocess/detail/intermodule_singleton_common.hpp b/boost/interprocess/detail/intermodule_singleton_common.hpp index 10c9eceabb..c890c326bc 100644 --- a/boost/interprocess/detail/intermodule_singleton_common.hpp +++ b/boost/interprocess/detail/intermodule_singleton_common.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP #define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif @@ -21,7 +25,7 @@ #include <boost/interprocess/detail/atomic.hpp> #include <boost/interprocess/detail/os_thread_functions.hpp> #include <boost/interprocess/exceptions.hpp> -#include <boost/type_traits/type_with_alignment.hpp> +#include <boost/container/detail/type_traits.hpp> //alignment_of, aligned_storage #include <boost/interprocess/detail/mpl.hpp> #include <boost/interprocess/sync/spin/wait.hpp> #include <boost/assert.hpp> @@ -286,7 +290,7 @@ class intermodule_singleton_common static union mem_holder_t { unsigned char map_mem [sizeof(ThreadSafeGlobalMap)]; - ::boost::detail::max_align aligner; + ::boost::container::container_detail::max_align_t aligner; } mem_holder; }; diff --git a/boost/interprocess/detail/interprocess_tester.hpp b/boost/interprocess/detail/interprocess_tester.hpp index 8c00c4c0c4..368820f82a 100644 --- a/boost/interprocess/detail/interprocess_tester.hpp +++ b/boost/interprocess/detail/interprocess_tester.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_INTERPROCESS_TESTER_HPP #define BOOST_INTERPROCESS_DETAIL_INTERPROCESS_TESTER_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/intersegment_ptr.hpp b/boost/interprocess/detail/intersegment_ptr.hpp index fa1b277ef4..1bf97e5a2b 100644 --- a/boost/interprocess/detail/intersegment_ptr.hpp +++ b/boost/interprocess/detail/intersegment_ptr.hpp @@ -11,32 +11,36 @@ #ifndef BOOST_INTERPROCESS_INTERSEGMENT_PTR_HPP #define BOOST_INTERPROCESS_INTERSEGMENT_PTR_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> - +// interprocess #include <boost/interprocess/interprocess_fwd.hpp> -#include <boost/interprocess/detail/utilities.hpp> -#include <boost/interprocess/detail/math_functions.hpp> -#include <boost/interprocess/detail/cast_tags.hpp> -#include <boost/assert.hpp> #include <boost/interprocess/sync/scoped_lock.hpp> #include <boost/interprocess/sync/interprocess_mutex.hpp> #include <boost/interprocess/containers/flat_map.hpp> #include <boost/interprocess/containers/vector.hpp> //vector #include <boost/interprocess/containers/set.hpp> //set -#include <boost/detail/no_exceptions_support.hpp> +// interprocess/detail +#include <boost/interprocess/detail/multi_segment_services.hpp> +#include <boost/interprocess/detail/utilities.hpp> +#include <boost/interprocess/detail/math_functions.hpp> +#include <boost/interprocess/detail/cast_tags.hpp> #include <boost/interprocess/detail/mpl.hpp> -#include <climits> -#include <iterator> +// other boost +#include <boost/core/no_exceptions_support.hpp> #include <boost/static_assert.hpp> //BOOST_STATIC_ASSERT -#include <climits> //CHAR_BIT #include <boost/integer/static_log2.hpp> #include <boost/assert.hpp> //BOOST_ASSERT -#include <boost/interprocess/detail/multi_segment_services.hpp> +// std +#include <climits> //CHAR_BIT //!\file //! @@ -753,7 +757,7 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex> bool operator! () const { return base_t::is_null(); } - //!Swaps two intersegment_ptr-s. More efficient than std::swap. + //!Swaps two intersegment_ptr-s. More efficient than standard swap. //!Never throws. void swap(intersegment_ptr &other) { base_t::swap(other); } diff --git a/boost/interprocess/detail/managed_global_memory.hpp b/boost/interprocess/detail/managed_global_memory.hpp index baa6361e69..0f389fda27 100644 --- a/boost/interprocess/detail/managed_global_memory.hpp +++ b/boost/interprocess/detail/managed_global_memory.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_BASIC_GLOBAL_MEMORY_HPP #define BOOST_INTERPROCESS_BASIC_GLOBAL_MEMORY_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif diff --git a/boost/interprocess/detail/managed_memory_impl.hpp b/boost/interprocess/detail/managed_memory_impl.hpp index b77c53274d..0a82230cbd 100644 --- a/boost/interprocess/detail/managed_memory_impl.hpp +++ b/boost/interprocess/detail/managed_memory_impl.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_MANAGED_MEMORY_IMPL_HPP #define BOOST_INTERPROCESS_DETAIL_MANAGED_MEMORY_IMPL_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -25,12 +29,12 @@ #include <boost/interprocess/exceptions.hpp> #include <boost/interprocess/segment_manager.hpp> #include <boost/interprocess/sync/scoped_lock.hpp> +#include <boost/interprocess/detail/nothrow.hpp> +#include <boost/interprocess/detail/simple_swap.hpp> // -#include <boost/detail/no_exceptions_support.hpp> +#include <boost/core/no_exceptions_support.hpp> // -#include <utility> -#include <fstream> -#include <new> +#include <boost/intrusive/detail/minimal_pair_header.hpp> #include <boost/assert.hpp> //!\file @@ -173,7 +177,7 @@ class basic_managed_memory_impl //throw if constructor allocates memory. So we must catch it. BOOST_TRY{ //Let's construct the allocator in memory - mp_header = new(addr) segment_manager(size); + mp_header = ::new(addr, boost_container_new_t()) segment_manager(size); } BOOST_CATCH(...){ return false; @@ -278,24 +282,19 @@ class basic_managed_memory_impl //!Searches for nbytes of free memory in the segment, marks the //!memory as used and return the pointer to the memory. If no memory //!is available returns 0. Never throws. - void* allocate (size_type nbytes, std::nothrow_t nothrow) - { return mp_header->allocate(nbytes, nothrow); } + void* allocate (size_type nbytes, const std::nothrow_t &tag) + { return mp_header->allocate(nbytes, tag); } //!Allocates nbytes bytes aligned to "alignment" bytes. "alignment" //!must be power of two. If no memory //!is available returns 0. Never throws. - void * allocate_aligned (size_type nbytes, size_type alignment, std::nothrow_t nothrow) - { return mp_header->allocate_aligned(nbytes, alignment, nothrow); } + void * allocate_aligned (size_type nbytes, size_type alignment, const std::nothrow_t &tag) + { return mp_header->allocate_aligned(nbytes, alignment, tag); } template<class T> - std::pair<T *, bool> - allocation_command (boost::interprocess::allocation_type command, size_type limit_size, - size_type preferred_size,size_type &received_size, - T *reuse_ptr = 0) - { - return mp_header->allocation_command - (command, limit_size, preferred_size, received_size, reuse_ptr); - } + T * allocation_command (boost::interprocess::allocation_type command, size_type limit_size, + size_type &prefer_in_recvd_out_size, T *&reuse) + { return mp_header->allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse); } //!Allocates nbytes bytes aligned to "alignment" bytes. "alignment" //!must be power of two. If no @@ -319,14 +318,14 @@ class basic_managed_memory_impl //!Allocates n_elements of elem_bytes bytes. //!Non-throwing version. chain.size() is not increased on failure. - void allocate_many(std::nothrow_t, size_type elem_bytes, size_type n_elements, multiallocation_chain &chain) - { mp_header->allocate_many(std::nothrow_t(), elem_bytes, n_elements, chain); } + void allocate_many(const std::nothrow_t &tag, size_type elem_bytes, size_type n_elements, multiallocation_chain &chain) + { mp_header->allocate_many(tag, elem_bytes, n_elements, chain); } //!Allocates n_elements, each one of //!element_lengths[i]*sizeof_element bytes. //!Non-throwing version. chain.size() is not increased on failure. - void allocate_many(std::nothrow_t, const size_type *elem_sizes, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain) - { mp_header->allocate_many(std::nothrow_t(), elem_sizes, n_elements, sizeof_element, chain); } + void allocate_many(const std::nothrow_t &tag, const size_type *elem_sizes, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain) + { mp_header->allocate_many(tag, elem_sizes, n_elements, sizeof_element, chain); } //!Deallocates all elements contained in chain. //!Never throws. @@ -406,8 +405,8 @@ class basic_managed_memory_impl //!before freeing the memory. template <class T> typename segment_manager::template construct_proxy<T>::type - construct(char_ptr_holder_t name, std::nothrow_t nothrow) - { return mp_header->template construct<T>(name, nothrow); } + construct(char_ptr_holder_t name, const std::nothrow_t &tag) + { return mp_header->template construct<T>(name, tag); } //!Finds or creates a named object or array in memory //! @@ -427,8 +426,8 @@ class basic_managed_memory_impl //!before freeing the memory. template <class T> typename segment_manager::template construct_proxy<T>::type - find_or_construct(char_ptr_holder_t name, std::nothrow_t nothrow) - { return mp_header->template find_or_construct<T>(name, nothrow); } + find_or_construct(char_ptr_holder_t name, const std::nothrow_t &tag) + { return mp_header->template find_or_construct<T>(name, tag); } //!Creates a named array from iterators in memory //! @@ -492,8 +491,8 @@ class basic_managed_memory_impl //!destructors of created objects are called before freeing the memory.*/ template <class T> typename segment_manager::template construct_iter_proxy<T>::type - construct_it(char_ptr_holder_t name, std::nothrow_t nothrow) - { return mp_header->template construct_it<T>(name, nothrow); } + construct_it(char_ptr_holder_t name, const std::nothrow_t &tag) + { return mp_header->template construct_it<T>(name, tag); } //!Finds or creates a named array from iterators in memory //! @@ -515,8 +514,8 @@ class basic_managed_memory_impl //!destructors of created objects are called before freeing the memory.*/ template <class T> typename segment_manager::template construct_iter_proxy<T>::type - find_or_construct_it(char_ptr_holder_t name, std::nothrow_t nothrow) - { return mp_header->template find_or_construct_it<T>(name, nothrow); } + find_or_construct_it(char_ptr_holder_t name, const std::nothrow_t &tag) + { return mp_header->template find_or_construct_it<T>(name, tag); } //!Calls a functor and guarantees that no new construction, search or //!destruction will be executed by any process while executing the object @@ -716,7 +715,7 @@ class basic_managed_memory_impl //!Swaps the segment manager's managed by this managed memory segment. //!NOT thread-safe. Never throws. void swap(basic_managed_memory_impl &other) - { std::swap(mp_header, other.mp_header); } + { (simple_swap)(mp_header, other.mp_header); } private: segment_manager *mp_header; diff --git a/boost/interprocess/detail/managed_multi_shared_memory.hpp b/boost/interprocess/detail/managed_multi_shared_memory.hpp index 4c2ef14dcc..3d0ba669de 100644 --- a/boost/interprocess/detail/managed_multi_shared_memory.hpp +++ b/boost/interprocess/detail/managed_multi_shared_memory.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_MANAGED_MULTI_SHARED_MEMORY_HPP #define BOOST_INTERPROCESS_MANAGED_MULTI_SHARED_MEMORY_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -20,7 +24,7 @@ #include <boost/interprocess/detail/managed_memory_impl.hpp> #include <boost/interprocess/creation_tags.hpp> -#include <boost/detail/no_exceptions_support.hpp> +#include <boost/core/no_exceptions_support.hpp> #include <boost/interprocess/detail/multi_segment_services.hpp> #include <boost/interprocess/detail/utilities.hpp> #include <boost/interprocess/shared_memory_object.hpp> @@ -29,10 +33,13 @@ #include <boost/interprocess/shared_memory_object.hpp> #include <boost/interprocess/permissions.hpp> #include <boost/interprocess/detail/managed_open_or_create_impl.hpp> //managed_open_or_create_impl -#include <new> #include <boost/interprocess/containers/string.hpp> #include <boost/interprocess/streams/vectorstream.hpp> -#include <memory> +#include <boost/intrusive/detail/minimal_pair_header.hpp> +#include <string> //string +#include <new> //bad_alloc +#include <ostream>//std::ends + #include <boost/assert.hpp> //These includes needed to fulfill default template parameters of //predeclarations in interprocess_fwd.hpp diff --git a/boost/interprocess/detail/managed_open_or_create_impl.hpp b/boost/interprocess/detail/managed_open_or_create_impl.hpp index bd08be56d3..9351f391f9 100644 --- a/boost/interprocess/detail/managed_open_or_create_impl.hpp +++ b/boost/interprocess/detail/managed_open_or_create_impl.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_MANAGED_OPEN_OR_CREATE_IMPL #define BOOST_INTERPROCESS_MANAGED_OPEN_OR_CREATE_IMPL -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -27,8 +31,7 @@ #include <boost/interprocess/creation_tags.hpp> #include <boost/interprocess/detail/mpl.hpp> #include <boost/interprocess/permissions.hpp> -#include <boost/type_traits/alignment_of.hpp> -#include <boost/type_traits/type_with_alignment.hpp> +#include <boost/container/detail/type_traits.hpp> //alignment_of, aligned_storage #include <boost/interprocess/sync/spin/wait.hpp> #include <boost/move/move.hpp> #include <boost/cstdint.hpp> @@ -112,7 +115,8 @@ class managed_open_or_create_impl ct_rounded_size < sizeof(boost::uint32_t) , MemAlignment ? (MemAlignment) : - (::boost::alignment_of< ::boost::detail::max_align >::value) + (::boost::container::container_detail::alignment_of + < ::boost::container::container_detail::max_align_t >::value) >::value; managed_open_or_create_impl() diff --git a/boost/interprocess/detail/math_functions.hpp b/boost/interprocess/detail/math_functions.hpp index 3826f161e2..a19efac1a4 100644 --- a/boost/interprocess/detail/math_functions.hpp +++ b/boost/interprocess/detail/math_functions.hpp @@ -16,7 +16,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP #define BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/min_max.hpp b/boost/interprocess/detail/min_max.hpp index a5d01f404b..2097ff4246 100644 --- a/boost/interprocess/detail/min_max.hpp +++ b/boost/interprocess/detail/min_max.hpp @@ -13,7 +13,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP #define BOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/move.hpp b/boost/interprocess/detail/move.hpp index 22df7bd771..3a2c29b051 100644 --- a/boost/interprocess/detail/move.hpp +++ b/boost/interprocess/detail/move.hpp @@ -14,7 +14,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_MOVE_HPP #define BOOST_INTERPROCESS_DETAIL_MOVE_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/mpl.hpp b/boost/interprocess/detail/mpl.hpp index 29f3893038..08167db7fb 100644 --- a/boost/interprocess/detail/mpl.hpp +++ b/boost/interprocess/detail/mpl.hpp @@ -13,7 +13,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_MPL_HPP #define BOOST_INTERPROCESS_DETAIL_MPL_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/multi_segment_services.hpp b/boost/interprocess/detail/multi_segment_services.hpp deleted file mode 100644 index dd9d5f82fd..0000000000 --- a/boost/interprocess/detail/multi_segment_services.hpp +++ /dev/null @@ -1,46 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// (C) Copyright Ion Gaztanaga 2005-2012. 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) -// -// See http://www.boost.org/libs/interprocess for documentation. -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef BOOST_INTERPROCESS_MULTI_SEGMENT_SERVICES_HPP -#define BOOST_INTERPROCESS_MULTI_SEGMENT_SERVICES_HPP - -#if defined(_MSC_VER) -# pragma once -#endif - -#include <boost/interprocess/detail/config_begin.hpp> -#include <boost/interprocess/detail/workaround.hpp> - - -/*!\file - Describes a named shared memory allocation user class. -*/ - -namespace boost { - -namespace interprocess { - -class multi_segment_services -{ - public: - virtual std::pair<void *, std::size_t> create_new_segment(std::size_t mem) = 0; - virtual bool update_segments () = 0; - virtual ~multi_segment_services() = 0; -}; - -inline multi_segment_services::~multi_segment_services() -{} - - -}} //namespace boost { namespace interprocess { - -#include <boost/interprocess/detail/config_end.hpp> - -#endif //#ifdef BOOST_INTERPROCESS_MULTI_SEGMENT_SERVICES_HPP diff --git a/boost/interprocess/detail/named_proxy.hpp b/boost/interprocess/detail/named_proxy.hpp index ee6668c2d5..04030f2d4f 100644 --- a/boost/interprocess/detail/named_proxy.hpp +++ b/boost/interprocess/detail/named_proxy.hpp @@ -11,24 +11,28 @@ #ifndef BOOST_INTERPROCESS_NAMED_PROXY_HPP #define BOOST_INTERPROCESS_NAMED_PROXY_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> -#include <new> -#include <iterator> +// interprocess/detail #include <boost/interprocess/detail/in_place_interface.hpp> #include <boost/interprocess/detail/mpl.hpp> - +#include <boost/move/utility_core.hpp> #ifndef BOOST_INTERPROCESS_PERFECT_FORWARDING -#include <boost/interprocess/detail/preprocessor.hpp> +#include <boost/move/detail/fwd_macros.hpp> #else #include <boost/move/utility_core.hpp> #include <boost/interprocess/detail/variadic_templates_tools.hpp> #endif //#ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING +#include <boost/container/detail/placement_new.hpp> //!\file //!Describes a proxy class that implements named allocation syntax. @@ -40,10 +44,10 @@ namespace ipcdetail { #ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING template<class T, bool is_iterator, class ...Args> -struct CtorNArg : public placement_destroy<T> +struct CtorArgN : public placement_destroy<T> { typedef bool_<is_iterator> IsIterator; - typedef CtorNArg<T, is_iterator, Args...> self_t; + typedef CtorArgN<T, is_iterator, Args...> self_t; typedef typename build_number_seq<sizeof...(Args)>::type index_tuple_t; self_t& operator++() @@ -54,7 +58,7 @@ struct CtorNArg : public placement_destroy<T> self_t operator++(int) { return ++*this; *this; } - CtorNArg(Args && ...args) + CtorArgN(Args && ...args) : args_(args...) {} @@ -72,11 +76,11 @@ struct CtorNArg : public placement_destroy<T> private: template<int ...IdxPack> void construct(void *mem, true_, const index_tuple<IdxPack...>&) - { new((void*)mem)T(*boost::forward<Args>(get<IdxPack>(args_))...); } + { ::new((void*)mem, boost_container_new_t())T(*boost::forward<Args>(get<IdxPack>(args_))...); } template<int ...IdxPack> void construct(void *mem, false_, const index_tuple<IdxPack...>&) - { new((void*)mem)T(boost::forward<Args>(get<IdxPack>(args_))...); } + { ::new((void*)mem, boost_container_new_t())T(boost::forward<Args>(get<IdxPack>(args_))...); } template<int ...IdxPack> void do_increment(true_, const index_tuple<IdxPack...>&) @@ -120,7 +124,7 @@ class named_proxy template<class ...Args> T *operator()(Args &&...args) const { - CtorNArg<T, is_iterator, Args...> &&ctor_obj = CtorNArg<T, is_iterator, Args...> + CtorArgN<T, is_iterator, Args...> &&ctor_obj = CtorArgN<T, is_iterator, Args...> (boost::forward<Args>(args)...); return mp_mngr->template generic_construct<T>(mp_name, m_num, m_find, m_dothrow, ctor_obj); @@ -133,29 +137,6 @@ class named_proxy #else //#ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING -//!Function object that makes placement new -//!without arguments -template<class T> -struct Ctor0Arg : public placement_destroy<T> -{ - typedef Ctor0Arg self_t; - - Ctor0Arg(){} - - self_t& operator++() { return *this; } - self_t operator++(int) { return *this; } - - void construct(void *mem) - { new((void*)mem)T; } - - virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed) - { - T* memory = static_cast<T*>(mem); - for(constructed = 0; constructed < num; ++constructed) - new((void*)memory++)T; - } -}; - //////////////////////////////////////////////////////////////// // What the macro should generate (n == 2): // @@ -207,66 +188,61 @@ struct Ctor0Arg : public placement_destroy<T> // }; //////////////////////////////////////////////////////////////// -//Note: -//We define template parameters as const references to -//be able to bind temporaries. After that we will un-const them. -//This cast is ugly but it is necessary until "perfect forwarding" -//is achieved in C++0x. Meanwhile, if we want to be able to -//bind lvalues with non-const references, we have to be ugly -#define BOOST_PP_LOCAL_MACRO(n) \ - template<class T, bool is_iterator, BOOST_PP_ENUM_PARAMS(n, class P) > \ - struct BOOST_PP_CAT(BOOST_PP_CAT(Ctor, n), Arg) \ - : public placement_destroy<T> \ - { \ - typedef bool_<is_iterator> IsIterator; \ - typedef BOOST_PP_CAT(BOOST_PP_CAT(Ctor, n), Arg) self_t; \ - \ - void do_increment(true_) \ - { BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_PARAM_INC, _); } \ - \ - void do_increment(false_){} \ - \ - self_t& operator++() \ - { \ - this->do_increment(IsIterator()); \ - return *this; \ - } \ - \ - self_t operator++(int) { return ++*this; *this; } \ - \ - BOOST_PP_CAT(BOOST_PP_CAT(Ctor, n), Arg) \ - ( BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_PARAM_LIST, _) ) \ - : BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_PARAM_INIT, _) {} \ - \ - virtual void construct_n(void *mem \ - , std::size_t num \ - , std::size_t &constructed) \ - { \ - T* memory = static_cast<T*>(mem); \ - for(constructed = 0; constructed < num; ++constructed){ \ - this->construct(memory++, IsIterator()); \ - this->do_increment(IsIterator()); \ - } \ - } \ - \ - private: \ - void construct(void *mem, true_) \ - { \ - new((void*)mem) T \ - (BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_MEMBER_IT_FORWARD, _)); \ - } \ - \ - void construct(void *mem, false_) \ - { \ - new((void*)mem) T \ - (BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_MEMBER_FORWARD, _)); \ - } \ - \ - BOOST_PP_REPEAT(n, BOOST_INTERPROCESS_PP_PARAM_DEFINE, _) \ - }; \ +#define BOOST_INTERPROCESS_NAMED_PROXY_CTORARGN(N)\ +\ +template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N > \ +struct CtorArg##N : placement_destroy<T>\ +{\ + typedef CtorArg##N self_t;\ + \ + CtorArg##N ( BOOST_MOVE_UREF##N )\ + BOOST_MOVE_COLON##N BOOST_MOVE_FWD_INIT##N{}\ + \ + virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed)\ + {\ + T* memory = static_cast<T*>(mem);\ + for(constructed = 0; constructed < num; ++constructed){\ + ::new((void*)memory++) T ( BOOST_MOVE_MFWD##N );\ + }\ + }\ + \ + private:\ + BOOST_MOVE_MREF##N\ +};\ //! -#define BOOST_PP_LOCAL_LIMITS (1, BOOST_INTERPROCESS_MAX_CONSTRUCTOR_PARAMETERS) -#include BOOST_PP_LOCAL_ITERATE() +BOOST_MOVE_ITERATE_0TO9(BOOST_INTERPROCESS_NAMED_PROXY_CTORARGN) +#undef BOOST_INTERPROCESS_NAMED_PROXY_CTORARGN + +#define BOOST_INTERPROCESS_NAMED_PROXY_CTORITN(N)\ +\ +template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N > \ +struct CtorIt##N : public placement_destroy<T>\ +{\ + typedef CtorIt##N self_t;\ + \ + self_t& operator++()\ + { BOOST_MOVE_MINC##N; return *this; }\ + \ + self_t operator++(int) { return ++*this; *this; }\ + \ + CtorIt##N ( BOOST_MOVE_VAL##N )\ + BOOST_MOVE_COLON##N BOOST_MOVE_VAL_INIT##N{}\ + \ + virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed)\ + {\ + T* memory = static_cast<T*>(mem);\ + for(constructed = 0; constructed < num; ++constructed){\ + ::new((void*)memory++) T( BOOST_MOVE_MITFWD##N );\ + ++(*this);\ + }\ + }\ + \ + private:\ + BOOST_MOVE_MEMB##N\ +};\ +//! +BOOST_MOVE_ITERATE_0TO9(BOOST_INTERPROCESS_NAMED_PROXY_CTORITN) +#undef BOOST_INTERPROCESS_NAMED_PROXY_CTORITN //!Describes a proxy class that implements named //!allocation syntax. @@ -290,32 +266,21 @@ class named_proxy , m_find(find), m_dothrow(dothrow) {} - //!makes a named allocation and calls the - //!default constructor - T *operator()() const - { - Ctor0Arg<T> ctor_obj; - return mp_mngr->template - generic_construct<T>(mp_name, m_num, m_find, m_dothrow, ctor_obj); - } - //! - - #define BOOST_PP_LOCAL_MACRO(n) \ - template<BOOST_PP_ENUM_PARAMS(n, class P)> \ - T *operator()(BOOST_PP_ENUM (n, BOOST_INTERPROCESS_PP_PARAM_LIST, _)) const\ - { \ - typedef BOOST_PP_CAT(BOOST_PP_CAT(Ctor, n), Arg) \ - <T, is_iterator, BOOST_PP_ENUM_PARAMS(n, P)> \ - ctor_obj_t; \ - ctor_obj_t ctor_obj \ - (BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_PARAM_FORWARD, _)); \ - return mp_mngr->template generic_construct<T> \ - (mp_name, m_num, m_find, m_dothrow, ctor_obj); \ - } \ - //! - - #define BOOST_PP_LOCAL_LIMITS ( 1, BOOST_INTERPROCESS_MAX_CONSTRUCTOR_PARAMETERS ) - #include BOOST_PP_LOCAL_ITERATE() + #define BOOST_INTERPROCESS_NAMED_PROXY_CALL_OPERATOR(N)\ + \ + BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \ + T *operator()( BOOST_MOVE_UREF##N ) const\ + {\ + typedef typename if_c<is_iterator \ + , CtorIt##N<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N> \ + , CtorArg##N<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N> \ + >::type ctor_obj_t;\ + ctor_obj_t ctor_obj = ctor_obj_t( BOOST_MOVE_FWD##N );\ + return mp_mngr->template generic_construct<T>(mp_name, m_num, m_find, m_dothrow, ctor_obj);\ + }\ + // + BOOST_MOVE_ITERATE_0TO9(BOOST_INTERPROCESS_NAMED_PROXY_CALL_OPERATOR) + #undef BOOST_INTERPROCESS_NAMED_PROXY_CALL_OPERATOR //////////////////////////////////////////////////////////////////////// // What the macro should generate (n == 2) @@ -324,7 +289,7 @@ class named_proxy // template <class P1, class P2> // T *operator()(P1 &p1, P2 &p2) const // { - // typedef Ctor2Arg + // typedef CtorArg2 // <T, is_iterator, P1, P2> // ctor_obj_t; // ctor_obj_t ctor_obj(p1, p2); diff --git a/boost/interprocess/detail/nothrow.hpp b/boost/interprocess/detail/nothrow.hpp new file mode 100644 index 0000000000..646c9e04a3 --- /dev/null +++ b/boost/interprocess/detail/nothrow.hpp @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-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) +// +// See http://www.boost.org/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP +#define BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP + +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +namespace std { //no namespace versioning in clang+libc++ + +struct nothrow_t; + +} //namespace std { + +namespace boost{ namespace interprocess { + +template <int Dummy = 0> +struct nothrow +{ + static const std::nothrow_t &get() { return *pnothrow; } + static std::nothrow_t *pnothrow; +}; + +template <int Dummy> +std::nothrow_t *nothrow<Dummy>::pnothrow; + +}} //namespace boost{ namespace interprocess { + +#endif //#ifndef BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP diff --git a/boost/interprocess/detail/os_file_functions.hpp b/boost/interprocess/detail/os_file_functions.hpp index 1b54807ab1..bcb9576a19 100644 --- a/boost/interprocess/detail/os_file_functions.hpp +++ b/boost/interprocess/detail/os_file_functions.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_OS_FILE_FUNCTIONS_HPP #define BOOST_INTERPROCESS_DETAIL_OS_FILE_FUNCTIONS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -23,7 +27,7 @@ #include <string> #include <limits> #include <climits> -#include <boost/type_traits/make_unsigned.hpp> +#include <boost/move/detail/type_traits.hpp> //make_unsigned #if defined (BOOST_INTERPROCESS_WINDOWS) # include <boost/interprocess/detail/win32_api.hpp> @@ -52,8 +56,8 @@ namespace interprocess { #if defined (BOOST_INTERPROCESS_WINDOWS) -typedef void * file_handle_t; -typedef long long offset_t; +typedef void * file_handle_t; +typedef __int64 offset_t; typedef struct mapping_handle_impl_t{ void * handle; bool is_shm; @@ -150,10 +154,11 @@ inline bool truncate_file (file_handle_t hnd, std::size_t size) if(!winapi::get_file_size(hnd, filesize)) return false; - typedef boost::make_unsigned<offset_t>::type uoffset_t; + typedef ::boost::move_detail::make_unsigned<offset_t>::type uoffset_t; const uoffset_t max_filesize = uoffset_t((std::numeric_limits<offset_t>::max)()); + const uoffset_t uoff_size = uoffset_t(size); //Avoid unused variable warnings in 32 bit systems - if(uoffset_t(size) > max_filesize){ + if(uoff_size > max_filesize){ winapi::set_last_error(winapi::error_file_too_large); return false; } @@ -476,7 +481,7 @@ inline bool delete_file(const char *name) inline bool truncate_file (file_handle_t hnd, std::size_t size) { - typedef boost::make_unsigned<off_t>::type uoff_t; + typedef boost::move_detail::make_unsigned<off_t>::type uoff_t; if(uoff_t((std::numeric_limits<off_t>::max)()) < size){ errno = EINVAL; return false; diff --git a/boost/interprocess/detail/os_thread_functions.hpp b/boost/interprocess/detail/os_thread_functions.hpp index 4604683645..8469862cc9 100644 --- a/boost/interprocess/detail/os_thread_functions.hpp +++ b/boost/interprocess/detail/os_thread_functions.hpp @@ -22,7 +22,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_OS_THREAD_FUNCTIONS_HPP #define BOOST_INTERPROCESS_DETAIL_OS_THREAD_FUNCTIONS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -31,7 +35,7 @@ #include <boost/interprocess/streams/bufferstream.hpp> #include <boost/interprocess/detail/posix_time_types_wrk.hpp> #include <cstddef> -#include <memory> +#include <ostream> #if defined(BOOST_INTERPROCESS_WINDOWS) # include <boost/interprocess/detail/win32_api.hpp> diff --git a/boost/interprocess/detail/pointer_type.hpp b/boost/interprocess/detail/pointer_type.hpp index 28b053c2ae..125858653e 100644 --- a/boost/interprocess/detail/pointer_type.hpp +++ b/boost/interprocess/detail/pointer_type.hpp @@ -14,7 +14,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_POINTER_TYPE_HPP #define BOOST_INTERPROCESS_DETAIL_POINTER_TYPE_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/portable_intermodule_singleton.hpp b/boost/interprocess/detail/portable_intermodule_singleton.hpp index 80897f2721..43df34c736 100644 --- a/boost/interprocess/detail/portable_intermodule_singleton.hpp +++ b/boost/interprocess/detail/portable_intermodule_singleton.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_PORTABLE_INTERMODULE_SINGLETON_HPP #define BOOST_INTERPROCESS_PORTABLE_INTERMODULE_SINGLETON_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif diff --git a/boost/interprocess/detail/posix_time_types_wrk.hpp b/boost/interprocess/detail/posix_time_types_wrk.hpp index dbde3d1771..ba4973028f 100644 --- a/boost/interprocess/detail/posix_time_types_wrk.hpp +++ b/boost/interprocess/detail/posix_time_types_wrk.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_POSIX_TIMES_WRK_HPP #define BOOST_INTERPROCESS_POSIX_TIMES_WRK_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/preprocessor.hpp b/boost/interprocess/detail/preprocessor.hpp deleted file mode 100644 index 06d1354ee1..0000000000 --- a/boost/interprocess/detail/preprocessor.hpp +++ /dev/null @@ -1,203 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// (C) Copyright Ion Gaztanaga 2008-2012. 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) -// -// See http://www.boost.org/libs/interprocess for documentation. -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef BOOST_INTERPROCESS_DETAIL_PREPROCESSOR_HPP -#define BOOST_INTERPROCESS_DETAIL_PREPROCESSOR_HPP - -#if defined(_MSC_VER) -# pragma once -#endif - -#include <boost/interprocess/detail/config_begin.hpp> - -#ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING -#error "This file is not needed when perfect forwarding is available" -#endif - -#include <boost/preprocessor/iteration/local.hpp> -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/repetition/enum.hpp> -#include <boost/preprocessor/repetition/repeat.hpp> - -#define BOOST_INTERPROCESS_MAX_CONSTRUCTOR_PARAMETERS 10 - -//Note: -//We define template parameters as const references to -//be able to bind temporaries. After that we will un-const them. -//This cast is ugly but it is necessary until "perfect forwarding" -//is achieved in C++0x. Meanwhile, if we want to be able to -//bind rvalues with non-const references, we have to be ugly -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - #define BOOST_INTERPROCESS_PP_PARAM_LIST(z, n, data) \ - BOOST_PP_CAT(P, n) && BOOST_PP_CAT(p, n) \ - //! -#else - #define BOOST_INTERPROCESS_PP_PARAM_LIST(z, n, data) \ - const BOOST_PP_CAT(P, n) & BOOST_PP_CAT(p, n) \ - //! -#endif - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - #define BOOST_INTERPROCESS_PP_PARAM(U, u) \ - U && u \ - //! -#else - #define BOOST_INTERPROCESS_PP_PARAM(U, u) \ - const U & u \ - //! -#endif - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - - #define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \ - BOOST_PP_CAT(m_p, n) (::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \ - //! - -#else //#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - - #define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \ - BOOST_PP_CAT(m_p, n) (const_cast<BOOST_PP_CAT(P, n) &>(BOOST_PP_CAT(p, n))) \ - //! -#endif - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - - #if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) - - namespace boost { - namespace interprocess { - namespace ipcdetail { - template<class T> - struct ref_holder; - - template<class T> - struct ref_holder<T &> - { - ref_holder(T &t) - : t_(t) - {} - T &t_; - T & get() { return t_; } - T & get_lvalue() { return t_; } - }; - - template<class T> - struct ref_holder<const T> - { - ref_holder(const T &t) - : t_(t) - {} - const T &t_; - const T & get() { return t_; } - const T & get_lvalue() { return t_; } - }; - - template<class T> - struct ref_holder<const T &&> - { - ref_holder(const T &t) - : t_(t) - {} - const T &t_; - const T & get() { return t_; } - const T & get_lvalue() { return t_; } - }; - - template<class T> - struct ref_holder - { - ref_holder(T &&t) - : t_(t) - {} - T &t_; - T && get() { return ::boost::move(t_); } - T & get_lvalue() { return t_; } - }; - - template<class T> - struct ref_holder<T &&> - { - ref_holder(T &&t) - : t(t) - {} - T &t; - T && get() { return ::boost::move(t_); } - T & get_lvalue() { return t_; } - }; - - } //namespace ipcdetail { - } //namespace interprocess { - } //namespace boost { - - #define BOOST_INTERPROCESS_PP_PARAM_DEFINE(z, n, data) \ - ::boost::interprocess::ipcdetail::ref_holder<BOOST_PP_CAT(P, n)> BOOST_PP_CAT(m_p, n); \ - //! - - #define BOOST_INTERPROCESS_PP_PARAM_INC(z, n, data) \ - BOOST_PP_CAT(++m_p, n).get_lvalue() \ - //! - - #else //BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG - - #define BOOST_INTERPROCESS_PP_PARAM_DEFINE(z, n, data)\ - BOOST_PP_CAT(P, n) && BOOST_PP_CAT(m_p, n); \ - //! - - #define BOOST_INTERPROCESS_PP_PARAM_INC(z, n, data) \ - BOOST_PP_CAT(++m_p, n) \ - //! - - #endif //defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) - -#else - #define BOOST_INTERPROCESS_PP_PARAM_DEFINE(z, n, data) \ - BOOST_PP_CAT(P, n) & BOOST_PP_CAT(m_p, n); \ - //! - - #define BOOST_INTERPROCESS_PP_PARAM_INC(z, n, data) \ - BOOST_PP_CAT(++m_p, n) \ - //! - -#endif - -#define BOOST_INTERPROCESS_PP_PARAM_FORWARD(z, n, data) \ -::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \ -//! - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) - - #define BOOST_INTERPROCESS_PP_MEMBER_FORWARD(z, n, data) BOOST_PP_CAT(this->m_p, n).get() \ - //! - - #define BOOST_INTERPROCESS_PP_MEMBER_IT_FORWARD(z, n, data) \ - BOOST_PP_CAT(*m_p, n).get_lvalue() \ - //! - -#else - - #define BOOST_INTERPROCESS_PP_MEMBER_FORWARD(z, n, data) \ - ::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \ - //! - - #define BOOST_INTERPROCESS_PP_MEMBER_IT_FORWARD(z, n, data) \ - BOOST_PP_CAT(*m_p, n) \ - //! - - -#endif //!defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) - -#include <boost/interprocess/detail/config_end.hpp> - -#else -#ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING -#error "This file is not needed when perfect forwarding is available" -#endif -#endif //#ifndef BOOST_INTERPROCESS_DETAIL_PREPROCESSOR_HPP diff --git a/boost/interprocess/detail/ptime_wrk.hpp b/boost/interprocess/detail/ptime_wrk.hpp index 87f05e25c2..ca58b7d40c 100644 --- a/boost/interprocess/detail/ptime_wrk.hpp +++ b/boost/interprocess/detail/ptime_wrk.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_PTIME_WRK_HPP #define BOOST_INTERPROCESS_PTIME_WRK_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/robust_emulation.hpp b/boost/interprocess/detail/robust_emulation.hpp index d586db5071..d3e4fa619a 100644 --- a/boost/interprocess/detail/robust_emulation.hpp +++ b/boost/interprocess/detail/robust_emulation.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_ROBUST_EMULATION_HPP #define BOOST_INTERPROCESS_ROBUST_EMULATION_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif diff --git a/boost/interprocess/detail/segment_manager_helper.hpp b/boost/interprocess/detail/segment_manager_helper.hpp index 1809a8d91a..cfa4bd2ba7 100644 --- a/boost/interprocess/detail/segment_manager_helper.hpp +++ b/boost/interprocess/detail/segment_manager_helper.hpp @@ -11,33 +11,35 @@ #ifndef BOOST_INTERPROCESS_SEGMENT_MANAGER_BASE_HPP #define BOOST_INTERPROCESS_SEGMENT_MANAGER_BASE_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> -#include <boost/intrusive/pointer_traits.hpp> - -#include <boost/detail/no_exceptions_support.hpp> +// interprocess +#include <boost/interprocess/exceptions.hpp> +// interprocess/detail #include <boost/interprocess/detail/type_traits.hpp> #include <boost/interprocess/detail/utilities.hpp> #include <boost/interprocess/detail/in_place_interface.hpp> -#include <boost/interprocess/exceptions.hpp> -#include <boost/type_traits/make_unsigned.hpp> -#include <boost/type_traits/alignment_of.hpp> +// container/detail +#include <boost/container/detail/type_traits.hpp> //alignment_of +#include <boost/container/detail/minimal_char_traits_header.hpp> +// intrusive #include <boost/intrusive/pointer_traits.hpp> -#include <cstddef> //std::size_t -#include <string> //char_traits -#include <new> //std::nothrow -#include <utility> //std::pair -#include <iterator> //std::iterator_traits +// move/detail +#include <boost/move/detail/type_traits.hpp> //make_unsigned +// other boost #include <boost/assert.hpp> //BOOST_ASSERT -#include <functional> //unary_function -#ifndef BOOST_NO_EXCEPTIONS -#include <exception> -#endif +#include <boost/core/no_exceptions_support.hpp> +// std +#include <cstddef> //std::size_t //!\file //!Describes the object placed in a memory segment that provides @@ -115,7 +117,7 @@ struct block_header { return get_rounded_size ( size_type(sizeof(Header)) - , size_type(::boost::alignment_of<block_header<size_type> >::value)) + , size_type(::boost::container::container_detail::alignment_of<block_header<size_type> >::value)) + total_size(); } @@ -155,21 +157,19 @@ struct block_header { return m_num_char < b.m_num_char || (m_num_char < b.m_num_char && - std::char_traits<CharType>::compare - (name<CharType>(), b.name<CharType>(), m_num_char) < 0); + std::char_traits<CharType>::compare(name<CharType>(), b.name<CharType>(), m_num_char) < 0); } template<class CharType> bool equal_comp(const block_header<size_type> &b) const { return m_num_char == b.m_num_char && - std::char_traits<CharType>::compare - (name<CharType>(), b.name<CharType>(), m_num_char) == 0; + std::char_traits<CharType>::compare(name<CharType>(), b.name<CharType>(), m_num_char) == 0; } template<class T> static block_header<size_type> *block_header_from_value(T *value) - { return block_header_from_value(value, sizeof(T), ::boost::alignment_of<T>::value); } + { return block_header_from_value(value, sizeof(T), ::boost::container::container_detail::alignment_of<T>::value); } static block_header<size_type> *block_header_from_value(const void *value, std::size_t sz, std::size_t algn) { @@ -189,7 +189,8 @@ struct block_header { block_header<size_type> * hdr = reinterpret_cast<block_header<size_type>*>(reinterpret_cast<char*>(header) + - get_rounded_size(size_type(sizeof(Header)), size_type(::boost::alignment_of<block_header<size_type> >::value))); + get_rounded_size( size_type(sizeof(Header)) + , size_type(::boost::container::container_detail::alignment_of<block_header<size_type> >::value))); //Some sanity checks return hdr; } @@ -199,7 +200,8 @@ struct block_header { Header * hdr = reinterpret_cast<Header*>(reinterpret_cast<char*>(bheader) - - get_rounded_size(size_type(sizeof(Header)), size_type(::boost::alignment_of<block_header<size_type> >::value))); + get_rounded_size( size_type(sizeof(Header)) + , size_type(::boost::container::container_detail::alignment_of<block_header<size_type> >::value))); //Some sanity checks return hdr; } @@ -273,7 +275,7 @@ struct intrusive_value_type_impl intrusive_value_type_impl(){} - enum { BlockHdrAlignment = ::boost::alignment_of<block_header<size_type> >::value }; + enum { BlockHdrAlignment = ::boost::container::container_detail::alignment_of<block_header<size_type> >::value }; block_header<size_type> *get_block_header() const { @@ -346,7 +348,7 @@ struct index_key rebind_pointer<const CharT>::type const_char_ptr_t; typedef CharT char_type; typedef typename boost::intrusive::pointer_traits<const_char_ptr_t>::difference_type difference_type; - typedef typename boost::make_unsigned<difference_type>::type size_type; + typedef typename boost::move_detail::make_unsigned<difference_type>::type size_type; private: //Offset pointer to the object's name @@ -365,9 +367,8 @@ struct index_key { return (m_len < right.m_len) || (m_len == right.m_len && - std::char_traits<char_type>::compare - (to_raw_pointer(mp_str) - ,to_raw_pointer(right.mp_str), m_len) < 0); + std::char_traits<char_type>::compare + (to_raw_pointer(mp_str),to_raw_pointer(right.mp_str), m_len) < 0); } //!Equal to function for index ordering @@ -375,8 +376,7 @@ struct index_key { return m_len == right.m_len && std::char_traits<char_type>::compare - (to_raw_pointer(mp_str), - to_raw_pointer(right.mp_str), m_len) == 0; + (to_raw_pointer(mp_str), to_raw_pointer(right.mp_str), m_len) == 0; } void name(const CharT *nm) @@ -399,7 +399,7 @@ struct index_data { typedef VoidPointer void_pointer; void_pointer m_ptr; - index_data(void *ptr) : m_ptr(ptr){} + explicit index_data(void *ptr) : m_ptr(ptr){} void *value() const { return static_cast<void*>(to_raw_pointer(m_ptr)); } @@ -481,12 +481,10 @@ class segment_manager_iterator_value_adaptor<Iterator, false> template<class Iterator, bool intrusive> struct segment_manager_iterator_transform - : std::unary_function< typename std::iterator_traits<Iterator>::value_type - , segment_manager_iterator_value_adaptor<Iterator, intrusive> > { typedef segment_manager_iterator_value_adaptor<Iterator, intrusive> result_type; - result_type operator()(const typename std::iterator_traits<Iterator>::value_type &arg) const + template <class T> result_type operator()(const T &arg) const { return result_type(arg); } }; diff --git a/boost/interprocess/detail/shared_dir_helpers.hpp b/boost/interprocess/detail/shared_dir_helpers.hpp index 469ea04ac1..a0ac766f4c 100644 --- a/boost/interprocess/detail/shared_dir_helpers.hpp +++ b/boost/interprocess/detail/shared_dir_helpers.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_SHARED_DIR_HELPERS_HPP #define BOOST_INTERPROCESS_DETAIL_SHARED_DIR_HELPERS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/simple_swap.hpp b/boost/interprocess/detail/simple_swap.hpp new file mode 100644 index 0000000000..797a997075 --- /dev/null +++ b/boost/interprocess/detail/simple_swap.hpp @@ -0,0 +1,29 @@ +#ifndef BOOST_INTERPROCESS_DETAIL_SWAP_HPP +#define BOOST_INTERPROCESS_DETAIL_SWAP_HPP +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-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) +// +// See http://www.boost.org/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +namespace boost { namespace interprocess { + +template<class T> +void simple_swap(T&x, T&y) +{ T tmp(x); x = y; y = tmp; } + +}} //namespace boost{ namespace interprocess { + +#endif //#ifndef BOOST_INTERPROCESS_DETAIL_SWAP_HPP diff --git a/boost/interprocess/detail/std_fwd.hpp b/boost/interprocess/detail/std_fwd.hpp new file mode 100644 index 0000000000..e3f6fc52a8 --- /dev/null +++ b/boost/interprocess/detail/std_fwd.hpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-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) +// +// See http://www.boost.org/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_INTERPROCESS_DETAIL_STD_FWD_HPP +#define BOOST_INTERPROCESS_DETAIL_STD_FWD_HPP + +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +////////////////////////////////////////////////////////////////////////////// +// Standard predeclarations +////////////////////////////////////////////////////////////////////////////// + +#if defined(__clang__) && defined(_LIBCPP_VERSION) + #define BOOST_INTERPROCESS_CLANG_INLINE_STD_NS + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wc++11-extensions" + #define BOOST_INTERPROCESS_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD + #define BOOST_INTERPROCESS_STD_NS_END _LIBCPP_END_NAMESPACE_STD +#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE_VERSION) //GCC >= 4.6 + #define BOOST_INTERPROCESS_STD_NS_BEG namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION + #define BOOST_INTERPROCESS_STD_NS_END _GLIBCXX_END_NAMESPACE_VERSION } // namespace +#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE) //GCC >= 4.2 + #define BOOST_INTERPROCESS_STD_NS_BEG _GLIBCXX_BEGIN_NAMESPACE(std) + #define BOOST_INTERPROCESS_STD_NS_END _GLIBCXX_END_NAMESPACE +#else + #define BOOST_INTERPROCESS_STD_NS_BEG namespace std{ + #define BOOST_INTERPROCESS_STD_NS_END } +#endif + +BOOST_INTERPROCESS_STD_NS_BEG + +struct input_iterator_tag; +struct forward_iterator_tag; +struct bidirectional_iterator_tag; +struct random_access_iterator_tag; + +template<class T> +struct char_traits; + +template<class CharT, class Traits> +class basic_ostream; + +template<class CharT, class Traits> +class basic_istream; + +BOOST_INTERPROCESS_STD_NS_END + +#ifdef BOOST_INTERPROCESS_CLANG_INLINE_STD_NS + #pragma GCC diagnostic pop + #undef BOOST_INTERPROCESS_CLANG_INLINE_STD_NS +#endif //BOOST_INTERPROCESS_CLANG_INLINE_STD_NS + +#endif //#ifndef BOOST_INTERPROCESS_DETAIL_STD_FWD_HPP diff --git a/boost/interprocess/detail/transform_iterator.hpp b/boost/interprocess/detail/transform_iterator.hpp index 5496d19568..1c4dcd3aeb 100644 --- a/boost/interprocess/detail/transform_iterator.hpp +++ b/boost/interprocess/detail/transform_iterator.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2012. +// (C) Copyright Ion Gaztanaga 2005-2015. // (C) Copyright Gennaro Prota 2003 - 2004. // // Distributed under the Boost Software License, Version 1.0. @@ -14,17 +14,23 @@ #ifndef BOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP #define BOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> +// interprocess #include <boost/interprocess/interprocess_fwd.hpp> - -#include <iterator> +// interprocess/detail #include <boost/interprocess/detail/type_traits.hpp> +// move/detail +#include <boost/container/detail/iterator.hpp> namespace boost { namespace interprocess { @@ -60,14 +66,14 @@ struct operator_arrow_proxy<T&> template <class Iterator, class UnaryFunction> class transform_iterator : public UnaryFunction - , public std::iterator - < typename std::iterator_traits<Iterator>::iterator_category - , typename ipcdetail::remove_reference<typename UnaryFunction::result_type>::type - , typename std::iterator_traits<Iterator>::difference_type - , operator_arrow_proxy<typename UnaryFunction::result_type> - , typename UnaryFunction::result_type> { public: + typedef typename ::boost::container::iterator_traits<Iterator>::iterator_category iterator_category; + typedef typename ipcdetail::remove_reference<typename UnaryFunction::result_type>::type value_type; + typedef typename ::boost::container::iterator_traits<Iterator>::difference_type difference_type; + typedef operator_arrow_proxy<typename UnaryFunction::result_type> pointer; + typedef typename UnaryFunction::result_type reference; + explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction()) : UnaryFunction(f), m_it(it) {} @@ -115,33 +121,33 @@ class transform_iterator friend bool operator>= (const transform_iterator& i, const transform_iterator& i2) { return !(i < i2); } - friend typename std::iterator_traits<Iterator>::difference_type operator- (const transform_iterator& i, const transform_iterator& i2) + friend difference_type operator- (const transform_iterator& i, const transform_iterator& i2) { return i2.distance_to(i); } //Arithmetic - transform_iterator& operator+=(typename std::iterator_traits<Iterator>::difference_type off) + transform_iterator& operator+=(difference_type off) { this->advance(off); return *this; } - transform_iterator operator+(typename std::iterator_traits<Iterator>::difference_type off) const + transform_iterator operator+(difference_type off) const { transform_iterator other(*this); other.advance(off); return other; } - friend transform_iterator operator+(typename std::iterator_traits<Iterator>::difference_type off, const transform_iterator& right) + friend transform_iterator operator+(difference_type off, const transform_iterator& right) { return right + off; } - transform_iterator& operator-=(typename std::iterator_traits<Iterator>::difference_type off) + transform_iterator& operator-=(difference_type off) { this->advance(-off); return *this; } - transform_iterator operator-(typename std::iterator_traits<Iterator>::difference_type off) const + transform_iterator operator-(difference_type off) const { return *this + (-off); } typename UnaryFunction::result_type operator*() const { return dereference(); } - typename UnaryFunction::result_type operator[](typename std::iterator_traits<Iterator>::difference_type off) const + typename UnaryFunction::result_type operator[](difference_type off) const { return UnaryFunction::operator()(m_it[off]); } operator_arrow_proxy<typename UnaryFunction::result_type> @@ -172,11 +178,11 @@ class transform_iterator typename UnaryFunction::result_type dereference() const { return UnaryFunction::operator()(*m_it); } - void advance(typename std::iterator_traits<Iterator>::difference_type n) - { std::advance(m_it, n); } + void advance(difference_type n) + { ::boost::container::iterator_advance(m_it, n); } - typename std::iterator_traits<Iterator>::difference_type distance_to(const transform_iterator &other)const - { return std::distance(other.m_it, m_it); } + difference_type distance_to(const transform_iterator &other)const + { return ::boost::container::iterator_distance(other.m_it, m_it); } }; template <class Iterator, class UnaryFunc> @@ -192,4 +198,3 @@ make_transform_iterator(Iterator it, UnaryFunc fun) #include <boost/interprocess/detail/config_end.hpp> #endif //#ifndef BOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP - diff --git a/boost/interprocess/detail/type_traits.hpp b/boost/interprocess/detail/type_traits.hpp index e56a495754..5765c888e7 100644 --- a/boost/interprocess/detail/type_traits.hpp +++ b/boost/interprocess/detail/type_traits.hpp @@ -13,7 +13,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP #define BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/boost/interprocess/detail/utilities.hpp b/boost/interprocess/detail/utilities.hpp index 351b76cce4..f1375d7361 100644 --- a/boost/interprocess/detail/utilities.hpp +++ b/boost/interprocess/detail/utilities.hpp @@ -14,7 +14,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_UTILITIES_HPP #define BOOST_INTERPROCESS_DETAIL_UTILITIES_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -23,17 +27,12 @@ #include <boost/interprocess/interprocess_fwd.hpp> #include <boost/move/utility_core.hpp> -#include <boost/type_traits/has_trivial_destructor.hpp> #include <boost/interprocess/detail/min_max.hpp> #include <boost/interprocess/detail/type_traits.hpp> -#include <boost/interprocess/detail/transform_iterator.hpp> #include <boost/interprocess/detail/mpl.hpp> -#include <boost/interprocess/containers/version_type.hpp> #include <boost/intrusive/pointer_traits.hpp> #include <boost/move/utility_core.hpp> #include <boost/static_assert.hpp> -#include <utility> -#include <algorithm> #include <climits> namespace boost { @@ -49,14 +48,6 @@ inline typename boost::intrusive::pointer_traits<Pointer>::element_type* to_raw_pointer(const Pointer &p) { return boost::interprocess::ipcdetail::to_raw_pointer(p.operator->()); } -//!To avoid ADL problems with swap -template <class T> -inline void do_swap(T& x, T& y) -{ - using std::swap; - swap(x, y); -} - //Rounds "orig_size" by excess to round_to bytes template<class SizeType> inline SizeType get_rounded_size(SizeType orig_size, SizeType round_to) diff --git a/boost/interprocess/detail/variadic_templates_tools.hpp b/boost/interprocess/detail/variadic_templates_tools.hpp index 80154e05d2..c0f591312b 100644 --- a/boost/interprocess/detail/variadic_templates_tools.hpp +++ b/boost/interprocess/detail/variadic_templates_tools.hpp @@ -11,143 +11,25 @@ #ifndef BOOST_INTERPROCESS_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP #define BOOST_INTERPROCESS_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif -#include <boost/interprocess/detail/config_begin.hpp> -#include <boost/interprocess/detail/workaround.hpp> -#include <boost/interprocess/detail/type_traits.hpp> -#include <cstddef> //std::size_t +#include <boost/container/detail/variadic_templates_tools.hpp> namespace boost { namespace interprocess { namespace ipcdetail { -template<typename... Values> -class tuple; - -template<> class tuple<> -{}; - -template<typename Head, typename... Tail> -class tuple<Head, Tail...> - : private tuple<Tail...> -{ - typedef tuple<Tail...> inherited; - - public: - tuple() { } - - // implicit copy-constructor is okay - // Construct tuple from separate arguments. - tuple(typename add_const_reference<Head>::type v, - typename add_const_reference<Tail>::type... vtail) - : inherited(vtail...), m_head(v) - {} - - // Construct tuple from another tuple. - template<typename... VValues> - tuple(const tuple<VValues...>& other) - : m_head(other.head()), inherited(other.tail()) - {} - - template<typename... VValues> - tuple& operator=(const tuple<VValues...>& other) - { - m_head = other.head(); - tail() = other.tail(); - return this; - } - - typename add_reference<Head>::type head() { return m_head; } - typename add_reference<const Head>::type head() const { return m_head; } - - inherited& tail() { return *this; } - const inherited& tail() const { return *this; } - - protected: - Head m_head; -}; - - -template<typename... Values> -tuple<Values&&...> tie_forward(Values&&... values) -{ return tuple<Values&&...>(values...); } - -template<int I, typename Tuple> -struct tuple_element; - -template<int I, typename Head, typename... Tail> -struct tuple_element<I, tuple<Head, Tail...> > -{ - typedef typename tuple_element<I-1, tuple<Tail...> >::type type; -}; - -template<typename Head, typename... Tail> -struct tuple_element<0, tuple<Head, Tail...> > -{ - typedef Head type; -}; - -template<int I, typename Tuple> -class get_impl; - -template<int I, typename Head, typename... Values> -class get_impl<I, tuple<Head, Values...> > -{ - typedef typename tuple_element<I-1, tuple<Values...> >::type Element; - typedef get_impl<I-1, tuple<Values...> > Next; - - public: - typedef typename add_reference<Element>::type type; - typedef typename add_const_reference<Element>::type const_type; - static type get(tuple<Head, Values...>& t) { return Next::get(t.tail()); } - static const_type get(const tuple<Head, Values...>& t) { return Next::get(t.tail()); } -}; - -template<typename Head, typename... Values> -class get_impl<0, tuple<Head, Values...> > -{ - public: - typedef typename add_reference<Head>::type type; - typedef typename add_const_reference<Head>::type const_type; - static type get(tuple<Head, Values...>& t) { return t.head(); } - static const_type get(const tuple<Head, Values...>& t){ return t.head(); } -}; - -template<int I, typename... Values> -typename get_impl<I, tuple<Values...> >::type get(tuple<Values...>& t) -{ return get_impl<I, tuple<Values...> >::get(t); } - -template<int I, typename... Values> -typename get_impl<I, tuple<Values...> >::const_type get(const tuple<Values...>& t) -{ return get_impl<I, tuple<Values...> >::get(t); } - -//////////////////////////////////////////////////// -// Builds an index_tuple<0, 1, 2, ..., Num-1>, that will -// be used to "unpack" into comma-separated values -// in a function call. -//////////////////////////////////////////////////// - -template<int... Indexes> -struct index_tuple{}; - -template<std::size_t Num, typename Tuple = index_tuple<> > -struct build_number_seq; - -template<std::size_t Num, int... Indexes> -struct build_number_seq<Num, index_tuple<Indexes...> > - : build_number_seq<Num - 1, index_tuple<Indexes..., sizeof...(Indexes)> > -{}; - -template<int... Indexes> -struct build_number_seq<0, index_tuple<Indexes...> > -{ typedef index_tuple<Indexes...> type; }; - +using boost::container::container_detail::tuple; +using boost::container::container_detail::build_number_seq; +using boost::container::container_detail::index_tuple; +using boost::container::container_detail::get; }}} //namespace boost { namespace interprocess { namespace ipcdetail { -#include <boost/interprocess/detail/config_end.hpp> - #endif //#ifndef BOOST_INTERPROCESS_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP diff --git a/boost/interprocess/detail/win32_api.hpp b/boost/interprocess/detail/win32_api.hpp index d9d3e70330..b924341c32 100644 --- a/boost/interprocess/detail/win32_api.hpp +++ b/boost/interprocess/detail/win32_api.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_WIN32_API_HPP #define BOOST_INTERPROCESS_WIN32_API_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -26,7 +30,6 @@ #include <boost/assert.hpp> #include <string> #include <vector> -#include <memory> #ifdef BOOST_USE_WINDOWS_H #include <windows.h> @@ -57,6 +60,12 @@ // ////////////////////////////////////////////////////////////////////////////// +//Ignore -pedantic errors here (anonymous structs, etc.) +#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-pedantic" +#endif + namespace boost { namespace interprocess { namespace winapi { @@ -95,7 +104,7 @@ struct decimal unsigned long Lo32; unsigned long Mid32; }; - unsigned __int64 Lo64; + ::boost::ulong_long_type Lo64; }; }; @@ -740,8 +749,8 @@ union system_timeofday_information __int64 liExpTimeZoneBias; unsigned long uCurrentTimeZoneId; unsigned long dwReserved; - unsigned __int64 ullBootTimeBias; - unsigned __int64 ullSleepTimeBias; + ::boost::ulong_long_type ullBootTimeBias; + ::boost::ulong_long_type ullSleepTimeBias; } data; unsigned char Reserved1[sizeof(data_t)]; }; @@ -1314,7 +1323,7 @@ class interprocess_all_access_security { return &sa; } }; -inline void * create_file_mapping (void * handle, unsigned long access, unsigned __int64 file_offset, const char * name, interprocess_security_attributes *psec) +inline void * create_file_mapping (void * handle, unsigned long access, ::boost::ulong_long_type file_offset, const char * name, interprocess_security_attributes *psec) { const unsigned long high_size(file_offset >> 32), low_size((boost::uint32_t)file_offset); return CreateFileMappingA (handle, psec, access, high_size, low_size, name); @@ -1323,9 +1332,9 @@ inline void * create_file_mapping (void * handle, unsigned long access, unsigned inline void * open_file_mapping (unsigned long access, const char *name) { return OpenFileMappingA (access, 0, name); } -inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned __int64 offset, std::size_t numbytes, void *base_addr) +inline void *map_view_of_file_ex(void *handle, unsigned long file_access, ::boost::ulong_long_type offset, std::size_t numbytes, void *base_addr) { - const unsigned long offset_low = (unsigned long)(offset & ((unsigned __int64)0xFFFFFFFF)); + const unsigned long offset_low = (unsigned long)(offset & ((::boost::ulong_long_type)0xFFFFFFFF)); const unsigned long offset_high = offset >> 32; return MapViewOfFileEx(handle, file_access, offset_high, offset_low, numbytes, base_addr); } @@ -2332,6 +2341,10 @@ inline unsigned long get_tick_count() } //namespace interprocess } //namespace boost +#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +# pragma GCC diagnostic pop +#endif + #include <boost/interprocess/detail/config_end.hpp> #endif //#ifdef BOOST_INTERPROCESS_WIN32_API_HPP diff --git a/boost/interprocess/detail/windows_intermodule_singleton.hpp b/boost/interprocess/detail/windows_intermodule_singleton.hpp index 58102689da..12ad2015e3 100644 --- a/boost/interprocess/detail/windows_intermodule_singleton.hpp +++ b/boost/interprocess/detail/windows_intermodule_singleton.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP #define BOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) #pragma once #endif diff --git a/boost/interprocess/detail/workaround.hpp b/boost/interprocess/detail/workaround.hpp index d0456b5053..daf4455be5 100644 --- a/boost/interprocess/detail/workaround.hpp +++ b/boost/interprocess/detail/workaround.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP #define BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -26,7 +30,24 @@ #else #include <unistd.h> - #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED - 0) > 0) + ////////////////////////////////////////////////////// + //Check for XSI shared memory objects. They are available in nearly all UNIX platforms + ////////////////////////////////////////////////////// + #if !defined(__QNXNTO__) && !defined(__ANDROID__) && !defined(__HAIKU__) + #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS + #endif + + ////////////////////////////////////////////////////// + // From SUSv3/UNIX 98, pthread_mutexattr_settype is mandatory + ////////////////////////////////////////////////////// + #if defined(_XOPEN_UNIX) && ((_XOPEN_VERSION + 0) >= 500) + #define BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES + #endif + + ////////////////////////////////////////////////////// + // _POSIX_THREAD_PROCESS_SHARED (POSIX.1b/POSIX.4) + ////////////////////////////////////////////////////// + #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0) //Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not implement it. #if defined(__CYGWIN__) #define BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED @@ -51,62 +72,12 @@ #endif #endif - #if defined(_POSIX_BARRIERS) && ((_POSIX_BARRIERS - 0) > 0) - #define BOOST_INTERPROCESS_POSIX_BARRIERS - #endif - - #if defined(_POSIX_SEMAPHORES) && ((_POSIX_SEMAPHORES - 0) > 0) - #define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES - #if defined(__CYGWIN__) - #define BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK - #endif - //Some platforms have a limited (name length) named semaphore support - #elif (defined(__FreeBSD__) && (__FreeBSD__ >= 4)) || defined(__APPLE__) - #define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES - #endif - - #if (defined (_V6_ILP32_OFFBIG) &&(_V6_ILP32_OFFBIG - 0 > 0)) ||\ - (defined (_V6_LP64_OFF64) &&(_V6_LP64_OFF64 - 0 > 0)) ||\ - (defined (_V6_LPBIG_OFFBIG) &&(_V6_LPBIG_OFFBIG - 0 > 0)) ||\ - (defined (_XBS5_ILP32_OFFBIG)&&(_XBS5_ILP32_OFFBIG - 0 > 0)) ||\ - (defined (_XBS5_LP64_OFF64) &&(_XBS5_LP64_OFF64 - 0 > 0)) ||\ - (defined (_XBS5_LPBIG_OFFBIG)&&(_XBS5_LPBIG_OFFBIG - 0 > 0)) ||\ - (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))||\ - (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64)) - #define BOOST_INTERPROCESS_UNIX_64_BIT_OR_BIGGER_OFF_T - #endif - - //Check for XSI shared memory objects. They are available in nearly all UNIX platforms - #if !defined(__QNXNTO__) && !defined(__ANDROID__) - #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS - #endif - - #if defined(_POSIX_SHARED_MEMORY_OBJECTS) && ((_POSIX_SHARED_MEMORY_OBJECTS - 0) > 0) + ////////////////////////////////////////////////////// + // _POSIX_SHARED_MEMORY_OBJECTS (POSIX.1b/POSIX.4) + ////////////////////////////////////////////////////// + #if ( defined(_POSIX_SHARED_MEMORY_OBJECTS) && ((_POSIX_SHARED_MEMORY_OBJECTS + 0) > 0) ) ||\ + (defined(__vms) && __CRTL_VER >= 70200000) #define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS - #else - //VMS and MACOS don't define it but they have shm_open/close interface - #if defined(__vms) - #if __CRTL_VER >= 70200000 - #define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS - #endif - //Mac OS has some non-conformant features like names limited to SHM_NAME_MAX - #elif defined (__APPLE__) - //#define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS - //#define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS_NO_GROW - #endif - #endif - - //Now check if we have only XSI shared memory - #if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) &&\ - !defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS) - //#define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY - #endif - - #if defined(_POSIX_TIMEOUTS) && ((_POSIX_TIMEOUTS - 0) > 0) - #define BOOST_INTERPROCESS_POSIX_TIMEOUTS - #endif - - #ifdef BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS //Some systems have filesystem-based resources, so the //portable "/shmname" format does not work due to permission issues //For those systems we need to form a path to a temporary directory: @@ -114,23 +85,52 @@ #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 7)) #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY //Some systems have "jailed" environments where shm usage is restricted at runtime - //and temporary file file based shm is possible in those executions. + //and temporary file based shm is possible in those executions. #elif defined(__FreeBSD__) #define BOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY #endif #endif - #ifdef BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES + ////////////////////////////////////////////////////// + // _POSIX_MAPPED_FILES (POSIX.1b/POSIX.4) + ////////////////////////////////////////////////////// + #if defined(_POSIX_MAPPED_FILES) && ((_POSIX_MAPPED_FILES + 0) > 0) + #define BOOST_INTERPROCESS_POSIX_MAPPED_FILES + #endif + + ////////////////////////////////////////////////////// + // _POSIX_SEMAPHORES (POSIX.1b/POSIX.4) + ////////////////////////////////////////////////////// + #if ( defined(_POSIX_SEMAPHORES) && ((_POSIX_SEMAPHORES + 0) > 0) ) ||\ + ( defined(__FreeBSD__) && (__FreeBSD__ >= 4)) || \ + defined(__APPLE__) + #define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES + //MacOsX declares _POSIX_SEMAPHORES but sem_init returns ENOSYS + #if !defined(__APPLE__) + #define BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES + #endif #if defined(__osf__) || defined(__vms) #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES #endif #endif - #if defined(_POSIX_VERSION) && defined(_XOPEN_VERSION) && \ - (((_POSIX_VERSION + 0)>= 200112L || (_XOPEN_VERSION + 0)>= 500)) - #define BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES + ////////////////////////////////////////////////////// + // _POSIX_BARRIERS (SUSv3/Unix03) + ////////////////////////////////////////////////////// + #if defined(_POSIX_BARRIERS) && ((_POSIX_BARRIERS + 0) >= 200112L) + #define BOOST_INTERPROCESS_POSIX_BARRIERS #endif + ////////////////////////////////////////////////////// + // _POSIX_TIMEOUTS (SUSv3/Unix03) + ////////////////////////////////////////////////////// + #if defined(_POSIX_TIMEOUTS) && ((_POSIX_TIMEOUTS + 0L) >= 200112L) + #define BOOST_INTERPROCESS_POSIX_TIMEOUTS + #endif + + ////////////////////////////////////////////////////// + // Detect BSD derivatives to detect sysctl + ////////////////////////////////////////////////////// #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) #define BOOST_INTERPROCESS_BSD_DERIVATIVE //Some *BSD systems (OpenBSD & NetBSD) need sys/param.h before sys/sysctl.h, whereas @@ -142,10 +142,24 @@ //#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME #endif #endif + + ////////////////////////////////////////////////////// + //64 bit offset + ////////////////////////////////////////////////////// + #if (defined (_V6_ILP32_OFFBIG) &&(_V6_ILP32_OFFBIG - 0 > 0)) ||\ + (defined (_V6_LP64_OFF64) &&(_V6_LP64_OFF64 - 0 > 0)) ||\ + (defined (_V6_LPBIG_OFFBIG) &&(_V6_LPBIG_OFFBIG - 0 > 0)) ||\ + (defined (_XBS5_ILP32_OFFBIG)&&(_XBS5_ILP32_OFFBIG - 0 > 0)) ||\ + (defined (_XBS5_LP64_OFF64) &&(_XBS5_LP64_OFF64 - 0 > 0)) ||\ + (defined (_XBS5_LPBIG_OFFBIG)&&(_XBS5_LPBIG_OFFBIG - 0 > 0)) ||\ + (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))||\ + (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64)) + #define BOOST_INTERPROCESS_UNIX_64_BIT_OR_BIGGER_OFF_T + #endif #endif //!defined(BOOST_INTERPROCESS_WINDOWS) -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - #define BOOST_INTERPROCESS_PERFECT_FORWARDING +#if defined(BOOST_INTERPROCESS_WINDOWS) || defined(BOOST_INTERPROCESS_POSIX_MAPPED_FILES) +# define BOOST_INTERPROCESS_MAPPED_FILES #endif //Now declare some Boost.Interprocess features depending on the implementation @@ -154,6 +168,10 @@ #define BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES #endif +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + #define BOOST_INTERPROCESS_PERFECT_FORWARDING +#endif + // Timeout duration use if BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING is set #ifndef BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS #define BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS 10000 @@ -166,37 +184,10 @@ //with processes compiled with those versions. #define BOOST_INTERPROCESS_MSG_QUEUE_CIRCULAR_INDEX -//Inline attributes -#if defined(_MSC_VER) - #define BOOST_INTERPROCESS_ALWAYS_INLINE __forceinline -#elif defined (__GNUC__) - #define BOOST_INTERPROCESS_ALWAYS_INLINE __attribute__((__always_inline__)) -#else - #define BOOST_INTERPROCESS_ALWAYS_INLINE inline -#endif - -#if defined(_MSC_VER) - #define BOOST_INTERPROCESS_NEVER_INLINE __declspec(noinline) -#elif defined (__GNUC__) - #define BOOST_INTERPROCESS_NEVER_INLINE __attribute__((__noinline__)) -#endif - //Macros for documentation purposes. For code, expands to the argument #define BOOST_INTERPROCESS_IMPDEF(TYPE) TYPE #define BOOST_INTERPROCESS_SEEDOC(TYPE) TYPE -#if defined(BOOST_NO_CXX11_NOEXCEPT) - #if defined(BOOST_MSVC) - #define BOOST_INTERPROCESS_NOEXCEPT throw() - #else - #define BOOST_INTERPROCESS_NOEXCEPT - #endif - #define BOOST_INTERPROCESS_NOEXCEPT_IF(x) -#else - #define BOOST_INTERPROCESS_NOEXCEPT noexcept - #define BOOST_INTERPROCESS_NOEXCEPT_IF(x) noexcept(x) -#endif - #include <boost/interprocess/detail/config_end.hpp> #endif //#ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP diff --git a/boost/interprocess/detail/xsi_shared_memory_device.hpp b/boost/interprocess/detail/xsi_shared_memory_device.hpp index 5bb077179a..2f256a5f6c 100644 --- a/boost/interprocess/detail/xsi_shared_memory_device.hpp +++ b/boost/interprocess/detail/xsi_shared_memory_device.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_DEVICE_HPP #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_DEVICE_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -28,6 +32,7 @@ #include <boost/interprocess/detail/utilities.hpp> #include <boost/interprocess/detail/os_file_functions.hpp> #include <boost/interprocess/detail/shared_dir_helpers.hpp> +#include <boost/interprocess/detail/simple_swap.hpp> #include <boost/interprocess/interprocess_fwd.hpp> #include <boost/interprocess/exceptions.hpp> @@ -181,7 +186,7 @@ inline const char *xsi_shared_memory_device::get_name() const inline void xsi_shared_memory_device::swap(xsi_shared_memory_device &other) { m_shm.swap(other.m_shm); - std::swap(m_mode, other.m_mode); + (simple_swap)(m_mode, other.m_mode); m_name.swap(other.m_name); } diff --git a/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp b/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp index d1c71d55f5..b1fe449281 100644 --- a/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp +++ b/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp @@ -11,7 +11,11 @@ #ifndef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif |