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.

70 lines
1.7KB

  1. //
  2. // detail/tss_ptr.hpp
  3. // ~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 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_TSS_PTR_HPP
  11. #define ASIO_DETAIL_TSS_PTR_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(ASIO_HAS_THREADS)
  17. # include "asio/detail/null_tss_ptr.hpp"
  18. #elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
  19. # include "asio/detail/keyword_tss_ptr.hpp"
  20. #elif defined(ASIO_WINDOWS)
  21. # include "asio/detail/win_tss_ptr.hpp"
  22. #elif defined(ASIO_HAS_PTHREADS)
  23. # include "asio/detail/posix_tss_ptr.hpp"
  24. #else
  25. # error Only Windows and POSIX are supported!
  26. #endif
  27. #include "asio/detail/push_options.hpp"
  28. namespace asio {
  29. namespace detail {
  30. template <typename T>
  31. class tss_ptr
  32. #if !defined(ASIO_HAS_THREADS)
  33. : public null_tss_ptr<T>
  34. #elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
  35. : public keyword_tss_ptr<T>
  36. #elif defined(ASIO_WINDOWS)
  37. : public win_tss_ptr<T>
  38. #elif defined(ASIO_HAS_PTHREADS)
  39. : public posix_tss_ptr<T>
  40. #endif
  41. {
  42. public:
  43. void operator=(T* value)
  44. {
  45. #if !defined(ASIO_HAS_THREADS)
  46. null_tss_ptr<T>::operator=(value);
  47. #elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
  48. keyword_tss_ptr<T>::operator=(value);
  49. #elif defined(ASIO_WINDOWS)
  50. win_tss_ptr<T>::operator=(value);
  51. #elif defined(ASIO_HAS_PTHREADS)
  52. posix_tss_ptr<T>::operator=(value);
  53. #endif
  54. }
  55. };
  56. } // namespace detail
  57. } // namespace asio
  58. #include "asio/detail/pop_options.hpp"
  59. #endif // ASIO_DETAIL_TSS_PTR_HPP