equal
deleted
inserted
replaced
|
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_CYGWIN_ERROR_HPP |
|
11 #define BOOST_CYGWIN_ERROR_HPP |
|
12 |
|
13 // This header is effectively empty for compiles on operating systems where |
|
14 // it is not applicable. |
|
15 |
|
16 # ifdef __CYGWIN__ |
|
17 |
|
18 #include <boost/system/error_code.hpp> |
|
19 |
|
20 namespace boost |
|
21 { |
|
22 namespace system |
|
23 { |
|
24 // To construct an error_code after a API error: |
|
25 // |
|
26 // error_code( errno, system_category ) |
|
27 |
|
28 // User code should use the portable "posix" enums for POSIX errors; this |
|
29 // allows such code to be portable to non-POSIX systems. For the non-POSIX |
|
30 // errno values that POSIX-based systems typically provide in addition to |
|
31 // POSIX values, use the system specific enums below. |
|
32 |
|
33 namespace cygwin_error |
|
34 { |
|
35 enum cygwin_errno |
|
36 { |
|
37 no_net = ENONET, |
|
38 no_package = ENOPKG, |
|
39 no_share = ENOSHARE |
|
40 }; |
|
41 } // namespace cygwin_error |
|
42 |
|
43 template<> struct is_error_code_enum<cygwin_error::cygwin_errno> |
|
44 { static const bool value = true; }; |
|
45 |
|
46 namespace cygwin_error |
|
47 { |
|
48 inline error_code make_error_code( cygwin_errno e ) |
|
49 { return error_code( e, get_system_category() ); } |
|
50 } |
|
51 } |
|
52 } |
|
53 |
|
54 #endif // __CYGWIN__ |
|
55 |
|
56 #endif // BOOST_CYGWIN_ERROR_HPP |