From bd254b491ec6815e0a2cf7526aab3e71a6edb93b Mon Sep 17 00:00:00 2001 From: "abarth@chromium.org" Date: Wed, 1 Dec 2010 07:34:58 +0000 Subject: [PATCH] Help make base compile in NaCl. Turns out intptr_t isn't 64 bits wide in 64-bit NaCl. This class assumes that Atomic64 is actually 64 bits wide, so we need to use the int64_t type instead. Original patch by Eric Seidel. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67826 0039d316-1c4b-4281-b951-d872f2087c98 --- base/atomicops.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/atomicops.h b/base/atomicops.h index cf2f2bbf386cae..445696bec5931f 100644 --- a/base/atomicops.h +++ b/base/atomicops.h @@ -43,8 +43,14 @@ typedef __w64 int32 Atomic32; #ifdef ARCH_CPU_64_BITS // We need to be able to go between Atomic64 and AtomicWord implicitly. This // means Atomic64 and AtomicWord should be the same type on 64-bit. +#if defined(OS_NACL) +// NaCl's intptr_t is not actually 64-bits on 64-bit! +// http://code.google.com/p/nativeclient/issues/detail?id=1162 +typedef int64_t Atomic64; +#else typedef intptr_t Atomic64; #endif +#endif // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or // Atomic64 routines below, depending on your architecture.