From ab7eefd18e4a59c498aa57356117f53cdb80662e Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 12 May 2020 14:39:35 +0300 Subject: [PATCH] Fix Boost.Signals2 C++20 compatibility (#1834764) --- auto_buffer-C-20-compatibility.patch | 34 ++++++++++++++++++++++++++++ boost.spec | 9 +++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 auto_buffer-C-20-compatibility.patch diff --git a/auto_buffer-C-20-compatibility.patch b/auto_buffer-C-20-compatibility.patch new file mode 100644 index 0000000..6e4a95c --- /dev/null +++ b/auto_buffer-C-20-compatibility.patch @@ -0,0 +1,34 @@ +From 675ea3ddf714e2594393ed935f64dce99721b7d7 Mon Sep 17 00:00:00 2001 +From: Avi Kivity +Date: Tue, 12 May 2020 14:29:56 +0300 +Subject: [PATCH] auto_buffer: C++20 compatibility + +C++20's std::allocator does not define the pointer member type, +use std::allocator_traits instead. +--- + include/boost/signals2/detail/auto_buffer.hpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/boost/signals2/detail/auto_buffer.hpp b/include/boost/signals2/detail/auto_buffer.hpp +index 5ff8dd2..ed62152 100644 +--- a/include/boost/signals2/detail/auto_buffer.hpp ++++ b/include/boost/signals2/detail/auto_buffer.hpp +@@ -140,11 +140,15 @@ namespace detail + typedef Allocator allocator_type; + typedef T value_type; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef T* pointer; ++#if __cplusplus <= 201703L + typedef typename Allocator::pointer allocator_pointer; ++#else ++ typedef typename std::allocator_traits::pointer allocator_pointer; ++#endif + typedef const T* const_pointer; + typedef T& reference; + typedef const T& const_reference; + typedef pointer iterator; + typedef const_pointer const_iterator; +-- +2.26.2 + diff --git a/boost.spec b/boost.spec index f7d7100..90f5916 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.69.0 -Release: 17%{?dist} +Release: 18%{?dist} License: Boost and MIT and Python # Replace each . with _ in %%{version} @@ -153,6 +153,9 @@ Patch86: boost-1.69-format-allocator.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1832639 Patch87: boost-1.69.0-test-cxx20.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1834764 +Patch88: auto_buffer-C-20-compatibility.patch + %bcond_with tests %bcond_with docs_generated @@ -658,6 +661,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x %patch85 -p2 %patch86 -p1 %patch87 -p2 +%patch88 -p2 %build # Dump the versions being used into the build logs. @@ -1243,6 +1247,9 @@ fi %{_mandir}/man1/bjam.1* %changelog +* Tue May 12 2020 Avi Kivity - 1.69.0-18 +- Add patch for C++20 compatibility in Boost.Signals2 (#1834764) + * Mon May 11 2020 Jonathan Wakely - 1.69.0-17 - Add patch for C++20 compatibility in Boost.Test (#1832639)