Chris@16: // boost/system/cygwin_error.hpp -------------------------------------------// Chris@16: Chris@16: // Copyright Beman Dawes 2007 Chris@16: Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See library home page at http://www.boost.org/libs/system Chris@16: Chris@16: #ifndef BOOST_CYGWIN_ERROR_HPP Chris@16: #define BOOST_CYGWIN_ERROR_HPP Chris@16: Chris@16: // This header is effectively empty for compiles on operating systems where Chris@16: // it is not applicable. Chris@16: Chris@16: # ifdef __CYGWIN__ Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: namespace system Chris@16: { Chris@16: // To construct an error_code after a API error: Chris@16: // Chris@16: // error_code( errno, system_category() ) Chris@16: Chris@16: // User code should use the portable "posix" enums for POSIX errors; this Chris@16: // allows such code to be portable to non-POSIX systems. For the non-POSIX Chris@16: // errno values that POSIX-based systems typically provide in addition to Chris@16: // POSIX values, use the system specific enums below. Chris@16: Chris@16: namespace cygwin_error Chris@16: { Chris@16: enum cygwin_errno Chris@16: { Chris@16: no_net = ENONET, Chris@16: no_package = ENOPKG, Chris@16: no_share = ENOSHARE Chris@16: }; Chris@16: } // namespace cygwin_error Chris@16: Chris@16: template<> struct is_error_code_enum Chris@16: { static const bool value = true; }; Chris@16: Chris@16: namespace cygwin_error Chris@16: { Chris@16: inline error_code make_error_code( cygwin_errno e ) Chris@16: { return error_code( e, system_category() ); } Chris@16: } Chris@16: } Chris@16: } Chris@16: Chris@16: #endif // __CYGWIN__ Chris@16: Chris@16: #endif // BOOST_CYGWIN_ERROR_HPP