From e242de82aae402d019db4480fdf2505044c4bd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 23 Dec 2015 21:42:33 +0100 Subject: [PATCH] Replaced BOOST_FORCEINLINE with BOOST_INTERPROCESS_FORCEINLINE so it's configurable. --- doc/Jamfile.v2 | 4 +- .../boost/interprocess/detail/utilities.hpp | 18 +-- .../boost/interprocess/detail/workaround.hpp | 17 ++- include/boost/interprocess/offset_ptr.hpp | 140 +++++++++--------- 4 files changed, 95 insertions(+), 84 deletions(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index c22059f..9badd3c 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -43,7 +43,9 @@ doxygen autodoc \"BOOST_RV_REF(T)=T&&\" \\ \"BOOST_RV_REF_BEG=\" \\ \"BOOST_RV_REF_END=&&\" \\ - \"BOOST_FWD_REF(T)=T&&\"" + \"BOOST_FWD_REF(T)=T&&\" \\ + \"BOOST_INTERPROCESS_FORCEINLINE=inline\" \\ + " "boost.doxygen.reftitle=Boost.Interprocess Header Reference" ; diff --git a/include/boost/interprocess/detail/utilities.hpp b/include/boost/interprocess/detail/utilities.hpp index 7ff3def..e1be2f1 100644 --- a/include/boost/interprocess/detail/utilities.hpp +++ b/include/boost/interprocess/detail/utilities.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. @@ -123,8 +123,8 @@ struct is_intrusive_index static const bool value = false; }; -template T* -addressof(T& v) +template +BOOST_INTERPROCESS_FORCEINLINE T* addressof(T& v) { return reinterpret_cast( &const_cast(reinterpret_cast(v))); @@ -148,7 +148,7 @@ inline bool multiplication_overflows(SizeType a, SizeType b) } template -inline bool size_overflows(SizeType count) +BOOST_INTERPROCESS_FORCEINLINE bool size_overflows(SizeType count) { //Compile time-check BOOST_STATIC_ASSERT(SztSizeOfType <= SizeType(-1)); @@ -163,18 +163,18 @@ template class pointer_uintptr_caster { public: - BOOST_FORCEINLINE explicit pointer_uintptr_caster(uintptr_t sz) + BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(uintptr_t sz) : m_uintptr(sz) {} - BOOST_FORCEINLINE explicit pointer_uintptr_caster(const volatile T *p) + BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(const volatile T *p) : m_uintptr(reinterpret_cast(p)) {} - BOOST_FORCEINLINE uintptr_t uintptr() const + BOOST_INTERPROCESS_FORCEINLINE uintptr_t uintptr() const { return m_uintptr; } - BOOST_FORCEINLINE T* pointer() const + BOOST_INTERPROCESS_FORCEINLINE T* pointer() const { return reinterpret_cast(m_uintptr); } private: @@ -196,7 +196,7 @@ class value_eraser ~value_eraser() { if(m_erase) m_cont.erase(m_index_it); } - void release() { m_erase = false; } + BOOST_INTERPROCESS_FORCEINLINE void release() { m_erase = false; } private: Cont &m_cont; diff --git a/include/boost/interprocess/detail/workaround.hpp b/include/boost/interprocess/detail/workaround.hpp index d7e86f4..5089696 100644 --- a/include/boost/interprocess/detail/workaround.hpp +++ b/include/boost/interprocess/detail/workaround.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-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) // @@ -19,8 +19,6 @@ # pragma once #endif -#include - #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) #define BOOST_INTERPROCESS_WINDOWS #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION @@ -191,6 +189,17 @@ #define BOOST_INTERPROCESS_I , #define BOOST_INTERPROCESS_DOCIGN(T1) T1 -#include +//#define BOOST_INTERPROCESS_DISABLE_FORCEINLINE + +#if defined(BOOST_INTERPROCESS_DISABLE_FORCEINLINE) + #define BOOST_INTERPROCESS_FORCEINLINE inline +#elif defined(BOOST_INTERPROCESS_FORCEINLINE_IS_BOOST_FORCELINE) + #define BOOST_INTERPROCESS_FORCEINLINE BOOST_FORCEINLINE +#elif defined(BOOST_MSVC) && defined(_DEBUG) + //"__forceinline" and MSVC seems to have some bugs in debug mode + #define BOOST_INTERPROCESS_FORCEINLINE inline +#else + #define BOOST_INTERPROCESS_FORCEINLINE BOOST_FORCEINLINE +#endif #endif //#ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP diff --git a/include/boost/interprocess/offset_ptr.hpp b/include/boost/interprocess/offset_ptr.hpp index 622b3cd..d668fca 100644 --- a/include/boost/interprocess/offset_ptr.hpp +++ b/include/boost/interprocess/offset_ptr.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2014. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-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) // @@ -79,7 +79,7 @@ namespace ipcdetail { // //////////////////////////////////////////////////////////////////////// #define BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_PTR - BOOST_FORCEINLINE void * offset_ptr_to_raw_pointer(const volatile void *this_ptr, uintptr_t offset) + BOOST_INTERPROCESS_FORCEINLINE void * offset_ptr_to_raw_pointer(const volatile void *this_ptr, uintptr_t offset) { typedef pointer_uintptr_caster caster_t; #ifndef BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_PTR @@ -104,7 +104,7 @@ namespace ipcdetail { // //////////////////////////////////////////////////////////////////////// #define BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_OFF - BOOST_FORCEINLINE uintptr_t offset_ptr_to_offset(const volatile void *ptr, const volatile void *this_ptr) + BOOST_INTERPROCESS_FORCEINLINE uintptr_t offset_ptr_to_offset(const volatile void *ptr, const volatile void *this_ptr) { typedef pointer_uintptr_caster caster_t; #ifndef BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_OFF @@ -137,7 +137,7 @@ namespace ipcdetail { // //////////////////////////////////////////////////////////////////////// #define BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_OFF_FROM_OTHER - BOOST_FORCEINLINE uintptr_t offset_ptr_to_offset_from_other + BOOST_INTERPROCESS_FORCEINLINE uintptr_t offset_ptr_to_offset_from_other (const volatile void *this_ptr, const volatile void *other_ptr, uintptr_t other_offset) { typedef pointer_uintptr_caster caster_t; @@ -242,20 +242,20 @@ class offset_ptr //!Default constructor (null pointer). //!Never throws. - BOOST_FORCEINLINE offset_ptr() BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr() BOOST_NOEXCEPT : internal(1) {} //!Constructor from raw pointer (allows "0" pointer conversion). //!Never throws. - BOOST_FORCEINLINE offset_ptr(pointer ptr) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(pointer ptr) BOOST_NOEXCEPT : internal(static_cast(ipcdetail::offset_ptr_to_offset(ptr, this))) {} //!Constructor from other pointer. //!Never throws. template - BOOST_FORCEINLINE offset_ptr( T *ptr + BOOST_INTERPROCESS_FORCEINLINE offset_ptr( T *ptr , typename ipcdetail::enable_if< ipcdetail::is_convertible >::type * = 0) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(static_cast(ptr), this))) @@ -263,7 +263,7 @@ class offset_ptr //!Constructor from other offset_ptr //!Never throws. - BOOST_FORCEINLINE offset_ptr(const offset_ptr& ptr) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr& ptr) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.internal.m_offset))) {} @@ -271,7 +271,7 @@ class offset_ptr //!Constructor from other offset_ptr. If pointers of pointee types are //!convertible, offset_ptrs will be convertibles. Never throws. template - BOOST_FORCEINLINE offset_ptr( const offset_ptr &ptr + BOOST_INTERPROCESS_FORCEINLINE offset_ptr( const offset_ptr &ptr #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED , typename ipcdetail::enable_if_convertible_equal_address::type* = 0 #endif @@ -285,7 +285,7 @@ class offset_ptr //!Constructor from other offset_ptr. If pointers of pointee types are //!convertible, offset_ptrs will be convertibles. Never throws. template - BOOST_FORCEINLINE offset_ptr( const offset_ptr &ptr + BOOST_INTERPROCESS_FORCEINLINE offset_ptr( const offset_ptr &ptr , typename ipcdetail::enable_if_convertible_unequal_address::type* = 0) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(static_cast(ptr.get()), this))) @@ -296,7 +296,7 @@ class offset_ptr //!Emulates static_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::static_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::static_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(static_cast(r.get()), this))) {} @@ -304,7 +304,7 @@ class offset_ptr //!Emulates const_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::const_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::const_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(const_cast(r.get()), this))) {} @@ -312,7 +312,7 @@ class offset_ptr //!Emulates dynamic_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::dynamic_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::dynamic_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(dynamic_cast(r.get()), this))) {} @@ -320,27 +320,27 @@ class offset_ptr //!Emulates reinterpret_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::reinterpret_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::reinterpret_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(reinterpret_cast(r.get()), this))) {} //!Obtains raw pointer from offset. //!Never throws. - BOOST_FORCEINLINE pointer get() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE pointer get() const BOOST_NOEXCEPT { return (pointer)ipcdetail::offset_ptr_to_raw_pointer(this, this->internal.m_offset); } - BOOST_FORCEINLINE offset_type get_offset() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_type get_offset() const BOOST_NOEXCEPT { return this->internal.m_offset; } //!Pointer-like -> operator. It can return 0 pointer. //!Never throws. - BOOST_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT { return this->get(); } //!Dereferencing operator, if it is a null offset_ptr behavior //! is undefined. Never throws. - BOOST_FORCEINLINE reference operator* () const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE reference operator* () const BOOST_NOEXCEPT { pointer p = this->get(); reference r = *p; @@ -349,12 +349,12 @@ class offset_ptr //!Indexing operator. //!Never throws. - BOOST_FORCEINLINE reference operator[](difference_type idx) const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE reference operator[](difference_type idx) const BOOST_NOEXCEPT { return this->get()[idx]; } //!Assignment from pointer (saves extra conversion). //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator= (pointer from) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator= (pointer from) BOOST_NOEXCEPT { this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset(from, this)); @@ -363,7 +363,7 @@ class offset_ptr //!Assignment from other offset_ptr. //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator= (const offset_ptr & ptr) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator= (const offset_ptr & ptr) BOOST_NOEXCEPT { this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.internal.m_offset)); @@ -372,7 +372,7 @@ class offset_ptr //!Assignment from related offset_ptr. If pointers of pointee types //! are assignable, offset_ptrs will be assignable. Never throws. - template BOOST_FORCEINLINE + template BOOST_INTERPROCESS_FORCEINLINE #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED typename ipcdetail::enable_if_c < ipcdetail::is_convertible::value, offset_ptr&>::type @@ -389,22 +389,22 @@ class offset_ptr //!offset_ptr += difference_type. //!Never throws. - BOOST_FORCEINLINE offset_ptr &operator+= (difference_type offset) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr &operator+= (difference_type offset) BOOST_NOEXCEPT { this->inc_offset(offset * sizeof (PointedType)); return *this; } //!offset_ptr -= difference_type. //!Never throws. - BOOST_FORCEINLINE offset_ptr &operator-= (difference_type offset) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr &operator-= (difference_type offset) BOOST_NOEXCEPT { this->dec_offset(offset * sizeof (PointedType)); return *this; } //!++offset_ptr. //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator++ (void) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator++ (void) BOOST_NOEXCEPT { this->inc_offset(sizeof (PointedType)); return *this; } //!offset_ptr++. //!Never throws. - BOOST_FORCEINLINE offset_ptr operator++ (int) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr operator++ (int) BOOST_NOEXCEPT { offset_ptr tmp(*this); this->inc_offset(sizeof (PointedType)); @@ -413,12 +413,12 @@ class offset_ptr //!--offset_ptr. //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator-- (void) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator-- (void) BOOST_NOEXCEPT { this->dec_offset(sizeof (PointedType)); return *this; } //!offset_ptr--. //!Never throws. - BOOST_FORCEINLINE offset_ptr operator-- (int) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr operator-- (int) BOOST_NOEXCEPT { offset_ptr tmp(*this); this->dec_offset(sizeof (PointedType)); @@ -428,7 +428,7 @@ class offset_ptr //!safe bool conversion operator. //!Never throws. #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - BOOST_FORCEINLINE operator unspecified_bool_type() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE operator unspecified_bool_type() const BOOST_NOEXCEPT { return this->internal.m_offset != 1? &self_t::unspecified_bool_type_func : 0; } #else explicit operator bool() const BOOST_NOEXCEPT @@ -437,7 +437,7 @@ class offset_ptr //!Not operator. Not needed in theory, but improves portability. //!Never throws - BOOST_FORCEINLINE bool operator! () const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE bool operator! () const BOOST_NOEXCEPT { return this->internal.m_offset == 1; } //!Compatibility with pointer_traits @@ -448,92 +448,92 @@ class offset_ptr //!Compatibility with pointer_traits //! - BOOST_FORCEINLINE static offset_ptr pointer_to(reference r) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static offset_ptr pointer_to(reference r) BOOST_NOEXCEPT { return offset_ptr(&r); } //!difference_type + offset_ptr //!operation - BOOST_FORCEINLINE friend offset_ptr operator+(difference_type diff, offset_ptr right) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator+(difference_type diff, offset_ptr right) BOOST_NOEXCEPT { right += diff; return right; } //!offset_ptr + difference_type //!operation - BOOST_FORCEINLINE friend offset_ptr operator+(offset_ptr left, difference_type diff) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator+(offset_ptr left, difference_type diff) BOOST_NOEXCEPT { left += diff; return left; } //!offset_ptr - diff //!operation - BOOST_FORCEINLINE friend offset_ptr operator-(offset_ptr left, difference_type diff) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator-(offset_ptr left, difference_type diff) BOOST_NOEXCEPT { left -= diff; return left; } //!offset_ptr - diff //!operation - BOOST_FORCEINLINE friend offset_ptr operator-(difference_type diff, offset_ptr right) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator-(difference_type diff, offset_ptr right) BOOST_NOEXCEPT { right -= diff; return right; } //!offset_ptr - offset_ptr //!operation - BOOST_FORCEINLINE friend difference_type operator-(const offset_ptr &pt, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend difference_type operator-(const offset_ptr &pt, const offset_ptr &pt2) BOOST_NOEXCEPT { return difference_type(pt.get()- pt2.get()); } //Comparison - BOOST_FORCEINLINE friend bool operator== (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator== (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() == pt2.get(); } - BOOST_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() != pt2.get(); } - BOOST_FORCEINLINE friend bool operator<(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() < pt2.get(); } - BOOST_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() <= pt2.get(); } - BOOST_FORCEINLINE friend bool operator>(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() > pt2.get(); } - BOOST_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() >= pt2.get(); } //Comparison to raw ptr to support literal 0 - BOOST_FORCEINLINE friend bool operator== (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator== (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 == pt2.get(); } - BOOST_FORCEINLINE friend bool operator!= (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator!= (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 != pt2.get(); } - BOOST_FORCEINLINE friend bool operator<(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 < pt2.get(); } - BOOST_FORCEINLINE friend bool operator<=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 <= pt2.get(); } - BOOST_FORCEINLINE friend bool operator>(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 > pt2.get(); } - BOOST_FORCEINLINE friend bool operator>=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 >= pt2.get(); } //Comparison - BOOST_FORCEINLINE friend bool operator== (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator== (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() == pt2; } - BOOST_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() != pt2; } - BOOST_FORCEINLINE friend bool operator<(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() < pt2; } - BOOST_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() <= pt2; } - BOOST_FORCEINLINE friend bool operator>(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() > pt2; } - BOOST_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() >= pt2; } - BOOST_FORCEINLINE friend void swap(offset_ptr &left, offset_ptr &right) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend void swap(offset_ptr &left, offset_ptr &right) BOOST_NOEXCEPT { pointer ptr = right.get(); right = left; @@ -542,33 +542,33 @@ class offset_ptr private: template - BOOST_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT { //no need to pointer adjustment this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.get_offset())); } template - BOOST_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT { //we must convert to raw before calculating the offset this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset(static_cast(ptr.get()), this)); } #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) - BOOST_FORCEINLINE void inc_offset(DifferenceType bytes) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void inc_offset(DifferenceType bytes) BOOST_NOEXCEPT { internal.m_offset += bytes; } - BOOST_FORCEINLINE void dec_offset(DifferenceType bytes) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void dec_offset(DifferenceType bytes) BOOST_NOEXCEPT { internal.m_offset -= bytes; } ipcdetail::offset_ptr_internal internal; public: - BOOST_FORCEINLINE const OffsetType &priv_offset() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE const OffsetType &priv_offset() const BOOST_NOEXCEPT { return internal.m_offset; } - BOOST_FORCEINLINE OffsetType &priv_offset() BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE OffsetType &priv_offset() BOOST_NOEXCEPT { return internal.m_offset; } #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED @@ -590,7 +590,7 @@ inline std::basic_istream & operator>> //!Simulation of static_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr static_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -599,7 +599,7 @@ BOOST_FORCEINLINE boost::interprocess::offset_ptr //!Simulation of const_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr const_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -608,7 +608,7 @@ BOOST_FORCEINLINE boost::interprocess::offset_ptr //!Simulation of dynamic_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr dynamic_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -617,7 +617,7 @@ BOOST_FORCEINLINE boost::interprocess::offset_ptr //!Simulation of reinterpret_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr reinterpret_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -651,7 +651,7 @@ namespace interprocess { //!to_raw_pointer() enables boost::mem_fn to recognize offset_ptr. //!Never throws. template -BOOST_FORCEINLINE T * to_raw_pointer(boost::interprocess::offset_ptr const & p) BOOST_NOEXCEPT +BOOST_INTERPROCESS_FORCEINLINE T * to_raw_pointer(boost::interprocess::offset_ptr const & p) BOOST_NOEXCEPT { return ipcdetail::to_raw_pointer(p); } } //namespace interprocess @@ -696,7 +696,7 @@ struct pointer_plus_bits, NumBits> //We must ALWAYS take argument "n" by reference as a copy of a null pointer //with a bit (e.g. offset == 3) would be incorrectly copied and interpreted as non-null. - BOOST_FORCEINLINE static pointer get_pointer(const pointer &n) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static pointer get_pointer(const pointer &n) BOOST_NOEXCEPT { pointer p; O const tmp_off = n.priv_offset() & O(~Mask); @@ -704,7 +704,7 @@ struct pointer_plus_bits, NumBits> return p; } - BOOST_FORCEINLINE static void set_pointer(pointer &n, const pointer &p) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static void set_pointer(pointer &n, const pointer &p) BOOST_NOEXCEPT { BOOST_ASSERT(0 == (get_bits)(p)); O const stored_bits = O(n.priv_offset() & Mask); @@ -712,12 +712,12 @@ struct pointer_plus_bits, NumBits> n.priv_offset() |= stored_bits; } - BOOST_FORCEINLINE static std::size_t get_bits(const pointer &n) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static std::size_t get_bits(const pointer &n) BOOST_NOEXCEPT { return std::size_t((n.priv_offset() & Mask) >> 1u); } - BOOST_FORCEINLINE static void set_bits(pointer &n, std::size_t const b) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static void set_bits(pointer &n, std::size_t const b) BOOST_NOEXCEPT { BOOST_ASSERT(b < (std::size_t(1) << NumBits)); O tmp = n.priv_offset();