Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ endfunction()

if (BOOST_COROSIO_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp"
"#include <boost/corosio.hpp>\n")
"#include <boost/corosio.hpp>\n"
"#include <boost/corosio/native/native.hpp>\n")
add_library(boost_corosio_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
boost_corosio_setup_properties(boost_corosio_mrdocs)
target_compile_definitions(boost_corosio_mrdocs PUBLIC BOOST_COROSIO_MRDOCS)
Expand Down
1 change: 1 addition & 0 deletions doc/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
* xref:benchmark-report.adoc[Benchmarks]
* xref:glossary.adoc[Glossary]
* xref:quick-start.adoc[Quick Start]
* xref:reference:boost/corosio.adoc[Reference]
21 changes: 21 additions & 0 deletions include/boost/corosio/native/native.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright (c) 2026 Steve Gerbino
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/cppalliance/corosio
//

#ifndef BOOST_COROSIO_NATIVE_NATIVE_HPP
#define BOOST_COROSIO_NATIVE_NATIVE_HPP

#include <boost/corosio/native/native_io_context.hpp>
#include <boost/corosio/native/native_resolver.hpp>
#include <boost/corosio/native/native_scheduler.hpp>
#include <boost/corosio/native/native_signal_set.hpp>
#include <boost/corosio/native/native_tcp_acceptor.hpp>
#include <boost/corosio/native/native_tcp_socket.hpp>
#include <boost/corosio/native/native_timer.hpp>
Comment on lines +13 to +19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check native_*.hpp files for direct platform-specific system header includes

echo "=== Checking for platform-specific includes in native_*.hpp ==="
rg -n '#\s*include\s*[<"](windows\.h|WinSock2\.h|Ws2tcpip\.h|MSWSock\.h|sys/socket\.h|netinet/in\.h|arpa/inet\.h|unistd\.h|sys/types\.h)[">]' \
    include/boost/corosio/native/ || echo "No platform-specific includes found"

echo ""
echo "=== List all files in include/boost/corosio/native/ ==="
find include/boost/corosio/native/ -type f \( -name "*.h" -o -name "*.hpp" \) | sort

Repository: cppalliance/corosio

Length of output: 6612


🏁 Script executed:

#!/bin/bash
# Inspect the native_*.hpp files to see what they include

echo "=== Checking native_io_context.hpp ==="
head -50 include/boost/corosio/native/native_io_context.hpp | grep -n "#include"

echo ""
echo "=== Checking native_tcp_socket.hpp ==="
head -50 include/boost/corosio/native/native_tcp_socket.hpp | grep -n "#include"

echo ""
echo "=== Checking native_resolver.hpp ==="
head -50 include/boost/corosio/native/native_resolver.hpp | grep -n "#include"

echo ""
echo "=== Checking native_scheduler.hpp ==="
head -50 include/boost/corosio/native/native_scheduler.hpp | grep -n "#include"

echo ""
echo "=== Checking if native.hpp includes aggregate includes any platform-specific headers directly ==="
head -30 include/boost/corosio/native/native.hpp

Repository: cppalliance/corosio

Length of output: 2054


Remove direct includes of native detail headers from the public native.hpp aggregator header.

The file include/boost/corosio/native/native.hpp violates the portable-headers guideline by including files such as native_io_context.hpp, which in turn directly include platform-specific detail headers (e.g., detail/epoll/epoll_scheduler.hpp, detail/iocp/win_scheduler.hpp). These detail headers contain platform-specific includes like <sys/socket.h>, <WinSock2.h>, <netinet/in.h>, and <unistd.h>. Since include/boost/corosio/native/ is a public header directory, all included headers—including detail subdirectories—must not expose platform-specific system headers. Either abstract the platform-specific details behind portable interfaces, or move platform-specific aggregators outside the public header tree.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@include/boost/corosio/native/native.hpp` around lines 13 - 19, The public
aggregator native.hpp currently includes detail-bearing headers
(native_io_context.hpp, native_resolver.hpp, native_scheduler.hpp,
native_signal_set.hpp, native_tcp_acceptor.hpp, native_tcp_socket.hpp,
native_timer.hpp) which pull platform-specific system headers; remove these
direct includes from include/boost/corosio/native/native.hpp and instead expose
only portable, platform-agnostic interfaces or facades from the public header
(e.g., a minimal native API header) while moving platform-specific aggregators
and includes into a non-public/detail or src/ implementation header; update
native.hpp to include only the portable facade or forward-declarations so no
detail/<platform> headers (and thus no <sys/socket.h>, <WinSock2.h>, etc.) are
transitively exposed.


#endif
Loading