1 //  boost/system/cygwin_error.hpp  -------------------------------------------//
2 
3 //  Copyright Beman Dawes 2007
4 
5 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
6 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 
8 //  See library home page at http://www.boost.org/libs/system
9 
10 #ifndef BOOST_SYSTEM_CYGWIN_ERROR_HPP
11 #define BOOST_SYSTEM_CYGWIN_ERROR_HPP
12 
13 #include <boost/config/pragma_message.hpp>
14 
15 #if !defined(BOOST_ALLOW_DEPRECATED_HEADERS)
16   BOOST_PRAGMA_MESSAGE("This header is deprecated and is slated for removal."
17   " If you want it retained, please open an issue in github.com/boostorg/system.")
18 #endif
19 
20 //  This header is effectively empty for compiles on operating systems where
21 //  it is not applicable.
22 
23 # ifdef __CYGWIN__
24 
25 #include <boost/system/error_code.hpp>
26 
27 namespace boost
28 {
29   namespace system
30   {
31     //  To construct an error_code after a API error:
32     //
33     //      error_code( errno, system_category() )
34 
35     //  User code should use the portable "posix" enums for POSIX errors; this
36     //  allows such code to be portable to non-POSIX systems. For the non-POSIX
37     //  errno values that POSIX-based systems typically provide in addition to
38     //  POSIX values, use the system specific enums below.
39 
40    namespace cygwin_error
41     {
42       enum cygwin_errno
43       {
44         no_net = ENONET,
45         no_package = ENOPKG,
46         no_share = ENOSHARE
47       };
48     }  // namespace cygwin_error
49 
50     template<> struct is_error_code_enum<cygwin_error::cygwin_errno>
51       { static const bool value = true; };
52 
53     namespace cygwin_error
54     {
make_error_code(cygwin_errno e)55       inline error_code make_error_code( cygwin_errno e )
56         { return error_code( e, system_category() ); }
57     }
58   }
59 }
60 
61 #endif  // __CYGWIN__
62 
63 #endif  // BOOST_SYSTEM_CYGWIN_ERROR_HPP
64