cygwin_error.hpp 1.8 KB

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