monero: patch and revision for boost

This commit is contained in:
FX Coudert 2019-04-12 21:19:13 +02:00
parent 0441d0b945
commit 3dd2eebd30

View file

@ -4,7 +4,7 @@ class Monero < Formula
url "https://github.com/monero-project/monero.git",
:tag => "v0.14.0.2",
:revision => "6cadbdcd2d952433db3c2422511ed4d13b2cc824"
revision 1
revision 2
bottle do
cellar :any
@ -27,6 +27,11 @@ class Monero < Formula
sha256 "27d1f56406ba94ee779e639203218820975cf68174f92fbeae0f645df0fcada4"
end
# Upstream commit for Boost 1.70.0
# https://github.com/monero-project/monero/pull/5328
# reworked to apply on 0.14.0.2
patch :DATA
def install
(buildpath/"cppzmq").install resource("cppzmq")
system "cmake", ".", "-DZMQ_INCLUDE_PATH=#{buildpath}/cppzmq",
@ -72,3 +77,48 @@ class Monero < Formula
assert_equal address, shell_output(cmd).lines.last.split[1]
end
end
__END__
diff -pur a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl
--- a/contrib/epee/include/net/abstract_tcp_server2.inl 2019-03-07 14:25:34.000000000 +0100
+++ b/contrib/epee/include/net/abstract_tcp_server2.inl 2019-06-08 17:02:47.000000000 +0200
@@ -60,6 +60,12 @@
#define DEFAULT_TIMEOUT_MS_REMOTE 300000 // 5 minutes
#define TIMEOUT_EXTRA_MS_PER_BYTE 0.2
+#if BOOST_VERSION >= 107000
+#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
+#else
+#define GET_IO_SERVICE(s) ((s).get_io_service())
+#endif
+
PRAGMA_WARNING_PUSH
namespace epee
{
@@ -215,7 +221,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
template<class t_protocol_handler>
boost::asio::io_service& connection<t_protocol_handler>::get_io_service()
{
- return socket_.get_io_service();
+ return GET_IO_SERVICE(socket_);
}
//---------------------------------------------------------------------------------
template<class t_protocol_handler>
@@ -383,7 +389,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
if(!m_is_multithreaded)
{
//single thread model, we can wait in blocked call
- size_t cnt = socket_.get_io_service().run_one();
+ size_t cnt = GET_IO_SERVICE(socket_).run_one();
if(!cnt)//service is going to quit
return false;
}else
@@ -393,7 +399,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
//if no handlers were called
//TODO: Maybe we need to have have critical section + event + callback to upper protocol to
//ask it inside(!) critical region if we still able to go in event wait...
- size_t cnt = socket_.get_io_service().poll_one();
+ size_t cnt = GET_IO_SERVICE(socket_).poll_one();
if(!cnt)
misc_utils::sleep_no_w(0);
}