sp_counted_base.hpp 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/smart_ptr/detail/sp_has_gcc_intrinsics.hpp>
  17. #include <boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp>
  18. #include <boost/config.hpp>
  19. #if defined( BOOST_SP_DISABLE_THREADS )
  20. # include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
  21. #elif defined( BOOST_SP_USE_STD_ATOMIC )
  22. # include <boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
  23. #elif defined( BOOST_SP_USE_SPINLOCK )
  24. # include <boost/smart_ptr/detail/sp_counted_base_spin.hpp>
  25. #elif defined( BOOST_SP_USE_PTHREADS )
  26. # include <boost/smart_ptr/detail/sp_counted_base_pt.hpp>
  27. #elif defined( BOOST_DISABLE_THREADS ) && !defined( BOOST_SP_ENABLE_THREADS ) && !defined( BOOST_DISABLE_WIN32 )
  28. # include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
  29. #elif defined( BOOST_SP_HAS_GCC_INTRINSICS )
  30. # include <boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp>
  31. #elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
  32. # include <boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
  33. #elif defined( __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 )
  34. # include <boost/smart_ptr/detail/sp_counted_base_sync.hpp>
  35. #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined(__PATHSCALE__)
  36. # include <boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp>
  37. #elif defined( BOOST_SP_HAS_SYNC_INTRINSICS )
  38. # include <boost/smart_ptr/detail/sp_counted_base_sync.hpp>
  39. #elif defined( __SNC__ )
  40. # include <boost/smart_ptr/detail/sp_counted_base_snc_ps3.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(__GNUC__) && ( defined( __sparcv9 ) || ( defined( __sparcv8 ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 402 ) ) )
  54. # include <boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp>
  55. #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
  56. # include <boost/smart_ptr/detail/sp_counted_base_w32.hpp>
  57. #elif defined( _AIX )
  58. # include <boost/smart_ptr/detail/sp_counted_base_aix.hpp>
  59. #elif !defined( BOOST_HAS_THREADS )
  60. # include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
  61. #else
  62. # include <boost/smart_ptr/detail/sp_counted_base_spin.hpp>
  63. #endif
  64. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED