Skip to content

Commit 6f89148

Browse files
committed
Expose all platform backends in MrDocs documentation build (#171)
1 parent eedd997 commit 6f89148

File tree

7 files changed

+29
-2
lines changed

7 files changed

+29
-2
lines changed

include/boost/corosio/detail/platform.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@
1313
// Platform feature detection
1414
// Each macro is always defined to either 0 or 1
1515

16+
#ifdef BOOST_COROSIO_MRDOCS
17+
18+
// MrDocs documentation build: enable all backends so every
19+
// platform-specific tag and specialization appears in the
20+
// generated reference. The native_* headers skip the real
21+
// implementation includes under this guard, so no platform
22+
// system headers are required.
23+
#define BOOST_COROSIO_HAS_IOCP 1
24+
#define BOOST_COROSIO_HAS_EPOLL 1
25+
#define BOOST_COROSIO_HAS_KQUEUE 1
26+
#define BOOST_COROSIO_HAS_SELECT 1
27+
#define BOOST_COROSIO_POSIX 1
28+
29+
#else // !BOOST_COROSIO_MRDOCS
30+
1631
// IOCP - Windows I/O completion ports
1732
#if defined(_WIN32)
1833
#define BOOST_COROSIO_HAS_IOCP 1
@@ -49,4 +64,6 @@
4964
#define BOOST_COROSIO_POSIX 0
5065
#endif
5166

67+
#endif // BOOST_COROSIO_MRDOCS
68+
5269
#endif // BOOST_COROSIO_DETAIL_PLATFORM_HPP

include/boost/corosio/native/native_io_context.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <boost/corosio/io_context.hpp>
1414
#include <boost/corosio/backend.hpp>
1515

16+
#ifndef BOOST_COROSIO_MRDOCS
1617
#if BOOST_COROSIO_HAS_EPOLL
1718
#include <boost/corosio/native/detail/epoll/epoll_scheduler.hpp>
1819
#endif
@@ -28,6 +29,7 @@
2829
#if BOOST_COROSIO_HAS_IOCP
2930
#include <boost/corosio/native/detail/iocp/win_scheduler.hpp>
3031
#endif
32+
#endif // !BOOST_COROSIO_MRDOCS
3133

3234
namespace boost::corosio {
3335

include/boost/corosio/native/native_resolver.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <boost/corosio/resolver.hpp>
1414
#include <boost/corosio/backend.hpp>
1515

16+
#ifndef BOOST_COROSIO_MRDOCS
1617
#if BOOST_COROSIO_HAS_EPOLL || BOOST_COROSIO_HAS_SELECT || \
1718
BOOST_COROSIO_HAS_KQUEUE
1819
#include <boost/corosio/native/detail/posix/posix_resolver_service.hpp>
@@ -21,6 +22,7 @@
2122
#if BOOST_COROSIO_HAS_IOCP
2223
#include <boost/corosio/native/detail/iocp/win_resolver_service.hpp>
2324
#endif
25+
#endif // !BOOST_COROSIO_MRDOCS
2426

2527
namespace boost::corosio {
2628

include/boost/corosio/native/native_signal_set.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <boost/corosio/signal_set.hpp>
1414
#include <boost/corosio/backend.hpp>
1515

16+
#ifndef BOOST_COROSIO_MRDOCS
1617
#if BOOST_COROSIO_HAS_EPOLL || BOOST_COROSIO_HAS_SELECT || \
1718
BOOST_COROSIO_HAS_KQUEUE
1819
#include <boost/corosio/native/detail/posix/posix_signal_service.hpp>
@@ -21,6 +22,7 @@
2122
#if BOOST_COROSIO_HAS_IOCP
2223
#include <boost/corosio/native/detail/iocp/win_signals.hpp>
2324
#endif
25+
#endif // !BOOST_COROSIO_MRDOCS
2426

2527
namespace boost::corosio {
2628

include/boost/corosio/native/native_tcp_acceptor.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <boost/corosio/tcp_acceptor.hpp>
1414
#include <boost/corosio/backend.hpp>
1515

16+
#ifndef BOOST_COROSIO_MRDOCS
1617
#if BOOST_COROSIO_HAS_EPOLL
1718
#include <boost/corosio/native/detail/epoll/epoll_acceptor_service.hpp>
1819
#endif
@@ -28,6 +29,7 @@
2829
#if BOOST_COROSIO_HAS_IOCP
2930
#include <boost/corosio/native/detail/iocp/win_acceptor_service.hpp>
3031
#endif
32+
#endif // !BOOST_COROSIO_MRDOCS
3133

3234
namespace boost::corosio {
3335

include/boost/corosio/native/native_tcp_socket.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <boost/corosio/tcp_socket.hpp>
1414
#include <boost/corosio/backend.hpp>
1515

16+
#ifndef BOOST_COROSIO_MRDOCS
1617
#if BOOST_COROSIO_HAS_EPOLL
1718
#include <boost/corosio/native/detail/epoll/epoll_socket_service.hpp>
1819
#endif
@@ -28,6 +29,7 @@
2829
#if BOOST_COROSIO_HAS_IOCP
2930
#include <boost/corosio/native/detail/iocp/win_acceptor_service.hpp>
3031
#endif
32+
#endif // !BOOST_COROSIO_MRDOCS
3133

3234
namespace boost::corosio {
3335

include/boost/corosio/tcp_socket.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
namespace boost::corosio {
3737

38-
#if BOOST_COROSIO_HAS_IOCP
38+
#if BOOST_COROSIO_HAS_IOCP && !defined(BOOST_COROSIO_MRDOCS)
3939
using native_handle_type = std::uintptr_t; // SOCKET
4040
#else
4141
using native_handle_type = int;
@@ -271,7 +271,7 @@ class BOOST_COROSIO_DECL tcp_socket : public io_stream
271271
*/
272272
bool is_open() const noexcept
273273
{
274-
#if BOOST_COROSIO_HAS_IOCP
274+
#if BOOST_COROSIO_HAS_IOCP && !defined(BOOST_COROSIO_MRDOCS)
275275
return h_ && get().native_handle() != ~native_handle_type(0);
276276
#else
277277
return h_ && get().native_handle() >= 0;

0 commit comments

Comments
 (0)