Commit ccb6b622 authored by Feng Xiao's avatar Feng Xiao Committed by GitHub

Merge pull request #3480 from bklarson/master

Clean up typedefs for Atomic32/Atomic64
parents 35db2675 1b423474
...@@ -63,28 +63,21 @@ namespace google { ...@@ -63,28 +63,21 @@ namespace google {
namespace protobuf { namespace protobuf {
namespace internal { namespace internal {
#if defined(GOOGLE_PROTOBUF_ARCH_POWER) #ifdef GOOGLE_PROTOBUF_ARCH_32_BIT
#if defined(_LP64) || defined(__LP64__) typedef intptr_t Atomic32;
typedef int32 Atomic32; typedef int64 Atomic64;
typedef intptr_t Atomic64;
#else #else
typedef intptr_t Atomic32; typedef int32 Atomic32;
typedef int64 Atomic64; // We need to be able to go between Atomic64 and AtomicWord implicitly. This
#endif // means Atomic64 and AtomicWord should be the same type on 64-bit.
#else #if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL)
typedef int32 Atomic32; // NaCl's intptr_t is not actually 64-bits on 64-bit!
#ifdef GOOGLE_PROTOBUF_ARCH_64_BIT // http://code.google.com/p/nativeclient/issues/detail?id=1162
// We need to be able to go between Atomic64 and AtomicWord implicitly. This // sparcv9's pointer type is 32bits
// means Atomic64 and AtomicWord should be the same type on 64-bit. typedef int64 Atomic64;
#if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL) #else
// NaCl's intptr_t is not actually 64-bits on 64-bit! typedef intptr_t Atomic64;
// http://code.google.com/p/nativeclient/issues/detail?id=1162 #endif
// sparcv9's pointer type is 32bits
typedef int64 Atomic64;
#else
typedef intptr_t Atomic64;
#endif
#endif
#endif #endif
// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment