LCOV - code coverage report
Current view: top level - corosio/native/detail - msg_flags.hpp (source / functions) Coverage Total Hit Missed
Test: coverage_remapped.info Lines: 77.8 % 9 7 2
Test Date: 2026-09-09 02:31:18 Functions: 100.0 % 1 1

           TLA  Line data    Source 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
      31 HIT         635 : to_native_msg_flags(int flags) noexcept
      32                 : {
      33             635 :     int native = 0;
      34             635 :     if (flags & 1)
      35               5 :         native |= MSG_PEEK;
      36             635 :     if (flags & 2)
      37 MIS           0 :         native |= MSG_OOB;
      38 HIT         635 :     if (flags & 4)
      39 MIS           0 :         native |= MSG_DONTROUTE;
      40 HIT         635 :     return native;
      41                 : }
      42                 : 
      43                 : } // namespace boost::corosio::detail
      44                 : 
      45                 : #endif
        

Generated by: LCOV version 2.3