signals: remove boost compatibility guards
What changed, and why it matters
This is a small cleanup of a test file. It removes version-specific workarounds for older Boost library versions, keeping only the behavior needed for the newest Boost version. There is no security issue here.
No security action needed. Treat as routine maintenance/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes preprocessor guards in src/test/btcsignals_tests.cpp that adapted a test fixture (MoveOnlyData) to different Boost.Signals2 requirements across versions 1.85, 1.90, and 1.91. After the change, MoveOnlyData is unconditionally move-constructible-only, matching Boost.Signals2 1.91’s requirements. This is a test-only compatibility cleanup with no production code changes.
Changed components
src/test/btcsignals_tests.cppInspect captured patch +0 / −14
diff --git a/src/test/btcsignals_tests.cpp b/src/test/btcsignals_tests.cpp
index dd4f24f1..b3203ebe 100644
--- a/src/test/btcsignals_tests.cpp
+++ b/src/test/btcsignals_tests.cpp
@@ -9,8 +9,6 @@
#include <semaphore>
-#define BOOST_MINOR_VERSION ((BOOST_VERSION / 100) % 1000)
-
namespace {
@@ -18,21 +16,9 @@ struct MoveOnlyData {
MoveOnlyData(int data) : m_data(data) {}
MoveOnlyData(MoveOnlyData&&) = default;
-#if BOOST_MINOR_VERSION <= 85
- // Boost::signals2 <= 1.85 required copyable return types
- MoveOnlyData(const MoveOnlyData&) = default;
- MoveOnlyData& operator=(const MoveOnlyData&) = default;
-#elif BOOST_MINOR_VERSION <= 90
- // Boost::signals2 <= 1.90 required move-assignable return types
- MoveOnlyData& operator=(MoveOnlyData&&) = default;
- MoveOnlyData(const MoveOnlyData&) = delete;
- MoveOnlyData& operator=(const MoveOnlyData&) = delete;
-#else
- // Boost::signals2 >= 1.91 requires only move-constructible return types
MoveOnlyData& operator=(MoveOnlyData&&) = delete;
MoveOnlyData(const MoveOnlyData&) = delete;
MoveOnlyData& operator=(const MoveOnlyData&) = delete;
-#endif
int m_data;
};
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.