aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/atomicops.h
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-11-08 15:27:48 -0800
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-11-08 15:27:48 -0800
commit181e284b55dd234320b0e4fd5fbc81a5dfa6b580 (patch)
tree9a0bcb181af9ff91eea5be98abd13dd42a5c9e37 /src/google/protobuf/stubs/atomicops.h
parent1144768dd63effc560a3d64996398d149620b575 (diff)
Fix Atomic32/AtomicWord on some platforms.
- Removed the redefination in the atomicword_compat.h. Now Atomic32 will alwyas be intptr_t in 32bit platforms, the bridge is no longer needed. - Change NaCl 64bit to use intptr_t instead of int32 for Atomic32, otherwise AtmoicWord APIs will miss the definations. After this change, the AtmoicWord will always be either Atomic32 or Atmoic64 depending on the platforms.
Diffstat (limited to 'src/google/protobuf/stubs/atomicops.h')
-rw-r--r--src/google/protobuf/stubs/atomicops.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h
index 64c838fb..cb4553b1 100644
--- a/src/google/protobuf/stubs/atomicops.h
+++ b/src/google/protobuf/stubs/atomicops.h
@@ -67,15 +67,16 @@ namespace internal {
typedef intptr_t Atomic32;
typedef int64 Atomic64;
#else
- typedef int32 Atomic32;
// 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(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL)
// NaCl's intptr_t is not actually 64-bits on 64-bit!
// http://code.google.com/p/nativeclient/issues/detail?id=1162
// sparcv9's pointer type is 32bits
+ typedef intptr_t Atomic32;
typedef int64 Atomic64;
#else
+ typedef int32 Atomic32;
typedef intptr_t Atomic64;
#endif
#endif
@@ -229,12 +230,6 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
#error GOOGLE_PROTOBUF_ATOMICOPS_ERROR
#endif
-// On some platforms we need additional declarations to make AtomicWord
-// compatible with our other Atomic* types.
-#if defined(GOOGLE_PROTOBUF_OS_APPLE)
-#include <google/protobuf/stubs/atomicops_internals_atomicword_compat.h>
-#endif
-
#undef GOOGLE_PROTOBUF_ATOMICOPS_ERROR
#endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY