1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
From 27f81879228f1a5ad6e41909465a1868d313d2d9 Mon Sep 17 00:00:00 2001
From: rewine <luhongxu@deepin.org>
Date: Thu, 12 Feb 2026 10:33:33 +0800
Subject: [PATCH] Fix Boost.Bind deprecation warnings with version
compatibility
Use conditional compilation to support both old and new Boost.Bind API:
- Boost >= 1.73.0: Use boost/bind/bind.hpp
- Boost < 1.73.0: Use boost/bind.hpp
This approach maintains backward compatibility while fixing deprecation
warnings in newer Boost versions.
---
src/core/search/ParallelMultiSearcher.cpp | 5 +++++
src/core/util/ThreadPool.cpp | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/src/core/search/ParallelMultiSearcher.cpp b/src/core/search/ParallelMultiSearcher.cpp
index f3bf4af0..1d00b612 100644
--- a/src/core/search/ParallelMultiSearcher.cpp
+++ b/src/core/search/ParallelMultiSearcher.cpp
@@ -5,7 +5,12 @@
/////////////////////////////////////////////////////////////////////////////
#include "LuceneInc.h"
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 107300 // Boost 1.73.0+
+#include <boost/bind/bind.hpp>
+#else
#include <boost/bind.hpp>
+#endif
#include <boost/bind/protect.hpp>
#include "ParallelMultiSearcher.h"
#include "_MultiSearcher.h"
diff --git a/src/core/util/ThreadPool.cpp b/src/core/util/ThreadPool.cpp
index 116f521c..ee6640b3 100644
--- a/src/core/util/ThreadPool.cpp
+++ b/src/core/util/ThreadPool.cpp
@@ -5,6 +5,12 @@
/////////////////////////////////////////////////////////////////////////////
#include "LuceneInc.h"
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 107300 // Boost 1.73.0+
+#include <boost/bind/bind.hpp>
+#else
+#include <boost/bind.hpp>
+#endif
#include "ThreadPool.h"
namespace Lucene {
|