From 8200cc378fcb836ea2134aa1adecb76cb40675c2 Mon Sep 17 00:00:00 2001 From: Harold Cindy <120691094+HaroldCindy@users.noreply.github.com> Date: Thu, 20 Nov 2025 19:17:25 -0800 Subject: [PATCH 1/2] Apply patch to fix C++20 compilation when building --- build-cmd.sh | 5 ++ fix-cpp20-build.patch | 109 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 fix-cpp20-build.patch diff --git a/build-cmd.sh b/build-cmd.sh index 12f6400..10d2b60 100755 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash cd "$(dirname "$0")" +top="$(pwd)" # turn on verbose debugging output for parabuild logs. exec 4>&1; export BASH_XTRACEFD=4; set -x @@ -41,3 +42,7 @@ pushd "$WEBSOCKETPP_SOURCE_DIR" mkdir -p "$stage/LICENSES" cp COPYING "$stage/LICENSES/websocketpp.txt" popd + +# Apply C++20 fixes from websocketpp's PRs +# Note that this patches the build artifacts, not the source! +patch --directory "$stage/include/" -p1 < "$top/fix-cpp20-build.patch" diff --git a/fix-cpp20-build.patch b/fix-cpp20-build.patch new file mode 100644 index 0000000..c5c04f7 --- /dev/null +++ b/fix-cpp20-build.patch @@ -0,0 +1,109 @@ +From 39c4dd128b0c2d0f12f76137b175966b83f535ba Mon Sep 17 00:00:00 2001 +From: snag24 <45948878+snag24@users.noreply.github.com> +Date: Thu, 5 Jun 2025 13:51:32 +0530 +Subject: [PATCH 1/2] Update endpoint.hpp + +--- + websocketpp/endpoint.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp +index c124b1d9a..91c348f10 100644 +--- a/websocketpp/endpoint.hpp ++++ b/websocketpp/endpoint.hpp +@@ -43,7 +43,7 @@ class endpoint : public config::transport_type, public config::endpoint_base { + public: + // Import appropriate types from our helper class + // See endpoint_types for more details. +- typedef endpoint type; ++ typedef endpoint type; + + /// Type of the transport component of this endpoint + typedef typename config::transport_type transport_type; +@@ -109,7 +109,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 + +From 2638897e78d1bab9357c4fba11367f6ec0bab0db Mon Sep 17 00:00:00 2001 +From: snag24 <45948878+snag24@users.noreply.github.com> +Date: Thu, 5 Jun 2025 13:56:00 +0530 +Subject: [PATCH 2/2] c++20 patch + +--- + websocketpp/logger/basic.hpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp +index 84514130e..f0e490e6d 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) +@@ -92,12 +92,12 @@ class basic { + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy assignment operator because of const member variables +- basic & operator=(basic const &) = delete; ++ basic & operator=(basic const &) = delete; + #endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + + #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) +@@ -105,7 +105,7 @@ class basic { + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no move assignment operator because of const member variables +- basic & operator=(basic &&) = delete; ++ basic & operator=(basic &&) = delete; + #endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + + #endif // _WEBSOCKETPP_MOVE_SEMANTICS_ From ec15c2cb36e14269633e3b73ebf1f23d8ddb80d8 Mon Sep 17 00:00:00 2001 From: Harold Cindy <120691094+HaroldCindy@users.noreply.github.com> Date: Thu, 20 Nov 2025 23:39:33 -0800 Subject: [PATCH 2/2] Move patch to patches dir --- build-cmd.sh | 3 ++- fix-cpp20-build.patch => patches/fix-cpp20-build.patch | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename fix-cpp20-build.patch => patches/fix-cpp20-build.patch (100%) diff --git a/build-cmd.sh b/build-cmd.sh index 10d2b60..f407ff5 100755 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -45,4 +45,5 @@ popd # Apply C++20 fixes from websocketpp's PRs # Note that this patches the build artifacts, not the source! -patch --directory "$stage/include/" -p1 < "$top/fix-cpp20-build.patch" +# This only makes sense because this is a header-only library anyhow. +patch --directory "$stage/include/" -p1 < "$top/patches/fix-cpp20-build.patch" diff --git a/fix-cpp20-build.patch b/patches/fix-cpp20-build.patch similarity index 100% rename from fix-cpp20-build.patch rename to patches/fix-cpp20-build.patch