100.00% Lines (6/6)
100.00% Functions (1/1)
| TLA | Baseline | Branch | ||||||
|---|---|---|---|---|---|---|---|---|
| Line | Hits | Code | Line | Hits | Code | |||
| 1 | + | // | ||||||
| 2 | + | // Copyright (c) 2026 Steve Gerbino | ||||||
| 3 | + | // | ||||||
| 4 | + | // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||||||
| 5 | + | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||||||
| 6 | + | // | ||||||
| 7 | + | // Official repository: https://github.com/cppalliance/corosio | ||||||
| 8 | + | // | ||||||
| 9 | + | |||||||
| 10 | + | #ifndef BOOST_COROSIO_NATIVE_DETAIL_MSG_FLAGS_HPP | ||||||
| 11 | + | #define BOOST_COROSIO_NATIVE_DETAIL_MSG_FLAGS_HPP | ||||||
| 12 | + | |||||||
| 13 | + | #include <boost/corosio/detail/platform.hpp> | ||||||
| 14 | + | |||||||
| 15 | + | #if BOOST_COROSIO_POSIX | ||||||
| 16 | + | #include <sys/socket.h> | ||||||
| 17 | + | #else | ||||||
| 18 | + | #ifndef WIN32_LEAN_AND_MEAN | ||||||
| 19 | + | #define WIN32_LEAN_AND_MEAN | ||||||
| 20 | + | #endif | ||||||
| 21 | + | #ifndef NOMINMAX | ||||||
| 22 | + | #define NOMINMAX | ||||||
| 23 | + | #endif | ||||||
| 24 | + | #include <WinSock2.h> | ||||||
| 25 | + | #endif | ||||||
| 26 | + | |||||||
| 27 | + | namespace boost::corosio::detail { | ||||||
| 28 | + | |||||||
| 29 | + | /// Map portable message_flags int values to native MSG_* constants. | ||||||
| 30 | + | inline int | ||||||
| HITGNC | 31 | + | 150 | to_native_msg_flags(int flags) noexcept | ||||
| 32 | + | { | ||||||
| HITGNC | 33 | + | 150 | int native = 0; | ||||
| HITGNC | 34 | + | 150 | if (flags & 1) native |= MSG_PEEK; | ||||
| HITGNC | 35 | + | 150 | if (flags & 2) native |= MSG_OOB; | ||||
| HITGNC | 36 | + | 150 | if (flags & 4) native |= MSG_DONTROUTE; | ||||
| HITGNC | 37 | + | 150 | return native; | ||||
| 38 | + | } | ||||||
| 39 | + | |||||||
| 40 | + | } // namespace boost::corosio::detail | ||||||
| 41 | + | |||||||
| 42 | + | #endif | ||||||