From 48402da9f19d060ffcd40bf2b2e6987212c58b0c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 1 Sep 2020 19:41:18 +0100 Subject: [PATCH] Add patch for C++20 support --- rapidjson-1.1.0-c++20.patch | 31 +++++++++++++++++++++++++++++++ rapidjson.spec | 5 +++++ 2 files changed, 36 insertions(+) create mode 100644 rapidjson-1.1.0-c++20.patch diff --git a/rapidjson-1.1.0-c++20.patch b/rapidjson-1.1.0-c++20.patch new file mode 100644 index 0000000..9b10ae6 --- /dev/null +++ b/rapidjson-1.1.0-c++20.patch @@ -0,0 +1,31 @@ +commit c6c56d87ff12ba8100b261f371fdaa106f95fe14 +Author: Tom Hughes +Date: Tue Sep 1 19:24:03 2020 +0100 + + Avoid ambiguous operator errors in C++20 + + Derived from upstream commit ebcbd04484fcdaddbb9fd7798e76bbfb4ae8f840 + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index e3e20dfb..1485321d 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -168,12 +168,12 @@ public: + + //! @name relations + //@{ +- bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; } +- bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; } +- bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; } +- bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; } +- bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; } +- bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; } ++ template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } ++ template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } ++ template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } ++ template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } ++ template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } ++ template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } + //@} + + //! @name dereference diff --git a/rapidjson.spec b/rapidjson.spec index 47a6ad0..e6816a3 100644 --- a/rapidjson.spec +++ b/rapidjson.spec @@ -10,6 +10,8 @@ URL: http://rapidjson.org/ Source0: https://github.com/Tencent/rapidjson/archive/v%{version}/%{name}-%{version}.tar.gz # Downstream-patch for gtest Patch0: rapidjson-1.1.0-do_not_include_gtest_src_dir.patch +# Upstream derived patch for C++20 support +Patch1: rapidjson-1.1.0-c++20.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -112,6 +114,9 @@ find %{buildroot} -type f -name 'CMake*.txt' -delete %changelog +* Tue Sep 1 2020 Tom Hughes - 1.1.0-14 +- Add patch for C++20 support + * Wed Jul 29 2020 Fedora Release Engineering - 1.1.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild