From b20a0167b516eed290ac361f6cbf995f29472695 Mon Sep 17 00:00:00 2001 From: Brian Bockelman Date: Tue, 22 Apr 2025 10:49:29 -0500 Subject: [PATCH 1/2] Add C++17 compatibility by using std::remove_if instead of std::erase_if and adding explicit include of `atomic` --- src/Prestage.cc | 3 ++- src/XrdHttpPelican.hh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Prestage.cc b/src/Prestage.cc index d70c51d..1006484 100644 --- a/src/Prestage.cc +++ b/src/Prestage.cc @@ -110,9 +110,10 @@ void PrestageRequestManager::PrestageQueue::PrestageWorker::Run() { void PrestageRequestManager::PrestageQueue::Done(PrestageWorker *worker) { std::unique_lock lock(m_mutex); m_done = true; - std::erase_if(m_workers, [&](std::unique_ptr &other) { + auto it = std::remove_if(m_workers.begin(), m_workers.end(), [&](std::unique_ptr &other) { return other.get() == worker; }); + m_workers.erase(it, m_workers.end()); if (m_workers.empty()) { lock.unlock(); diff --git a/src/XrdHttpPelican.hh b/src/XrdHttpPelican.hh index f8215b2..6b3b51b 100644 --- a/src/XrdHttpPelican.hh +++ b/src/XrdHttpPelican.hh @@ -18,6 +18,7 @@ #include "private/XrdHttp/XrdHttpExtHandler.hh" +#include #include #include #include From 369f4231cb207c00c64aa414d96b4292c7869ab5 Mon Sep 17 00:00:00 2001 From: Brian P Bockelman Date: Tue, 22 Apr 2025 10:51:56 -0500 Subject: [PATCH 2/2] Accept linter formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/Prestage.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Prestage.cc b/src/Prestage.cc index 1006484..9744543 100644 --- a/src/Prestage.cc +++ b/src/Prestage.cc @@ -110,9 +110,10 @@ void PrestageRequestManager::PrestageQueue::PrestageWorker::Run() { void PrestageRequestManager::PrestageQueue::Done(PrestageWorker *worker) { std::unique_lock lock(m_mutex); m_done = true; - auto it = std::remove_if(m_workers.begin(), m_workers.end(), [&](std::unique_ptr &other) { - return other.get() == worker; - }); + auto it = std::remove_if(m_workers.begin(), m_workers.end(), + [&](std::unique_ptr &other) { + return other.get() == worker; + }); m_workers.erase(it, m_workers.end()); if (m_workers.empty()) {