sp_counted_base.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // detail/sp_counted_base.hpp
  9. //
  10. // Copyright 2005-2013 Peter Dimov
  11. //
  12. // Distributed under the Boost Software License, Version 1.0. (See
  13. // accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt)
  15. //
  16. #include <boost/config.hpp>
  17. #include <boost/smart_ptr/detail/sp_has_sync.hpp>
  18. #if !defined( __c2__ ) && defined( __clang__ ) && defined( __has_extension )
  19. # if __has_extension( __c_atomic__ )
  20. # define BOOST_SP_HAS_CLANG_C11_ATOMICS
  21. # endif
  22. #endif
  23. #if defined( BOOST_SP_DISABLE_THREADS )
  24. # include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
  25. #elif defined( BOOST_SP_USE_STD_ATOMIC )
  26. # include <boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
  27. #elif defined( BOOST_SP_USE_SPINLOCK )
  28. # include <boost/smart_ptr/detail/sp_counted_base_spin.hpp>
  29. #elif defined( BOOST_SP_USE_PTHREADS )
  30. # include <boost/smart_ptr/detail/sp_counted_base_pt.hpp>
  31. #elif defined( BOOST_DISABLE_THREADS ) && !defined( BOOST_SP_ENABLE_THREADS ) && !defined( BOOST_DISABLE_WIN32 )
  32. # include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
  33. #elif defined( BOOST_SP_HAS_CLANG_C11_ATOMICS )
  34. # include <boost/smart_ptr/detail/sp_counted_base_clang.hpp>
  35. #elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
  36. # include <boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
  37. #elif defined( __SNC__ )
  38. # include <boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp>
  39. #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined(__PATHSCALE__)
  40. # include <boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp>
  41. #elif defined(__HP_aCC) && defined(__ia64)
  42. # include <boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp>
  43. #elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER ) && !defined(__PATHSCALE__)
  44. # include <boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp>
  45. #elif defined( __IBMCPP__ ) && defined( __powerpc )
  46. # include <boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp>
  47. #elif defined( __MWERKS__ ) && defined( __POWERPC__ )
  48. # include <boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp>
  49. #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX )
  50. # include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
  51. #elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 )
  52. # include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp>
  53. #elif defined( BOOST_SP_HAS_SYNC )
  54. # include <boost/smart_ptr/detail/sp_counted_base_sync.hpp>
  55. #elif defined(__GNUC__) && ( defined( __sparcv9 ) || ( defined( __sparcv8 ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 402 ) ) )
  56. # include <boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp>
  57. #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
  58. # include <boost/smart_ptr/detail/sp_counted_base_w32.hpp>
  59. #elif defined( _AIX )
  60. # include <boost/smart_ptr/detail/sp_counted_base_aix.hpp>
  61. #elif !defined( BOOST_HAS_THREADS )
  62. # include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
  63. #else
  64. # include <boost/smart_ptr/detail/sp_counted_base_spin.hpp>
  65. #endif
  66. #undef BOOST_SP_HAS_CLANG_C11_ATOMICS
  67. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED