Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.hpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // ssl/error.hpp
  3. // ~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_SSL_ERROR_HPP
  11. #define ASIO_SSL_ERROR_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/error_code.hpp"
  17. #include "asio/detail/push_options.hpp"
  18. namespace asio {
  19. namespace error {
  20. enum ssl_errors
  21. {
  22. // Error numbers are those produced by openssl.
  23. };
  24. extern ASIO_DECL
  25. const asio::error_category& get_ssl_category();
  26. static const asio::error_category& ssl_category
  27. = asio::error::get_ssl_category();
  28. } // namespace error
  29. namespace ssl {
  30. namespace error {
  31. enum stream_errors
  32. {
  33. /// The underlying stream closed before the ssl stream gracefully shut down.
  34. stream_truncated = 1
  35. };
  36. extern ASIO_DECL
  37. const asio::error_category& get_stream_category();
  38. static const asio::error_category& stream_category
  39. = asio::ssl::error::get_stream_category();
  40. } // namespace error
  41. } // namespace ssl
  42. } // namespace asio
  43. #if defined(ASIO_HAS_STD_SYSTEM_ERROR)
  44. namespace std {
  45. template<> struct is_error_code_enum<asio::error::ssl_errors>
  46. {
  47. static const bool value = true;
  48. };
  49. template<> struct is_error_code_enum<asio::ssl::error::stream_errors>
  50. {
  51. static const bool value = true;
  52. };
  53. } // namespace std
  54. #endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
  55. namespace asio {
  56. namespace error {
  57. inline asio::error_code make_error_code(ssl_errors e)
  58. {
  59. return asio::error_code(
  60. static_cast<int>(e), get_ssl_category());
  61. }
  62. } // namespace error
  63. namespace ssl {
  64. namespace error {
  65. inline asio::error_code make_error_code(stream_errors e)
  66. {
  67. return asio::error_code(
  68. static_cast<int>(e), get_stream_category());
  69. }
  70. } // namespace error
  71. } // namespace ssl
  72. } // namespace asio
  73. #include "asio/detail/pop_options.hpp"
  74. #if defined(ASIO_HEADER_ONLY)
  75. # include "asio/ssl/impl/error.ipp"
  76. #endif // defined(ASIO_HEADER_ONLY)
  77. #endif // ASIO_SSL_ERROR_HPP