diff --git a/include/boost/atomic/capabilities.hpp b/include/boost/atomic/capabilities.hpp new file mode 100644 index 0000000..a5d1b3b --- /dev/null +++ b/include/boost/atomic/capabilities.hpp @@ -0,0 +1,82 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/capabilities.hpp + * + * This header defines feature capabilities macros. + */ + +#ifndef BOOST_ATOMIC_CAPABILITIES_HPP_INCLUDED_ +#define BOOST_ATOMIC_CAPABILITIES_HPP_INCLUDED_ + +#include +#include + +#if !defined(BOOST_ATOMIC_EMULATED) +#include BOOST_ATOMIC_DETAIL_HEADER(boost/atomic/detail/caps_) +#endif + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#ifndef BOOST_ATOMIC_CHAR_LOCK_FREE +#define BOOST_ATOMIC_CHAR_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_CHAR16_T_LOCK_FREE +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_CHAR32_T_LOCK_FREE +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_WCHAR_T_LOCK_FREE +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_SHORT_LOCK_FREE +#define BOOST_ATOMIC_SHORT_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_INT_LOCK_FREE +#define BOOST_ATOMIC_INT_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_LONG_LOCK_FREE +#define BOOST_ATOMIC_LONG_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_LLONG_LOCK_FREE +#define BOOST_ATOMIC_LLONG_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_INT128_LOCK_FREE +#define BOOST_ATOMIC_INT128_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_POINTER_LOCK_FREE +#define BOOST_ATOMIC_POINTER_LOCK_FREE 0 +#endif + +#define BOOST_ATOMIC_ADDRESS_LOCK_FREE BOOST_ATOMIC_POINTER_LOCK_FREE + +#ifndef BOOST_ATOMIC_BOOL_LOCK_FREE +#define BOOST_ATOMIC_BOOL_LOCK_FREE 0 +#endif + +#ifndef BOOST_ATOMIC_THREAD_FENCE +#define BOOST_ATOMIC_THREAD_FENCE 0 +#endif + +#ifndef BOOST_ATOMIC_SIGNAL_FENCE +#define BOOST_ATOMIC_SIGNAL_FENCE 0 +#endif + +#endif // BOOST_ATOMIC_CAPABILITIES_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/atomic_traits_fwd.hpp b/include/boost/atomic/detail/atomic_traits_fwd.hpp new file mode 100644 index 0000000..198d87a --- /dev/null +++ b/include/boost/atomic/detail/atomic_traits_fwd.hpp @@ -0,0 +1,34 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/atomic_traits_fwd.hpp + * + * This header contains forward declaration of the \c atomic_traits template. + */ + +#ifndef BOOST_ATOMIC_DETAIL_ATOMIC_TRAITS_FWD_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_ATOMIC_TRAITS_FWD_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace boost { +namespace atomics { +namespace detail { + +template< unsigned int Size > +struct atomic_traits; + +} // namespace detail +} // namespace atomics +} // namespace boost + +#endif // BOOST_ATOMIC_DETAIL_ATOMIC_TRAITS_FWD_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_gcc_arm.hpp b/include/boost/atomic/detail/caps_gcc_arm.hpp new file mode 100644 index 0000000..df04375 --- /dev/null +++ b/include/boost/atomic/detail/caps_gcc_arm.hpp @@ -0,0 +1,53 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2009 Phil Endecott + * Copyright (c) 2013 Tim Blechmann + * ARM Code by Phil Endecott, based on other architectures. + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_gcc_arm.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_ARM_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_GCC_ARM_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_FLAG_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 + +#if defined(__SIZEOF_LONG__) +#if __SIZEOF_LONG__ == 4 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#else +#include +#if ULONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#endif + +#define BOOST_ATOMIC_LLONG_LOCK_FREE 0 +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_ARM_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_gcc_atomic.hpp b/include/boost/atomic/detail/caps_gcc_atomic.hpp new file mode 100644 index 0000000..e5ec7ad --- /dev/null +++ b/include/boost/atomic/detail/caps_gcc_atomic.hpp @@ -0,0 +1,71 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_gcc_atomic.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_ATOMIC_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_GCC_ATOMIC_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if defined(__i386__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) +#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B 1 +#endif + +#if defined(__x86_64__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) +#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1 +#endif + +#if __GCC_ATOMIC_BOOL_LOCK_FREE == 2 +#define BOOST_ATOMIC_FLAG_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_CHAR_LOCK_FREE == 2 +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_CHAR16_T_LOCK_FREE == 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_CHAR32_T_LOCK_FREE == 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_SHORT_LOCK_FREE == 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_INT_LOCK_FREE == 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_LONG_LOCK_FREE == 2 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_LLONG_LOCK_FREE == 2 +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) && (defined(BOOST_HAS_INT128) || !defined(BOOST_NO_ALIGNMENT)) +#define BOOST_ATOMIC_INT128_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_POINTER_LOCK_FREE == 2 +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#endif +#if __GCC_ATOMIC_BOOL_LOCK_FREE == 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 +#endif + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_ATOMIC_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_gcc_ppc.hpp b/include/boost/atomic/detail/caps_gcc_ppc.hpp new file mode 100644 index 0000000..01ce0a6 --- /dev/null +++ b/include/boost/atomic/detail/caps_gcc_ppc.hpp @@ -0,0 +1,58 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2013 Tim Blechmann + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_gcc_ppc.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_PPC_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_GCC_PPC_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_FLAG_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 + +#if defined(__SIZEOF_LONG__) +#if __SIZEOF_LONG__ == 4 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#elif __SIZEOF_LONG__ == 8 && defined(__powerpc64__) +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#else +#include +#if ULONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#elif ULONG_MAX == 0xffffffffffffffff && defined(__powerpc64__) +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#endif + +#if defined(__powerpc64__) +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_PPC_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_gcc_sparcv9.hpp b/include/boost/atomic/detail/caps_gcc_sparcv9.hpp new file mode 100644 index 0000000..4096118 --- /dev/null +++ b/include/boost/atomic/detail/caps_gcc_sparcv9.hpp @@ -0,0 +1,51 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2010 Helge Bahmann + * Copyright (c) 2013 Tim Blechmann + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_gcc_sparcv9.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_SPARCV9_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_GCC_SPARCV9_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_FLAG_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 + +#if defined(__SIZEOF_LONG__) +#if __SIZEOF_LONG__ == 4 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#else +#include +#if ULONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#endif + +#define BOOST_ATOMIC_LLONG_LOCK_FREE 0 +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_SPARCV9_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_gcc_sync.hpp b/include/boost/atomic/detail/caps_gcc_sync.hpp new file mode 100644 index 0000000..9bc846e --- /dev/null +++ b/include/boost/atomic/detail/caps_gcc_sync.hpp @@ -0,0 +1,60 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2011 Helge Bahmann + * Copyright (c) 2013 Tim Blechmann + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_gcc_sync.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 + +#if defined(__SIZEOF_LONG__) +#if __SIZEOF_LONG__ == 4 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#else +#include +#if ULONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#endif + +#if defined(__SIZEOF_LONG_LONG__) +#if __SIZEOF_LONG_LONG__ == 4 +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#else +#include +#if defined(ULLONG_MAX) && ULLONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#endif + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_gcc_x86.hpp b/include/boost/atomic/detail/caps_gcc_x86.hpp new file mode 100644 index 0000000..ce31b22 --- /dev/null +++ b/include/boost/atomic/detail/caps_gcc_x86.hpp @@ -0,0 +1,74 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2012 Tim Blechmann + * Copyright (c) 2013 - 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_gcc_x86.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_X86_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_GCC_X86_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if defined(__i386__) &&\ + (\ + defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) ||\ + defined(__i586__) || defined(__i686__) || defined(__pentium4__) || defined(__nocona__) || defined(__core2__) || defined(__corei7__) ||\ + defined(__k6__) || defined(__athlon__) || defined(__k8__) || defined(__amdfam10__) || defined(__bdver1__) || defined(__bdver2__) || defined(__bdver3__) || defined(__btver1__) || defined(__btver2__)\ + ) +#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B 1 +#endif + +#if defined(__x86_64__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) +#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1 +#endif + +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 + +#if defined(__SIZEOF_LONG__) +#if __SIZEOF_LONG__ == 4 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#elif __SIZEOF_LONG__ == 8 && (defined(__x86_64__) || defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B)) +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#else +#include +#if ULONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#elif ULONG_MAX == 0xffffffffffffffff && (defined(__x86_64__) || defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B)) +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#endif + +#if defined(__x86_64__) || defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B) +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif + +#if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) && (defined(BOOST_HAS_INT128) || !defined(BOOST_NO_ALIGNMENT)) +#define BOOST_ATOMIC_INT128_LOCK_FREE 2 +#endif + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_X86_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_linux_arm.hpp b/include/boost/atomic/detail/caps_linux_arm.hpp new file mode 100644 index 0000000..37323e2 --- /dev/null +++ b/include/boost/atomic/detail/caps_linux_arm.hpp @@ -0,0 +1,62 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009, 2011 Helge Bahmann + * Copyright (c) 2009 Phil Endecott + * Copyright (c) 2013 Tim Blechmann + * Linux-specific code by Phil Endecott + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_linux_arm.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_LINUX_ARM_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_LINUX_ARM_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 + +#if defined(__SIZEOF_LONG__) +#if __SIZEOF_LONG__ == 4 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#else +#include +#if ULONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#endif +#endif + +#if defined(__SIZEOF_LONG_LONG__) +#if __SIZEOF_LONG_LONG__ == 4 +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#else +#include +#if defined(ULLONG_MAX) && ULLONG_MAX == 0xffffffff +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#endif + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_LINUX_ARM_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_msvc_arm.hpp b/include/boost/atomic/detail/caps_msvc_arm.hpp new file mode 100644 index 0000000..bdd81bf --- /dev/null +++ b/include/boost/atomic/detail/caps_msvc_arm.hpp @@ -0,0 +1,41 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2013 Tim Blechmann + * Copyright (c) 2012 - 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_msvc_arm.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_MSVC_ARM_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_MSVC_ARM_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#define BOOST_ATOMIC_LLONG_LOCK_FREE 0 +#define BOOST_ATOMIC_INT128_LOCK_FREE 0 + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_MSVC_ARM_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_msvc_x86.hpp b/include/boost/atomic/detail/caps_msvc_x86.hpp new file mode 100644 index 0000000..c306388 --- /dev/null +++ b/include/boost/atomic/detail/caps_msvc_x86.hpp @@ -0,0 +1,55 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2013 Tim Blechmann + * Copyright (c) 2012 - 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_msvc_x86.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_MSVC_X86_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_MSVC_X86_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if defined(_M_IX86) && _M_IX86 >= 500 +#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B 1 +#endif + +#if defined(_M_AMD64) && !defined(BOOST_ATOMIC_NO_CMPXCHG16B) +#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1 +#endif + +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 + +#if defined(_M_AMD64) || defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B) +#define BOOST_ATOMIC_LLONG_LOCK_FREE 2 +#endif + +#if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) && (defined(BOOST_HAS_INT128) || !defined(BOOST_NO_ALIGNMENT)) +#define BOOST_ATOMIC_INT128_LOCK_FREE 2 +#endif + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_MSVC_X86_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/caps_windows.hpp b/include/boost/atomic/detail/caps_windows.hpp new file mode 100644 index 0000000..858f280 --- /dev/null +++ b/include/boost/atomic/detail/caps_windows.hpp @@ -0,0 +1,41 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2013 Tim Blechmann + * Copyright (c) 2012 - 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/caps_windows.hpp + * + * This header defines feature capabilities macros + */ + +#ifndef BOOST_ATOMIC_DETAIL_CAPS_WINDOWS_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CAPS_WINDOWS_HPP_INCLUDED_ + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#define BOOST_ATOMIC_CHAR_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define BOOST_ATOMIC_SHORT_LOCK_FREE 2 +#define BOOST_ATOMIC_INT_LOCK_FREE 2 +#define BOOST_ATOMIC_LONG_LOCK_FREE 2 +#define BOOST_ATOMIC_LLONG_LOCK_FREE 0 +#define BOOST_ATOMIC_INT128_LOCK_FREE 0 + +#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 +#define BOOST_ATOMIC_BOOL_LOCK_FREE 2 + +#define BOOST_ATOMIC_THREAD_FENCE 2 +#define BOOST_ATOMIC_SIGNAL_FENCE 2 + +#endif // BOOST_ATOMIC_DETAIL_CAPS_WINDOWS_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/config.hpp b/include/boost/atomic/detail/config.hpp index b1984e5..d03ec6a 100644 --- a/include/boost/atomic/detail/config.hpp +++ b/include/boost/atomic/detail/config.hpp @@ -1,11 +1,19 @@ -#ifndef BOOST_ATOMIC_DETAIL_CONFIG_HPP -#define BOOST_ATOMIC_DETAIL_CONFIG_HPP +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2012 Hartmut Kaiser + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/config.hpp + * + * This header defines configuraion macros for Boost.Atomic + */ -// Copyright (c) 2012 Hartmut Kaiser -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_ATOMIC_DETAIL_CONFIG_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_CONFIG_HPP_INCLUDED_ #include @@ -13,4 +21,4 @@ #pragma once #endif -#endif +#endif // BOOST_ATOMIC_DETAIL_CONFIG_HPP_INCLUDED_ diff --git a/include/boost/atomic/detail/link.hpp b/include/boost/atomic/detail/link.hpp index 25a4caf..4f522ac 100644 --- a/include/boost/atomic/detail/link.hpp +++ b/include/boost/atomic/detail/link.hpp @@ -1,11 +1,19 @@ -#ifndef BOOST_ATOMIC_DETAIL_LINK_HPP -#define BOOST_ATOMIC_DETAIL_LINK_HPP +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2012 Hartmut Kaiser + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/config.hpp + * + * This header defines macros for linking with compiled library of Boost.Atomic + */ -// Copyright (c) 2012 Hartmut Kaiser -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_ATOMIC_DETAIL_LINK_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_LINK_HPP_INCLUDED_ #include diff --git a/include/boost/atomic/detail/platform.hpp b/include/boost/atomic/detail/platform.hpp index 4a172d6..746c6d4 100644 --- a/include/boost/atomic/detail/platform.hpp +++ b/include/boost/atomic/detail/platform.hpp @@ -1,13 +1,19 @@ -#ifndef BOOST_ATOMIC_DETAIL_PLATFORM_HPP -#define BOOST_ATOMIC_DETAIL_PLATFORM_HPP +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2009 Helge Bahmann + * Copyright (c) 2014 Andrey Semashev + */ +/*! + * \file atomic/detail/platform.hpp + * + * This header defines macros for the target platform detection + */ -// Copyright (c) 2009 Helge Bahmann -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Platform selection file +#ifndef BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_ #include @@ -15,56 +21,70 @@ #pragma once #endif +#if !defined(BOOST_ATOMIC_FORCE_FALLBACK) + +#define BOOST_ATOMIC_DETAIL_PLATFORM emulated +#define BOOST_ATOMIC_EMULATED + // Intel compiler does not support __atomic* intrinsics properly, although defines them (tested with 13.0.1 and 13.1.1 on Linux) -#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(BOOST_INTEL_CXX_VERSION))\ +#elif (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(BOOST_INTEL_CXX_VERSION))\ || (defined(BOOST_CLANG) && ((__clang_major__ * 100 + __clang_minor__) >= 302)) - #include +#define BOOST_ATOMIC_DETAIL_PLATFORM gcc_atomic #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - #include - -#elif 0 && defined(__GNUC__) && defined(__alpha__) /* currently does not work correctly */ - - #include - #include +#define BOOST_ATOMIC_DETAIL_PLATFORM gcc_x86 #elif defined(__GNUC__) && (defined(__POWERPC__) || defined(__PPC__)) - #include +#define BOOST_ATOMIC_DETAIL_PLATFORM gcc_ppc // This list of ARM architecture versions comes from Apple's arm/arch.h header. // I don't know how complete it is. -#elif defined(__GNUC__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ - || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ - || defined(__ARM_ARCH_6K__) \ - || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ - || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ - || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)) +#elif defined(__GNUC__) &&\ + (\ + defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) ||\ + defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) ||\ + defined(__ARM_ARCH_6K__) ||\ + defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) ||\ + defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) ||\ + defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)\ + ) - #include - -#elif defined(__linux__) && defined(__arm__) - - #include +#define BOOST_ATOMIC_DETAIL_PLATFORM gcc_arm #elif defined(__GNUC__) && defined(__sparc_v9__) - #include - -#elif defined(BOOST_WINDOWS) || defined(_WIN32_CE) - - #include +#define BOOST_ATOMIC_DETAIL_PLATFORM gcc_sparcv9 #elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401) - #include +#define BOOST_ATOMIC_DETAIL_PLATFORM gcc_sync + +#elif defined(__linux__) && defined(__arm__) + +#define BOOST_ATOMIC_DETAIL_PLATFORM linux_arm + +#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) + +#define BOOST_ATOMIC_DETAIL_PLATFORM msvc_x86 + +#elif defined(_MSC_VER) && defined(_M_ARM) + +#define BOOST_ATOMIC_DETAIL_PLATFORM msvc_arm + +#elif defined(BOOST_WINDOWS) || defined(_WIN32_CE) + +#define BOOST_ATOMIC_DETAIL_PLATFORM windows #else -#include +#define BOOST_ATOMIC_DETAIL_PLATFORM emulated +#define BOOST_ATOMIC_EMULATED #endif -#endif +#define BOOST_ATOMIC_DETAIL_HEADER(prefix) + +#endif // BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_