Various improvements related to Boost ASIO integration#29
Open
chris-se wants to merge 5 commits into
Open
Conversation
added 5 commits
June 23, 2026 11:36
Boost's build system has an option to use bcp --namespace during
the build. This will create a copy of the boost sources, but replace
all the namespace declarations from 'namespace boost {' to a custom
namespace, and then add an inline alias namespace for 'boost'.
This mostly works (accessing e.g. boost::system), but when
specializing types within the boost namespace, one cannot use the
pattern
namespace boost {
template <>
struct specialized<::myns::mytype> { ... };
}
because 'namespace boost' is just an alias. However, it is possible
to rewrite this in the global namespace as
template <>
struct boost::specialized<myns::mytype> { ... };
and this will work with both the default boost installation and
with a custom namespace version thereof.
Signed-off-by: Christian Seiler <c.seiler@luxflux.de>
Newer boost versions don't automatically include the header defining posix_time when including <boost/asio.hpp>, so include that specific header manually. Signed-off-by: Christian Seiler <c.seiler@luxflux.de>
io_service was deprecated in Boost 1.66.0 in favor of io_context, and was finally removed in Boost 1.87.0. Since the minimum Boost version supported by corral is 1.77.0 anyway, we can unconditionally use io_context instead of io_service. Signed-off-by: Christian Seiler <c.seiler@luxflux.de>
.async_resolve(query{host, service}, callback) was deprecated in
favor of .async_resolve(host, service, callback), and the query
struct was removed in Boost 1.87.0.
Signed-off-by: Christian Seiler <c.seiler@luxflux.de>
If the test is compiled, link it against Boost, otherwise the test source might not find the Boost headers if they are not installed in a system-wide include directory. Signed-off-by: Christian Seiler <c.seiler@luxflux.de>
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.
There were a couple of issues in corral when using it with the newest Boost version:
boost::io_service(replacement:boost::io_context)resolver::query(replacement: direct parameters forasync_resolve)posix_time(not automatic in newer Boost versions)Additionally, in specialized setups where
bcp --namespacewas used during the build of the Boost library, the specialization ofboost::asio::async_resultwould fail to compile. An additional commit reworks the specialization so that it works in all cases.