Skip to content

Commit b243d1c

Browse files
committed
Fix macros and remove the unintended exposed interface
1 parent 993d8a5 commit b243d1c

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

zmq_async.hpp

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "zmq_addon.hpp"
3+
#include <zmq_addon.hpp>
44
#include <boost/asio/any_io_executor.hpp>
55
#include <boost/system/detail/error_code.hpp>
66
#include <stdexcept>
@@ -11,17 +11,15 @@
1111
#if !defined(ZMQ_CPP20) && defined(CPPZMQ_ENABLE_CORRAL_COROUTINE)
1212
#error "Coroutine support enabled with a C++ standard lower than C++20"
1313
#endif
14-
#if defined(CPPZMQ_ENABLE_CORRAL_COROUTINE)
14+
#if defined(ZMQ_CPP20) && defined(CPPZMQ_ENABLE_CORRAL_COROUTINE)
15+
// As coroutine support is only avaiable for C++20 and upward,
16+
// there is no point in using the ZMQ_XXX macros for compatibility.
17+
// Everything that's available in C++20 can be used here (e.g. inline, noexcept).
18+
1519
#include <corral/Task.h>
1620
#include <boost/asio/posix/stream_descriptor.hpp>
1721
#include <boost/asio/windows/stream_handle.hpp>
18-
#endif
1922

20-
21-
#ifdef ZMQ_CPP20
22-
// As coroutine support is only avaiable for C++20 and upward,
23-
// there is no point in using the ZMQ_XXX macros for compatibility.
24-
// Everything that's available in C++20 can be used here (e.g. inline, noexcept).
2523
namespace zmq
2624
{
2725

@@ -92,10 +90,6 @@ struct [[nodiscard]] async_send_awaitable_t
9290
{
9391
}
9492

95-
public /* interface */:
96-
inline auto enable_flag(zmq::send_flags flag) { m_flags = m_flags | flag; }
97-
inline auto disable_flag(zmq::send_flags flag) { m_flags = m_flags & (~flag); }
98-
9993
public /* awaitable */:
10094
///
10195
/// \brief An optimization which avoids suspending the coroutine if it isn't necessary.

0 commit comments

Comments
 (0)