mirror of
https://github.com/boostorg/redis.git
synced 2026-01-19 04:42:09 +00:00
Build fix.
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -160,7 +160,9 @@ jobs:
|
||||
cmake -T "${{matrix.toolset}}" \
|
||||
-G "${{matrix.generator}}" \
|
||||
${{matrix.config_args}} \
|
||||
${BOOST_COMPILER_ARG} \
|
||||
${BOOST_COMPILER_ARG}\
|
||||
-D_WIN32_WINNT=0x0601\
|
||||
-DCMAKE_CXX_FLAGS="/bigobj"\
|
||||
"${GITHUB_WORKSPACE}"
|
||||
env:
|
||||
BOOST_ROOT: ${{env.BOOST_INSTALL_PATH}}/boost
|
||||
@@ -168,10 +170,7 @@ jobs:
|
||||
- name: Build
|
||||
working-directory: build
|
||||
run: |
|
||||
cmake --build . \
|
||||
-j \
|
||||
${BUILD_CONFIG_ARG} \
|
||||
${{matrix.build_args}}
|
||||
cmake --build . ${BUILD_CONFIG_ARG} ${{matrix.build_args}}
|
||||
|
||||
- name: Run tests
|
||||
working-directory: build
|
||||
|
||||
@@ -22,21 +22,26 @@ target_include_directories(aedis INTERFACE
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
target_link_libraries(aedis
|
||||
target_link_libraries(
|
||||
aedis
|
||||
INTERFACE
|
||||
Boost::asio
|
||||
Boost::assert
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::mp11
|
||||
Boost::optional
|
||||
Boost::system
|
||||
Boost::utility
|
||||
Boost::winapi
|
||||
)
|
||||
|
||||
target_compile_features(aedis INTERFACE cxx_std_17)
|
||||
|
||||
# Asio bases C++ feature detection on __cplusplus. Make MSVC
|
||||
# define it correctly
|
||||
if (MSVC)
|
||||
target_compile_options(aedis INTERFACE /Zc:__cplusplus)
|
||||
endif()
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${PROJECT_BINARY_DIR}/AedisConfigVersion.cmake"
|
||||
|
||||
@@ -14,8 +14,7 @@ using net::ip::tcp;
|
||||
using tcp_socket = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::socket>;
|
||||
using timer_type = net::use_awaitable_t<>::as_default_on_t<net::steady_timer>;
|
||||
|
||||
net::awaitable<void>
|
||||
example(boost::asio::ip::tcp::endpoint ep, std::string msg, int n)
|
||||
auto example(boost::asio::ip::tcp::endpoint ep, std::string msg, int n) -> net::awaitable<void>
|
||||
{
|
||||
try {
|
||||
auto ex = co_await net::this_coro::executor;
|
||||
|
||||
@@ -54,7 +54,8 @@ auto from_bulk(
|
||||
boost::string_view sv,
|
||||
boost::system::error_code& ec) -> typename std::enable_if<std::is_integral<T>::value, void>::type
|
||||
{
|
||||
i = resp3::detail::parse_uint(sv.data(), sv.size(), ec);
|
||||
auto const v = resp3::detail::parse_uint(sv.data(), sv.size(), ec);
|
||||
i = static_cast<T>(v);
|
||||
}
|
||||
|
||||
inline
|
||||
|
||||
@@ -45,7 +45,7 @@ struct receive_op {
|
||||
reenter (coro)
|
||||
{
|
||||
yield conn->push_channel_.async_receive(std::move(self));
|
||||
AEDIS_CHECK_OP1();
|
||||
AEDIS_CHECK_OP1(;);
|
||||
|
||||
yield
|
||||
resp3::async_read(
|
||||
@@ -56,12 +56,12 @@ struct receive_op {
|
||||
// cancel(receive) is needed to cancel the channel, otherwise
|
||||
// the read operation will be blocked forever see
|
||||
// test_push_adapter.
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run); conn->cancel(operation::receive));
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run); conn->cancel(operation::receive););
|
||||
|
||||
read_size = n;
|
||||
|
||||
yield conn->push_channel_.async_send({}, 0, std::move(self));
|
||||
AEDIS_CHECK_OP1();
|
||||
AEDIS_CHECK_OP1(;);
|
||||
|
||||
self.complete({}, read_size);
|
||||
return;
|
||||
@@ -101,7 +101,7 @@ struct exec_read_op {
|
||||
conn->next_layer(),
|
||||
conn->make_dynamic_buffer(),
|
||||
"\r\n", std::move(self));
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run));
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run););
|
||||
}
|
||||
|
||||
// If the next request is a push we have to handle it to
|
||||
@@ -109,7 +109,7 @@ struct exec_read_op {
|
||||
if (resp3::to_type(conn->read_buffer_.front()) == resp3::type::push) {
|
||||
yield
|
||||
async_send_receive(conn->push_channel_, std::move(self));
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run));
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run););
|
||||
continue;
|
||||
}
|
||||
//-----------------------------------
|
||||
@@ -123,7 +123,7 @@ struct exec_read_op {
|
||||
|
||||
++index;
|
||||
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run));
|
||||
AEDIS_CHECK_OP1(conn->cancel(operation::run););
|
||||
|
||||
read_size += n;
|
||||
|
||||
@@ -285,7 +285,7 @@ struct writer_op {
|
||||
conn->coalesce_requests();
|
||||
yield
|
||||
boost::asio::async_write(conn->next_layer(), boost::asio::buffer(conn->write_buffer_), std::move(self));
|
||||
AEDIS_CHECK_OP0(conn->cancel(operation::run));
|
||||
AEDIS_CHECK_OP0(conn->cancel(operation::run););
|
||||
|
||||
conn->on_write();
|
||||
|
||||
@@ -335,7 +335,7 @@ struct reader_op {
|
||||
return self.complete({}); // EOFINAE: EOF is not an error.
|
||||
}
|
||||
|
||||
AEDIS_CHECK_OP0(conn->cancel(operation::run));
|
||||
AEDIS_CHECK_OP0(conn->cancel(operation::run););
|
||||
|
||||
// We handle unsolicited events in the following way
|
||||
//
|
||||
|
||||
@@ -28,14 +28,14 @@ auto is_cancelled(T const& self)
|
||||
|
||||
#define AEDIS_CHECK_OP0(X)\
|
||||
if (ec || aedis::detail::is_cancelled(self)) {\
|
||||
X;\
|
||||
X\
|
||||
self.complete(!!ec ? ec : boost::asio::error::operation_aborted);\
|
||||
return;\
|
||||
}
|
||||
|
||||
#define AEDIS_CHECK_OP1(X)\
|
||||
if (ec || aedis::detail::is_cancelled(self)) {\
|
||||
X;\
|
||||
X\
|
||||
self.complete(!!ec ? ec : boost::asio::error::operation_aborted, {});\
|
||||
return;\
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
if (parser_.bulk() == type::invalid) {
|
||||
yield
|
||||
boost::asio::async_read_until(stream_, buf_, "\r\n", std::move(self));
|
||||
AEDIS_CHECK_OP1();
|
||||
AEDIS_CHECK_OP1(;);
|
||||
} else {
|
||||
// On a bulk read we can't read until delimiter since the
|
||||
// payload may contain the delimiter itself so we have to
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
buf_.data(buffer_size_, parser_.bulk_length() + 2 - buffer_size_),
|
||||
boost::asio::transfer_all(),
|
||||
std::move(self));
|
||||
AEDIS_CHECK_OP1();
|
||||
AEDIS_CHECK_OP1(;);
|
||||
}
|
||||
|
||||
n = parser_.bulk_length() + 2;
|
||||
|
||||
Reference in New Issue
Block a user