From 73fb2646ce92371139c598c0038c243f83882613 Mon Sep 17 00:00:00 2001 From: Christian Birk Date: Sun, 27 Aug 2023 17:11:05 +0200 Subject: [PATCH] add patch to fix cpp20 compile errors --- websocketpp-0.8.2-cpp20-fixes.patch | 106 ++++++++++++++++++++++++++++ websocketpp.spec | 10 ++- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 websocketpp-0.8.2-cpp20-fixes.patch diff --git a/websocketpp-0.8.2-cpp20-fixes.patch b/websocketpp-0.8.2-cpp20-fixes.patch new file mode 100644 index 0000000..65c2fb8 --- /dev/null +++ b/websocketpp-0.8.2-cpp20-fixes.patch @@ -0,0 +1,106 @@ +From 3197a520eb4c1e4754860441918a5930160373eb Mon Sep 17 00:00:00 2001 +From: Peter Thorson +Date: Tue, 29 Jun 2021 09:13:12 -0500 +Subject: [PATCH] [core] Remove the use of simple template ids as they have + been removed in c++20. + https://timsong-cpp.github.io/cppwp/n4861/diff.cpp17.class#2 references #991 + +--- + websocketpp/endpoint.hpp | 2 +- + websocketpp/logger/basic.hpp | 14 +++++++------- + websocketpp/roles/server_endpoint.hpp | 6 +++--- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp +index 825eaa46d..10f525689 100644 +--- a/websocketpp/endpoint.hpp ++++ b/websocketpp/endpoint.hpp +@@ -111,7 +111,7 @@ class endpoint : public config::transport_type, public config::endpoint_base { + + + /// Destructor +- ~endpoint() {} ++ ~endpoint() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp +index 84514130e..4c9d83649 100644 +--- a/websocketpp/logger/basic.hpp ++++ b/websocketpp/logger/basic.hpp +@@ -58,33 +58,33 @@ namespace log { + template + class basic { + public: +- basic(channel_type_hint::value h = ++ basic(channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic(std::ostream * out) ++ basic(std::ostream * out) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(out) {} + +- basic(level c, channel_type_hint::value h = ++ basic(level c, channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic(level c, std::ostream * out) ++ basic(level c, std::ostream * out) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(out) {} + + /// Destructor +- ~basic() {} ++ ~basic() {} + + /// Copy constructor +- basic(basic const & other) ++ basic(basic const & other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +@@ -97,7 +97,7 @@ class basic { + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- basic(basic && other) ++ basic(basic && other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +diff --git a/websocketpp/roles/server_endpoint.hpp b/websocketpp/roles/server_endpoint.hpp +index 4a5865eff..04fee18f9 100644 +--- a/websocketpp/roles/server_endpoint.hpp ++++ b/websocketpp/roles/server_endpoint.hpp +@@ -75,11 +75,11 @@ class server : public endpoint,config> { + } + + /// Destructor +- ~server() {} ++ ~server() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +- server(server &) = delete; ++ server(server &) = delete; + + // no copy assignment operator because endpoints are not copyable + server & operator=(server const &) = delete; +@@ -87,7 +87,7 @@ class server : public endpoint,config> { + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- server(server && o) : endpoint,config>(std::move(o)) {} ++ server(server && o) : endpoint,config>(std::move(o)) {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no move assignment operator because of const member variables diff --git a/websocketpp.spec b/websocketpp.spec index 10831e4..182a4ae 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 10%{?dist} +Release: 11%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -29,6 +29,11 @@ Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patc # https://github.com/zaphoyd/websocketpp/commit/3590d77 Patch4: websocketpp-0.8.2-fix-cmake-find-boost.patch +# fix c++20 build error +# https://github.com/zaphoyd/websocketpp/issues/991 +# https://github.com/zaphoyd/websocketpp/commit/3197a520eb4c1e4754860441918a5930160373eb +Patch5: websocketpp-0.8.2-cpp20-fixes.patch + BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ @@ -86,6 +91,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sun Aug 27 2023 Christian Birk - 0.8.2-11 +- add patch to fix c++20 compile errors + * Sat Jan 21 2023 Fedora Release Engineering - 0.8.2-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild