caps_gcc_sync.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2011 Helge Bahmann
  7. * Copyright (c) 2013 Tim Blechmann
  8. * Copyright (c) 2014 Andrey Semashev
  9. */
  10. /*!
  11. * \file atomic/detail/caps_gcc_sync.hpp
  12. *
  13. * This header defines feature capabilities macros
  14. */
  15. #ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_
  16. #define BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_
  17. #include <boost/atomic/detail/config.hpp>
  18. #if defined(__i386__) || defined(__x86_64__)
  19. #include <boost/atomic/detail/hwcaps_gcc_x86.hpp>
  20. #elif defined(__arm__)
  21. #include <boost/atomic/detail/hwcaps_gcc_arm.hpp>
  22. #elif defined(__POWERPC__) || defined(__PPC__)
  23. #include <boost/atomic/detail/hwcaps_gcc_ppc.hpp>
  24. #endif
  25. #ifdef BOOST_HAS_PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1)\
  29. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)\
  30. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
  31. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  32. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  33. #define BOOST_ATOMIC_INT8_LOCK_FREE 2
  34. #endif
  35. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)\
  36. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
  37. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  38. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  39. #define BOOST_ATOMIC_INT16_LOCK_FREE 2
  40. #endif
  41. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
  42. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  43. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  44. #define BOOST_ATOMIC_INT32_LOCK_FREE 2
  45. #endif
  46. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  47. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  48. #define BOOST_ATOMIC_INT64_LOCK_FREE 2
  49. #endif
  50. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  51. #define BOOST_ATOMIC_INT128_LOCK_FREE 2
  52. #endif
  53. #define BOOST_ATOMIC_THREAD_FENCE 2
  54. #define BOOST_ATOMIC_SIGNAL_FENCE 2
  55. #endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_