Fix Boost.Signals2 C++20 compatibility (#1834764)

This commit is contained in:
Avi Kivity 2020-05-12 14:39:35 +03:00
parent 5d6038484f
commit ab7eefd18e
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 675ea3ddf714e2594393ed935f64dce99721b7d7 Mon Sep 17 00:00:00 2001
From: Avi Kivity <avi@scylladb.com>
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<Allocator>::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

View File

@ -42,7 +42,7 @@ Name: boost
%global real_name boost %global real_name boost
Summary: The free peer-reviewed portable C++ source libraries Summary: The free peer-reviewed portable C++ source libraries
Version: 1.69.0 Version: 1.69.0
Release: 17%{?dist} Release: 18%{?dist}
License: Boost and MIT and Python License: Boost and MIT and Python
# Replace each . with _ in %%{version} # 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 # https://bugzilla.redhat.com/show_bug.cgi?id=1832639
Patch87: boost-1.69.0-test-cxx20.patch 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 tests
%bcond_with docs_generated %bcond_with docs_generated
@ -658,6 +661,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x
%patch85 -p2 %patch85 -p2
%patch86 -p1 %patch86 -p1
%patch87 -p2 %patch87 -p2
%patch88 -p2
%build %build
# Dump the versions being used into the build logs. # Dump the versions being used into the build logs.
@ -1243,6 +1247,9 @@ fi
%{_mandir}/man1/bjam.1* %{_mandir}/man1/bjam.1*
%changelog %changelog
* Tue May 12 2020 Avi Kivity <avi@scylladb.com> - 1.69.0-18
- Add patch for C++20 compatibility in Boost.Signals2 (#1834764)
* Mon May 11 2020 Jonathan Wakely <jwakely@redhat.com> - 1.69.0-17 * Mon May 11 2020 Jonathan Wakely <jwakely@redhat.com> - 1.69.0-17
- Add patch for C++20 compatibility in Boost.Test (#1832639) - Add patch for C++20 compatibility in Boost.Test (#1832639)