platform.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef BOOST_ATOMIC_DETAIL_PLATFORM_HPP
  2. #define BOOST_ATOMIC_DETAIL_PLATFORM_HPP
  3. // Copyright (c) 2009 Helge Bahmann
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. // Platform selection file
  9. #include <boost/atomic/detail/config.hpp>
  10. #ifdef BOOST_HAS_PRAGMA_ONCE
  11. #pragma once
  12. #endif
  13. // Intel compiler does not support __atomic* intrinsics properly, although defines them (tested with 13.0.1 and 13.1.1 on Linux)
  14. #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(BOOST_INTEL_CXX_VERSION))\
  15. || (defined(BOOST_CLANG) && ((__clang_major__ * 100 + __clang_minor__) >= 302))
  16. #include <boost/atomic/detail/gcc-atomic.hpp>
  17. #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  18. #include <boost/atomic/detail/gcc-x86.hpp>
  19. #elif 0 && defined(__GNUC__) && defined(__alpha__) /* currently does not work correctly */
  20. #include <boost/atomic/detail/base.hpp>
  21. #include <boost/atomic/detail/gcc-alpha.hpp>
  22. #elif defined(__GNUC__) && (defined(__POWERPC__) || defined(__PPC__))
  23. #include <boost/atomic/detail/gcc-ppc.hpp>
  24. // This list of ARM architecture versions comes from Apple's arm/arch.h header.
  25. // I don't know how complete it is.
  26. #elif defined(__GNUC__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
  27. || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
  28. || defined(__ARM_ARCH_6K__) \
  29. || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
  30. || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
  31. || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__))
  32. #include <boost/atomic/detail/gcc-armv6plus.hpp>
  33. #elif defined(__linux__) && defined(__arm__)
  34. #include <boost/atomic/detail/linux-arm.hpp>
  35. #elif defined(__GNUC__) && defined(__sparc_v9__)
  36. #include <boost/atomic/detail/gcc-sparcv9.hpp>
  37. #elif defined(BOOST_WINDOWS) || defined(_WIN32_CE)
  38. #include <boost/atomic/detail/windows.hpp>
  39. #elif 0 && defined(__GNUC__) /* currently does not work correctly */
  40. #include <boost/atomic/detail/base.hpp>
  41. #include <boost/atomic/detail/gcc-cas.hpp>
  42. #else
  43. #include <boost/atomic/detail/base.hpp>
  44. #endif
  45. #endif