signal_blocker.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // detail/signal_blocker.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2011 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_DETAIL_SIGNAL_BLOCKER_HPP
  11. #define 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 "asio/detail/config.hpp"
  16. #if !defined(BOOST_HAS_THREADS) || defined(ASIO_DISABLE_THREADS) \
  17. || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
  18. # include "asio/detail/null_signal_blocker.hpp"
  19. #elif defined(BOOST_HAS_PTHREADS)
  20. # include "asio/detail/posix_signal_blocker.hpp"
  21. #else
  22. # error Only Windows and POSIX are supported!
  23. #endif
  24. namespace asio {
  25. namespace detail {
  26. #if !defined(BOOST_HAS_THREADS) || defined(ASIO_DISABLE_THREADS) \
  27. || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
  28. typedef null_signal_blocker signal_blocker;
  29. #elif defined(BOOST_HAS_PTHREADS)
  30. typedef posix_signal_blocker signal_blocker;
  31. #endif
  32. } // namespace detail
  33. } // namespace asio
  34. #endif // ASIO_DETAIL_SIGNAL_BLOCKER_HPP