Build against current Boost releases - #148
Open
MagnaibayarMN wants to merge 1 commit into
Open
Conversation
Boost 1.66 reorganized Asio and Boost 1.87 removed what it had deprecated, so QuickFAST has not compiled against a current Boost for some years. These are the changes needed to build with Boost 1.66 through at least 1.91, with every replacement selected on BOOST_VERSION so that older Boost releases build exactly as they did before. The library: * AsioService_fwd.h forward declared boost::asio::io_service as a class. From Boost 1.66 on it is a typedef for io_context, so that declaration conflicts with Asio's own and every use of the type fails. The name is now taken from Asio itself; Boost 1.87 and later, which dropped the name entirely, get a typedef for io_context. * The Asio I/O objects replaced their io_service& constructors with a template that asks its argument for an executor, so the implicit cast on AsioService is no longer enough to construct a socket or a resolver from one. AsioService now forwards get_executor() to the io_service it wraps. * A new header, Communication/AsioCompatibility.h, spells the four remaining interfaces the way the Boost release being compiled against expects: ip::address::from_string is now make_address, io_service::post is now the free function post, io_service::reset is now restart, and io_service::work is now executor_work_guard. The call sites ask it rather than repeating a version test each time. * The iterator-returning resolver::resolve(query) in TCPReceiver became resolve(host, service) returning a results range. The examples: * boost::asio::strand became a template, so the two burst senders name the class they want, io_service::strand, and reach it through dispatch and bind_executor rather than the strand's own wrap and dispatch. * Asio's date_time based timers are opt-in in recent releases, so those two examples use steady_timer and a chrono duration instead of deadline_timer and a posix_time duration. * basic_socket became a private base of the socket stream buffer, so FileToTCP moves an accepted socket into its stream instead of accepting into the stream's buffer. * Compare the FILE* returned by std::fopen against 0 rather than ordering it against 0, which gcc rejects. Verified on Ubuntu 24.04 (gcc 13, Boost 1.83), Ubuntu 25.10 (gcc 15, Boost 1.88) and against Boost 1.91 built by vcpkg: the library, all six example programs and all 112 unit test cases build and pass in each. No MPC file, setup script or build flag is changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017BnyHwonMsq7k6uQxWpVGF
This was referenced Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QuickFAST does not compile against any Boost released since 1.66. This fixes that, with every replacement selected on
BOOST_VERSIONso older Boost releases build exactly as they did before.The root cause
Communication/AsioService_fwd.hforward declaresboost::asio::io_serviceas a class. Since Boost 1.66 that name is a typedef forio_context, so the declaration conflicts with Asio's own and every use of the type fails. Once that is fixed the rest is a short list:io_service&AsioServicenow forwardsget_executor()ip::address::from_string→make_addressMulticastReceiver,MulticastSender,PCapToMulticastio_service::post→ free functionpostAsioServiceio_service::reset→restartAsioServiceio_service::work→executor_work_guardAsynchSenderresolver::resolve(query)→resolve(host, service)TCPReceiverasio::strandbecame a templateFileToMulticast,PCapToMulticaststeady_timerbasic_socketis a private base of the socket stream bufferFileToTCPThe repeated version tests live in one new header,
Communication/AsioCompatibility.h, rather than at each call site.Also included:
InterpretApplicationcompared theFILE*fromstd::fopenwith<= 0, which gcc rejects.Verification
Built and tested against three Boost releases:
No
.mpc,.mpb,.mwc,.featuresor setup script is touched.🤖 Generated with Claude Code
https://claude.ai/code/session_017BnyHwonMsq7k6uQxWpVGF