caps_gcc_sync.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifdef BOOST_HAS_PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1)\
  22. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)\
  23. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
  24. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  25. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  26. #define BOOST_ATOMIC_INT8_LOCK_FREE 2
  27. #endif
  28. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)\
  29. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
  30. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  31. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  32. #define BOOST_ATOMIC_INT16_LOCK_FREE 2
  33. #endif
  34. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
  35. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  36. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  37. #define BOOST_ATOMIC_INT32_LOCK_FREE 2
  38. #endif
  39. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
  40. || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  41. #define BOOST_ATOMIC_INT64_LOCK_FREE 2
  42. #endif
  43. #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
  44. #define BOOST_ATOMIC_INT128_LOCK_FREE 2
  45. #endif
  46. #define BOOST_ATOMIC_THREAD_FENCE 2
  47. #define BOOST_ATOMIC_SIGNAL_FENCE 2
  48. #endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_