cygwin_error.hpp 1.5 KB

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