signal_blocker.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // detail/signal_blocker.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2021 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 BOOST_ASIO_DETAIL_SIGNAL_BLOCKER_HPP
  11. #define BOOST_ASIO_DETAIL_SIGNAL_BLOCKER_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #if !defined(BOOST_ASIO_HAS_THREADS) || defined(BOOST_ASIO_WINDOWS) \
  17. || defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  18. || defined(__CYGWIN__) || defined(__SYMBIAN32__)
  19. # include <boost/asio/detail/null_signal_blocker.hpp>
  20. #elif defined(BOOST_ASIO_HAS_PTHREADS)
  21. # include <boost/asio/detail/posix_signal_blocker.hpp>
  22. #else
  23. # error Only Windows and POSIX are supported!
  24. #endif
  25. namespace boost {
  26. namespace asio {
  27. namespace detail {
  28. #if !defined(BOOST_ASIO_HAS_THREADS) || defined(BOOST_ASIO_WINDOWS) \
  29. || defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  30. || defined(__CYGWIN__) || defined(__SYMBIAN32__)
  31. typedef null_signal_blocker signal_blocker;
  32. #elif defined(BOOST_ASIO_HAS_PTHREADS)
  33. typedef posix_signal_blocker signal_blocker;
  34. #endif
  35. } // namespace detail
  36. } // namespace asio
  37. } // namespace boost
  38. #endif // BOOST_ASIO_DETAIL_SIGNAL_BLOCKER_HPP