diff options
-rw-r--r-- | base/atomicops.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/base/atomicops.h b/base/atomicops.h index e67c51a..1b3bc02 100644 --- a/base/atomicops.h +++ b/base/atomicops.h @@ -54,20 +54,17 @@ #define BASE_ATOMICOPS_H_ #include "base/basictypes.h" - -#if defined(_WIN64) || defined(__x86_64__) || defined(__LP64) -#define HAS_64_BIT -#endif -#ifndef WIN32 -#define __w64 -#endif +#include "base/port.h" namespace base { namespace subtle { // Bug 1308991. We need this for /Wp64, to mark it safe for AtomicWord casting. +#ifndef OS_WIN +#define __w64 +#endif typedef __w64 int32 Atomic32; -#ifdef HAS_64_BIT +#ifdef CPU_ARCH_64_BITS typedef int64 Atomic64; #endif @@ -126,7 +123,7 @@ Atomic32 Acquire_Load(volatile const Atomic32* ptr); Atomic32 Release_Load(volatile const Atomic32* ptr); // 64-bit atomic operations (only available on 64-bit processors). -#ifdef HAS_64_BIT +#ifdef CPU_ARCH_64_BITS Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, Atomic64 old_value, Atomic64 new_value); @@ -146,17 +143,17 @@ void Release_Store(volatile Atomic64* ptr, Atomic64 value); Atomic64 NoBarrier_Load(volatile const Atomic64* ptr); Atomic64 Acquire_Load(volatile const Atomic64* ptr); Atomic64 Release_Load(volatile const Atomic64* ptr); -#endif // HAS_64_bit +#endif // CPU_ARCH_64_BITS } // namespace base::subtle } // namespace base // Include our platform specific implementation. -#if defined(_MSC_VER) && defined(_M_IX86) +#if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY) #include "base/atomicops_internals_x86_msvc.h" -#elif defined(__MACH__) && defined(__APPLE__) && defined(__i386__) +#elif defined(OS_APPLE) && defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) #include "base/atomicops_internals_x86_macosx.h" -#elif defined(__GNUC__) && (defined(__i386) || defined(ARCH_K8)) +#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) #include "base/atomicops_internals_x86_gcc.h" #else #error "Atomic operations are not supported on your platform" |