Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build error on header missing and new version of boost #715

Open
wants to merge 1 commit into
base: cpp17
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix build error on header missing and new version of boost
hehouhua committed Aug 15, 2024
commit 22a80ad7eb1751c4dc3ecc80254b2ee5f8d462af
9 changes: 7 additions & 2 deletions examples/ace/ttcp/ttcp_asio_async.cc
Original file line number Diff line number Diff line change
@@ -24,9 +24,12 @@ class TtcpServerConnection : public std::enable_shared_from_this<TtcpServerConne
#if BOOST_VERSION < 107000L
TtcpServerConnection(boost::asio::io_service& io_service)
: socket_(io_service), count_(0), payload_(NULL), ack_(0)
#else
#elif BOOST_VERSION < 107400L
TtcpServerConnection(const boost::asio::executor& executor)
: socket_(executor), count_(0), payload_(NULL), ack_(0)
#else
TtcpServerConnection(boost::asio::io_context& io_context)
: socket_(io_context), count_(0), payload_(NULL), ack_(0)
#endif
{
sessionMessage_.number = 0;
@@ -151,8 +154,10 @@ void doAccept(tcp::acceptor& acceptor)
#if BOOST_VERSION < 107000L
// no need to pre-create new_connection if we use asio 1.12 or boost 1.66+
TtcpServerConnectionPtr new_connection(new TtcpServerConnection(acceptor.get_io_service()));
#else
#elif BOOST_VERSION < 107400L
TtcpServerConnectionPtr new_connection(new TtcpServerConnection(acceptor.get_executor()));
#else
TtcpServerConnectionPtr new_connection(new TtcpServerConnection(static_cast<boost::asio::io_context&>(acceptor.get_executor().context())));
#endif
acceptor.async_accept(
new_connection->socket(),
2 changes: 1 addition & 1 deletion muduo/net/InetAddress.cc
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@

// Author: Shuo Chen (chenshuo at chenshuo dot com)

#include <cstddef>
#include <muduo/net/InetAddress.h>

#include <muduo/base/Logging.h>
#include <muduo/net/Endian.h>
#include <muduo/net/SocketsOps.h>