Skip to content

Commit

Permalink
Merge branch 'chriskohlhoff:master' into zig-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane authored Dec 7, 2023
2 parents 8009a3f + ed5db1b commit 109889f
Show file tree
Hide file tree
Showing 228 changed files with 16,224 additions and 24,105 deletions.
4 changes: 2 additions & 2 deletions asio/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asio version 1.28.2
Released Thursday, 26 October 2023.
asio version 1.29.0
Released Thursday, 09 November 2023.

See doc/index.html for API documentation and a tutorial.
487 changes: 210 additions & 277 deletions asio/asio.manifest

Large diffs are not rendered by default.

431 changes: 189 additions & 242 deletions asio/boost_asio.manifest

Large diffs are not rendered by default.

71 changes: 31 additions & 40 deletions asio/boostify.pl
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ sub copy_source_file
$line =~ s/changes made in each release/changes made in each Boost release/g;
$line =~ s/\[\$/[\$boost_asio\//g;
$line =~ s/\[@\.\.\/src\/examples/[\@boost_asio\/example/g;
$line =~ s/asio\//boost\/asio\//g if $is_xsl;
$line =~ s/include\/asio/boost\/asio/g;
$line =~ s/\^asio/^boost\/asio/g;
$line =~ s/namespaceasio/namespaceboost_1_1asio/g;
Expand Down Expand Up @@ -294,6 +295,12 @@ sub copy_source_file
$line =~ s/asio::/boost::asio::/g if !$is_xsl;
print_line($output, $line, $from, $lineno);
}
elsif ($line =~ /std::system_error/)
{
$line =~ s/std::system_error/boost::system::system_error/g;
$line =~ s/asio::/boost::asio::/g if !$is_xsl;
print_line($output, $line, $from, $lineno);
}
elsif ($line =~ /ec\.assign\(0, ec\.category\(\)\)/)
{
$line =~ s/ec\.assign\(0, ec\.category\(\)\)/ec = boost::system::error_code()/g;
Expand Down Expand Up @@ -554,69 +561,53 @@ sub copy_properties_tests
sub copy_examples
{
my @dirs = (
"src/examples/cpp03/allocation",
"src/examples/cpp03/buffers",
"src/examples/cpp03/chat",
"src/examples/cpp03/echo",
"src/examples/cpp03/fork",
"src/examples/cpp03/http/client",
"src/examples/cpp03/http/doc_root",
"src/examples/cpp03/http/server",
"src/examples/cpp03/http/server2",
"src/examples/cpp03/http/server3",
"src/examples/cpp03/http/server4",
"src/examples/cpp03/icmp",
"src/examples/cpp03/invocation",
"src/examples/cpp03/iostreams",
"src/examples/cpp03/local",
"src/examples/cpp03/multicast",
"src/examples/cpp03/nonblocking",
"src/examples/cpp03/porthopper",
"src/examples/cpp03/serialization",
"src/examples/cpp03/services",
"src/examples/cpp03/socks4",
"src/examples/cpp03/spawn",
"src/examples/cpp03/ssl",
"src/examples/cpp03/timeouts",
"src/examples/cpp03/timers",
"src/examples/cpp03/tutorial",
"src/examples/cpp03/tutorial/daytime1",
"src/examples/cpp03/tutorial/daytime2",
"src/examples/cpp03/tutorial/daytime3",
"src/examples/cpp03/tutorial/daytime4",
"src/examples/cpp03/tutorial/daytime5",
"src/examples/cpp03/tutorial/daytime6",
"src/examples/cpp03/tutorial/daytime7",
"src/examples/cpp03/tutorial/timer1",
"src/examples/cpp03/tutorial/timer2",
"src/examples/cpp03/tutorial/timer3",
"src/examples/cpp03/tutorial/timer4",
"src/examples/cpp03/tutorial/timer5",
"src/examples/cpp03/windows",
"src/examples/cpp11/allocation",
"src/examples/cpp11/buffers",
"src/examples/cpp11/chat",
"src/examples/cpp11/deferred",
"src/examples/cpp11/echo",
"src/examples/cpp11/executors",
"src/examples/cpp11/fork",
"src/examples/cpp11/files",
"src/examples/cpp11/fork",
"src/examples/cpp11/futures",
"src/examples/cpp11/handler_tracking",
"src/examples/cpp11/http/client",
"src/examples/cpp11/http/doc_root",
"src/examples/cpp11/http/server",
"src/examples/cpp11/http/server2",
"src/examples/cpp11/http/server3",
"src/examples/cpp11/http/server4",
"src/examples/cpp11/icmp",
"src/examples/cpp11/invocation",
"src/examples/cpp11/iostreams",
"src/examples/cpp11/local",
"src/examples/cpp11/multicast",
"src/examples/cpp11/nonblocking",
"src/examples/cpp11/operations",
"src/examples/cpp11/parallel_group",
"src/examples/cpp11/porthopper",
"src/examples/cpp11/serialization",
"src/examples/cpp11/services",
"src/examples/cpp11/socks4",
"src/examples/cpp11/spawn",
"src/examples/cpp11/ssl",
"src/examples/cpp11/timeouts",
"src/examples/cpp11/timers",
"src/examples/cpp11/tutorial",
"src/examples/cpp11/tutorial/daytime1",
"src/examples/cpp11/tutorial/daytime2",
"src/examples/cpp11/tutorial/daytime3",
"src/examples/cpp11/tutorial/daytime4",
"src/examples/cpp11/tutorial/daytime5",
"src/examples/cpp11/tutorial/daytime6",
"src/examples/cpp11/tutorial/daytime7",
"src/examples/cpp11/tutorial/timer1",
"src/examples/cpp11/tutorial/timer2",
"src/examples/cpp11/tutorial/timer3",
"src/examples/cpp11/tutorial/timer4",
"src/examples/cpp11/tutorial/timer5",
"src/examples/cpp11/type_erasure",
"src/examples/cpp11/windows",
"src/examples/cpp14/deferred",
"src/examples/cpp14/echo",
"src/examples/cpp14/executors",
Expand Down
3 changes: 1 addition & 2 deletions asio/configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(asio, [1.28.2])
AC_INIT(asio, [1.29.0])
AC_CONFIG_SRCDIR(include/asio.hpp)
AM_MAINTAINER_MODE
AM_INIT_AUTOMAKE([tar-pax])
Expand Down Expand Up @@ -252,7 +252,6 @@ AC_OUTPUT([
src/Makefile
src/tests/Makefile
src/tests/properties/Makefile
src/examples/cpp03/Makefile
src/examples/cpp11/Makefile
src/examples/cpp14/Makefile
src/examples/cpp17/Makefile
Expand Down
26 changes: 18 additions & 8 deletions asio/include/asio/any_completion_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,15 @@ class any_completion_handler_allocator
/// Allocate space for @c n objects of the allocator's value type.
T* allocate(std::size_t n) const
{
return static_cast<T*>(
fn_table_->allocate(
impl_, sizeof(T) * n, alignof(T)));
if (fn_table_)
{
return static_cast<T*>(
fn_table_->allocate(
impl_, sizeof(T) * n, alignof(T)));
}
std::bad_alloc ex;
asio::detail::throw_exception(ex);
return nullptr;
}

/// Deallocate space for @c n objects of the allocator's value type.
Expand Down Expand Up @@ -724,7 +730,7 @@ class any_completion_handler
/// Get the associated cancellation slot.
cancellation_slot_type get_cancellation_slot() const noexcept
{
return impl_->get_cancellation_slot();
return impl_ ? impl_->get_cancellation_slot() : cancellation_slot_type();
}

/// Function call operator.
Expand Down Expand Up @@ -786,8 +792,10 @@ struct associated_executor<any_completion_handler<Signatures...>, Candidate>
static type get(const any_completion_handler<Signatures...>& handler,
const Candidate& candidate = Candidate()) noexcept
{
return handler.fn_table_->executor(handler.impl_,
any_completion_executor(std::nothrow, candidate));
any_completion_executor any_candidate(std::nothrow, candidate);
return handler.fn_table_
? handler.fn_table_->executor(handler.impl_, any_candidate)
: any_candidate;
}
};

Expand All @@ -800,8 +808,10 @@ struct associated_immediate_executor<
static type get(const any_completion_handler<Signatures...>& handler,
const Candidate& candidate = Candidate()) noexcept
{
return handler.fn_table_->immediate_executor(handler.impl_,
any_io_executor(std::nothrow, candidate));
any_io_executor any_candidate(std::nothrow, candidate);
return handler.fn_table_
? handler.fn_table_->immediate_executor(handler.impl_, any_candidate)
: any_candidate;
}
};

Expand Down
20 changes: 20 additions & 0 deletions asio/include/asio/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#if !defined(ASIO_NO_TS_EXECUTORS)

#include <new>
#include <typeinfo>
#include "asio/detail/cstddef.hpp"
#include "asio/detail/executor_function.hpp"
Expand Down Expand Up @@ -76,6 +77,25 @@ class executor
template <typename Executor>
executor(Executor e);

/// Construct a polymorphic executor that points to the same target as
/// another polymorphic executor.
executor(std::nothrow_t, const executor& other) noexcept
: impl_(other.clone())
{
}

/// Construct a polymorphic executor that moves the target from another
/// polymorphic executor.
executor(std::nothrow_t, executor&& other) noexcept
: impl_(other.impl_)
{
other.impl_ = 0;
}

/// Construct a polymorphic wrapper for the specified executor.
template <typename Executor>
executor(std::nothrow_t, Executor e) noexcept;

/// Allocator-aware constructor to create a polymorphic wrapper for the
/// specified executor.
template <typename Executor, typename Allocator>
Expand Down
17 changes: 17 additions & 0 deletions asio/include/asio/impl/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#if !defined(ASIO_NO_TS_EXECUTORS)

#include <new>
#include "asio/detail/atomic_count.hpp"
#include "asio/detail/global.hpp"
#include "asio/detail/memory.hpp"
Expand Down Expand Up @@ -47,6 +48,11 @@ class executor::impl
return p;
}

static impl_base* create(std::nothrow_t, const Executor& e) noexcept
{
return new (std::nothrow) impl(e, std::allocator<void>());
}

impl(const Executor& e, const Allocator& a) noexcept
: impl_base(false),
ref_count_(1),
Expand Down Expand Up @@ -167,6 +173,11 @@ class executor::impl<system_executor, Allocator>
return &detail::global<impl<system_executor, std::allocator<void>> >();
}

static impl_base* create(std::nothrow_t, const system_executor&) noexcept
{
return &detail::global<impl<system_executor, std::allocator<void>> >();
}

impl()
: impl_base(true)
{
Expand Down Expand Up @@ -244,6 +255,12 @@ executor::executor(Executor e)
{
}

template <typename Executor>
executor::executor(std::nothrow_t, Executor e) noexcept
: impl_(impl<Executor, std::allocator<void>>::create(std::nothrow, e))
{
}

template <typename Executor, typename Allocator>
executor::executor(allocator_arg_t, const Allocator& a, Executor e)
: impl_(impl<Executor, Allocator>::create(e, a))
Expand Down
6 changes: 5 additions & 1 deletion asio/include/asio/ssl/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "asio/detail/config.hpp"

#include "asio/async_result.hpp"
#include "asio/buffer.hpp"
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
Expand Down Expand Up @@ -559,7 +560,10 @@ class stream :
= default_completion_token_t<executor_type>>
auto async_handshake(handshake_type type, const ConstBufferSequence& buffers,
BufferedHandshakeToken&& token
= default_completion_token_t<executor_type>())
= default_completion_token_t<executor_type>(),
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
> = 0)
-> decltype(
async_initiate<BufferedHandshakeToken,
void (asio::error_code, std::size_t)>(
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
// ASIO_VERSION % 100 is the sub-minor version
// ASIO_VERSION / 100 % 1000 is the minor version
// ASIO_VERSION / 100000 is the major version
#define ASIO_VERSION 102802 // 1.28.2
#define ASIO_VERSION 102900 // 1.29.0

#endif // ASIO_VERSION_HPP
22 changes: 0 additions & 22 deletions asio/release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -201,27 +201,6 @@ sub build_asio_doc
system("cp -vR src/doc/html/* doc");
}

sub build_example_diffs
{
my @cpp11_files = `find src/examples/cpp11 -type f -name "*.*pp"`;
foreach my $cpp11_file (@cpp11_files)
{
chomp($cpp11_file);

my $cpp03_file = $cpp11_file;
$cpp03_file =~ s/\/cpp11\//\/cpp03\//;
my $output_diff = $cpp11_file;
$output_diff =~ s/src\/examples\/cpp11\///g;
my ($output_diff_name, $output_dir) = fileparse($output_diff);
my $output_html = $output_diff . ".html";

mkpath("doc/examples/diffs/$output_dir");
system("diff -U1000000 $cpp03_file $cpp11_file > doc/examples/diffs/$output_diff");
system("cd doc/examples/diffs && diff2html.py -i $output_diff -o $output_html");
unlink("doc/examples/diffs/$output_diff");
}
}

sub make_asio_packages
{
our $asio_name;
Expand Down Expand Up @@ -428,7 +407,6 @@ sub make_boost_asio_packages
if ($package_asio)
{
build_asio_doc();
build_example_diffs();
make_asio_packages();
}

Expand Down
6 changes: 0 additions & 6 deletions asio/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if !STANDALONE
EXAMPLES_CPP03 = examples/cpp03
endif

if HAVE_CXX11
EXAMPLES_CPP11 = examples/cpp11
endif
Expand All @@ -19,15 +15,13 @@ EXAMPLES_CPP20 = examples/cpp20
endif

SUBDIRS = \
$(EXAMPLES_CPP03) \
$(EXAMPLES_CPP11) \
$(EXAMPLES_CPP14) \
$(EXAMPLES_CPP17) \
$(EXAMPLES_CPP20) \
tests

DIST_SUBDIRS = \
examples/cpp03 \
examples/cpp11 \
examples/cpp14 \
examples/cpp17 \
Expand Down
Loading

0 comments on commit 109889f

Please sign in to comment.