summaryrefslogtreecommitdiffstats
path: root/base/atomicops.h
diff options
context:
space:
mode:
authordeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-05 13:01:35 +0000
committerdeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-05 13:01:35 +0000
commitc52e233831bbbf7c9a162f8ced0269ee7ed0c87d (patch)
treefca1dff2a5b01db199c8e96ce7a0c997e73874e4 /base/atomicops.h
parentab8c0b042557b4f3153652f1de7472738ced05c7 (diff)
downloadchromium_src-c52e233831bbbf7c9a162f8ced0269ee7ed0c87d.zip
chromium_src-c52e233831bbbf7c9a162f8ced0269ee7ed0c87d.tar.gz
chromium_src-c52e233831bbbf7c9a162f8ced0269ee7ed0c87d.tar.bz2
Use the build_config defines in atomicops.h. This still uses the compiler/platform specific defines in the platform dependent internals headers, keeping them closer to the original implementation.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/atomicops.h')
-rw-r--r--base/atomicops.h23
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"