summaryrefslogtreecommitdiff
path: root/boost/atomic/detail/ops_gcc_sync.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/atomic/detail/ops_gcc_sync.hpp')
-rw-r--r--boost/atomic/detail/ops_gcc_sync.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/boost/atomic/detail/ops_gcc_sync.hpp b/boost/atomic/detail/ops_gcc_sync.hpp
index f4fc3331c6..87f2f53029 100644
--- a/boost/atomic/detail/ops_gcc_sync.hpp
+++ b/boost/atomic/detail/ops_gcc_sync.hpp
@@ -165,6 +165,17 @@ struct operations< 1u, Signed > :
public extending_cas_based_operations< gcc_sync_operations< typename make_storage_type< 16u, Signed >::type >, 1u, Signed >
#endif
{
+#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1)
+ typedef typename make_storage_type< 1u, Signed >::aligned aligned_storage_type;
+#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)
+ typedef typename make_storage_type< 2u, Signed >::aligned aligned_storage_type;
+#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+ typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type;
+#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
+ typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
+#else
+ typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
+#endif
};
#endif
@@ -181,6 +192,15 @@ struct operations< 2u, Signed > :
public extending_cas_based_operations< gcc_sync_operations< typename make_storage_type< 16u, Signed >::type >, 2u, Signed >
#endif
{
+#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)
+ typedef typename make_storage_type< 2u, Signed >::aligned aligned_storage_type;
+#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+ typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type;
+#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
+ typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
+#else
+ typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
+#endif
};
#endif
@@ -195,6 +215,13 @@ struct operations< 4u, Signed > :
public extending_cas_based_operations< gcc_sync_operations< typename make_storage_type< 16u, Signed >::type >, 4u, Signed >
#endif
{
+#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+ typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type;
+#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
+ typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
+#else
+ typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
+#endif
};
#endif
@@ -207,6 +234,11 @@ struct operations< 8u, Signed > :
public extending_cas_based_operations< gcc_sync_operations< typename make_storage_type< 16u, Signed >::type >, 8u, Signed >
#endif
{
+#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
+ typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
+#else
+ typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
+#endif
};
#endif
@@ -215,6 +247,7 @@ template< bool Signed >
struct operations< 16u, Signed > :
public gcc_sync_operations< typename make_storage_type< 16u, Signed >::type >
{
+ typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
};
#endif