File wesnoth-fix-building-with-boost-186.patch of Package wesnoth

diff -Nur wesnoth-1.18.2-orig/src/server/campaignd/server.cpp wesnoth-1.18.2/src/server/campaignd/server.cpp
--- wesnoth-1.18.2-orig/src/server/campaignd/server.cpp	2024-06-29 05:42:43.000000000 +0200
+++ wesnoth-1.18.2/src/server/campaignd/server.cpp	2024-10-14 17:45:43.171889831 +0200
@@ -490,14 +490,22 @@
 {
 	boost::asio::spawn(io_service_, [this, socket](boost::asio::yield_context yield) {
 		serve_requests(socket, yield);
-	});
+	}
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 }
 
 void server::handle_new_client(socket_ptr socket)
 {
 	boost::asio::spawn(io_service_, [this, socket](boost::asio::yield_context yield) {
 		serve_requests(socket, yield);
-	});
+	}
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 }
 
 template<class Socket>
diff -Nur wesnoth-1.18.2-orig/src/server/common/server_base.cpp wesnoth-1.18.2/src/server/common/server_base.cpp
--- wesnoth-1.18.2-orig/src/server/common/server_base.cpp	2024-06-29 05:42:43.000000000 +0200
+++ wesnoth-1.18.2/src/server/common/server_base.cpp	2024-10-01 18:43:29.461438175 +0200
@@ -81,10 +81,18 @@
 void server_base::start_server()
 {
 	boost::asio::ip::tcp::endpoint endpoint_v6(boost::asio::ip::tcp::v6(), port_);
-	boost::asio::spawn(io_service_, [this, endpoint_v6](boost::asio::yield_context yield) { serve(yield, acceptor_v6_, endpoint_v6); });
+	boost::asio::spawn(io_service_, [this, endpoint_v6](boost::asio::yield_context yield) { serve(yield, acceptor_v6_, endpoint_v6); }
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 
 	boost::asio::ip::tcp::endpoint endpoint_v4(boost::asio::ip::tcp::v4(), port_);
-	boost::asio::spawn(io_service_, [this, endpoint_v4](boost::asio::yield_context yield) { serve(yield, acceptor_v4_, endpoint_v4); });
+	boost::asio::spawn(io_service_, [this, endpoint_v4](boost::asio::yield_context yield) { serve(yield, acceptor_v4_, endpoint_v4); }
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 
 	handshake_response_ = htonl(42);
 
@@ -122,7 +130,11 @@
 	}
 
 	if(accepting_connections()) {
-		boost::asio::spawn(io_service_, [this, &acceptor, endpoint](boost::asio::yield_context yield) { serve(yield, acceptor, endpoint); });
+		boost::asio::spawn(io_service_, [this, &acceptor, endpoint](boost::asio::yield_context yield) { serve(yield, acceptor, endpoint); }
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 	} else {
 		return;
 	}
@@ -567,6 +579,9 @@
 		io_service_, [this, doc_ptr = doc.clone(), socket](boost::asio::yield_context yield) mutable {
 			send_doc_queued(socket, doc_ptr, yield);
 		}
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
 	);
 }
 
diff -Nur wesnoth-1.18.2-orig/src/server/wesnothd/server.cpp wesnoth-1.18.2/src/server/wesnothd/server.cpp
--- wesnoth-1.18.2-orig/src/server/wesnothd/server.cpp	2024-06-29 05:42:43.000000000 +0200
+++ wesnoth-1.18.2/src/server/wesnothd/server.cpp	2024-10-01 18:45:42.378324086 +0200
@@ -668,12 +668,20 @@
 
 void server::handle_new_client(socket_ptr socket)
 {
-	boost::asio::spawn(io_service_, [socket, this](boost::asio::yield_context yield) { login_client(yield, socket); });
+	boost::asio::spawn(io_service_, [socket, this](boost::asio::yield_context yield) { login_client(yield, socket); }
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 }
 
 void server::handle_new_client(tls_socket_ptr socket)
 {
-	boost::asio::spawn(io_service_, [socket, this](boost::asio::yield_context yield) { login_client(yield, socket); });
+	boost::asio::spawn(io_service_, [socket, this](boost::asio::yield_context yield) { login_client(yield, socket); }
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
+	);
 }
 
 template<class SocketPtr>
@@ -774,6 +782,9 @@
 			default_time_period_,
 			is_moderator
 		}](boost::asio::yield_context yield) { handle_player(yield, socket, new_player); }
+#if BOOST_VERSION >= 108000
+		, [](std::exception_ptr e) { if (e) std::rethrow_exception(e); }
+#endif
 	);
 
 	LOG_SERVER << log_address(socket) << "\t" << username << "\thas logged on"
openSUSE Build Service is sponsored by