sp_has_sync.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // boost/smart_ptr/detail/sp_has_sync.hpp
  9. //
  10. // Copyright (c) 2008, 2009 Peter Dimov
  11. //
  12. // Distributed under the Boost Software License, Version 1.0.
  13. // See accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt)
  15. //
  16. // Defines the BOOST_SP_HAS_SYNC macro if the __sync_* intrinsics
  17. // are available.
  18. //
  19. #ifndef BOOST_SP_NO_SYNC
  20. #if !defined( __c2__ ) && defined( __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 )
  21. # define BOOST_SP_HAS_SYNC
  22. #elif defined( __IBMCPP__ ) && ( __IBMCPP__ >= 1210 ) && !defined( __COMPILER_VER__ )
  23. # define BOOST_SP_HAS_SYNC
  24. #elif !defined( __c2__ ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
  25. #define BOOST_SP_HAS_SYNC
  26. #if defined( __arm__ ) || defined( __armel__ )
  27. #undef BOOST_SP_HAS_SYNC
  28. #endif
  29. #if defined( __hppa ) || defined( __hppa__ )
  30. #undef BOOST_SP_HAS_SYNC
  31. #endif
  32. #if defined( __m68k__ )
  33. #undef BOOST_SP_HAS_SYNC
  34. #endif
  35. #if defined( __sh__ )
  36. #undef BOOST_SP_HAS_SYNC
  37. #endif
  38. #if defined( __sparc__ )
  39. #undef BOOST_SP_HAS_SYNC
  40. #endif
  41. #if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1110 )
  42. #undef BOOST_SP_HAS_SYNC
  43. #endif
  44. #if defined(__PATHSCALE__) && ((__PATHCC__ == 4) && (__PATHCC_MINOR__ < 9))
  45. #undef BOOST_SP_HAS_SYNC
  46. #endif
  47. #endif
  48. #endif // #ifndef BOOST_SP_NO_SYNC
  49. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED