From 5d526092fb68a38813b9bea7f5dd27ab91198cf4 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 23 Apr 2020 13:45:23 -0400 Subject: [PATCH 1/3] Addition needed for Embarcarder clang-based compilers. --- src/dlmalloc_2_8_6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dlmalloc_2_8_6.c b/src/dlmalloc_2_8_6.c index 7a53d35..d09464d 100644 --- a/src/dlmalloc_2_8_6.c +++ b/src/dlmalloc_2_8_6.c @@ -1515,7 +1515,7 @@ LONG __cdecl _InterlockedExchange(LONG volatile *Target, LONG Value); #pragma intrinsic (_InterlockedExchange) #define interlockedcompareexchange _InterlockedCompareExchange #define interlockedexchange _InterlockedExchange -#elif defined(WIN32) && defined(__GNUC__) +#elif defined(WIN32) && (defined(__GNUC__) || defined(__clang__)) #define interlockedcompareexchange(a, b, c) __sync_val_compare_and_swap(a, c, b) #define interlockedexchange __sync_lock_test_and_set #endif /* Win32 */ From cc5c59c7a5e2e871221714748fab19f3e79b51f1 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Fri, 24 Apr 2020 15:10:57 -0400 Subject: [PATCH 2/3] Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero. --- .../boost/container/pmr/memory_resource.hpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/boost/container/pmr/memory_resource.hpp b/include/boost/container/pmr/memory_resource.hpp index 5ca2d73..2436bb0 100644 --- a/include/boost/container/pmr/memory_resource.hpp +++ b/include/boost/container/pmr/memory_resource.hpp @@ -52,6 +52,8 @@ class BOOST_CONTAINER_DECL memory_resource //! `return return do_is_equal(other);` bool is_equal(const memory_resource& other) const BOOST_NOEXCEPT { return this->do_is_equal(other); } + + #if !defined(BOOST_EMBTC) //! Returns: //! `&a == &b || a.is_equal(b)`. @@ -62,6 +64,18 @@ class BOOST_CONTAINER_DECL memory_resource //! !(a == b). friend bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT { return !(a == b); } + + #else + + //! Returns: + //! `&a == &b || a.is_equal(b)`. + friend bool operator==(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT; + + //! Returns: + //! !(a == b). + friend bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT; + + #endif protected: //! Requires: Alignment shall be a power of two. @@ -93,6 +107,20 @@ class BOOST_CONTAINER_DECL memory_resource virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT = 0; }; +#if defined(BOOST_EMBTC) + +//! Returns: +//! `&a == &b || a.is_equal(b)`. +inline bool operator==(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT +{ return &a == &b || a.is_equal(b); } + +//! Returns: +//! !(a == b). +inline bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT +{ return !(a == b); } + +#endif + } //namespace pmr { } //namespace container { } //namespace boost { From c064db0cb8e6a764828151d67972ba221528dbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 25 May 2020 00:46:54 +0200 Subject: [PATCH 3/3] Update changelog with pull 146 --- doc/container.qbk | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/container.qbk b/doc/container.qbk index 1600767..3ff37f1 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -1322,6 +1322,7 @@ use [*Boost.Container]? There are several reasons for that: * Fixed bugs: * [@https://github.com/boostorg/container/issues/144 GitHub #144: ['"GCC suggest-override warnings"]]. * [@https://github.com/boostorg/container/issues/145 GitHub #145: ['"Allocations not handled correctly in some cases of vector move with unequal allocators"]]. + * [@https://github.com/boostorg/container/pull/146 GitHub #146: ['"Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Addition needed for Embarcardero clang-based compilers"]]. * [@https://github.com/boostorg/container/pull/148 GitHub #148: ['"Fix static initialization issues in pmr global resources"]]. [endsect]