From 2bab5309434ab810265ef4c3a4a48686a1b53add Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 25 Sep 2014 23:17:13 +0400 Subject: [PATCH] Fix bugs in libcds atomic implementation --- cds/compiler/cxx11_atomic.h | 44 +++++++++++++-------------- cds/compiler/gcc/x86/cxx11_atomic32.h | 4 +-- projects/Win/vc12/cds.vcxproj | 1 + projects/Win/vc12/cds.vcxproj.filters | 3 ++ 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/cds/compiler/cxx11_atomic.h b/cds/compiler/cxx11_atomic.h index 726a241a..120e9430 100644 --- a/cds/compiler/cxx11_atomic.h +++ b/cds/compiler/cxx11_atomic.h @@ -71,22 +71,22 @@ namespace cds { namespace cxx11_atomic { template <> struct primary_type<1> { - typedef cds::uint8_t type; + typedef std::uint8_t type; }; template <> struct primary_type<2> { - typedef cds::uint16_t type; + typedef std::uint16_t type; }; template <> struct primary_type<4> { - typedef cds::uint32_t type; + typedef std::uint32_t type; }; template <> struct primary_type<8> { - typedef cds::uint64_t type; + typedef std::uint64_t type; }; template @@ -1802,28 +1802,28 @@ namespace cds { namespace cxx11_atomic { typedef atomic atomic_wchar_t; - typedef atomic atomic_int_least8_t; - typedef atomic atomic_uint_least8_t; - typedef atomic atomic_int_least16_t; - typedef atomic atomic_uint_least16_t; - typedef atomic atomic_int_least32_t; - typedef atomic atomic_uint_least32_t; - typedef atomic atomic_int_least64_t; - typedef atomic atomic_uint_least64_t; - typedef atomic atomic_int_fast8_t; - typedef atomic atomic_uint_fast8_t; - typedef atomic atomic_int_fast16_t; - typedef atomic atomic_uint_fast16_t; - typedef atomic atomic_int_fast32_t; - typedef atomic atomic_uint_fast32_t; - typedef atomic atomic_int_fast64_t; - typedef atomic atomic_uint_fast64_t; + typedef atomic atomic_int_least8_t; + typedef atomic atomic_uint_least8_t; + typedef atomic atomic_int_least16_t; + typedef atomic atomic_uint_least16_t; + typedef atomic atomic_int_least32_t; + typedef atomic atomic_uint_least32_t; + typedef atomic atomic_int_least64_t; + typedef atomic atomic_uint_least64_t; + typedef atomic atomic_int_fast8_t; + typedef atomic atomic_uint_fast8_t; + typedef atomic atomic_int_fast16_t; + typedef atomic atomic_uint_fast16_t; + typedef atomic atomic_int_fast32_t; + typedef atomic atomic_uint_fast32_t; + typedef atomic atomic_int_fast64_t; + typedef atomic atomic_uint_fast64_t; typedef atomic atomic_intptr_t; typedef atomic atomic_uintptr_t; typedef atomic atomic_size_t; typedef atomic atomic_ptrdiff_t; - typedef atomic atomic_intmax_t; - typedef atomic atomic_uintmax_t; + typedef atomic atomic_intmax_t; + typedef atomic atomic_uintmax_t; template static inline bool atomic_is_lock_free(const volatile atomic * p) CDS_NOEXCEPT diff --git a/cds/compiler/gcc/x86/cxx11_atomic32.h b/cds/compiler/gcc/x86/cxx11_atomic32.h index c945a988..be7c3c20 100644 --- a/cds/compiler/gcc/x86/cxx11_atomic32.h +++ b/cds/compiler/gcc/x86/cxx11_atomic32.h @@ -7,7 +7,7 @@ #include //@cond -namespace cds { namespace cxx11_atomics { +namespace cds { namespace cxx11_atomic { namespace platform { CDS_CXX11_INLINE_NAMESPACE namespace gcc { CDS_CXX11_INLINE_NAMESPACE namespace x86 { static inline void fence_before( memory_order order ) CDS_NOEXCEPT @@ -468,7 +468,7 @@ namespace cds { namespace cxx11_atomics { } }}} // namespace platform::gcc::x86 -}} // namespace cds::cxx11_atomics +}} // namespace cds::cxx11_atomic //@endcond #endif // #ifndef __CDS_COMPILER_GCC_X86_CXX11_ATOMIC32_H diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index 6721fb07..e417beaa 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -647,6 +647,7 @@ + diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index 2d319256..ed80d9e2 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -1274,5 +1274,8 @@ Header Files\cds\container\details + + Header Files\cds\compiler\gcc\x86 + \ No newline at end of file -- 2.34.1