diff --git a/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h b/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h index 8d9a726c2..e9d86797b 100644 --- a/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h +++ b/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h @@ -44,7 +44,7 @@ // On LP64 platforms, AtomicWord and Atomic64 are both always long, // so this problem doesn't occur. -#if !defined(GOOGLE_PROTOBUF_HOST_ARCH_64_BIT) +#if !defined(GOOGLE_PROTOBUF_ARCH_64_BIT) namespace google { namespace protobuf { @@ -117,6 +117,6 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) { } // namespace protobuf } // namespace google -#endif // !defined(GOOGLE_PROTOBUF_HOST_ARCH_64_BIT) +#endif // !defined(GOOGLE_PROTOBUF_ARCH_64_BIT) #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ diff --git a/src/google/protobuf/stubs/atomicops_internals_macosx.h b/src/google/protobuf/stubs/atomicops_internals_macosx.h index 9af6d636d..f9b7581ad 100644 --- a/src/google/protobuf/stubs/atomicops_internals_macosx.h +++ b/src/google/protobuf/stubs/atomicops_internals_macosx.h @@ -136,7 +136,7 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, Atomic64 prev_value; do { if (OSAtomicCompareAndSwap64(old_value, new_value, - const_cast(ptr))) { + reinterpret_cast(ptr))) { return old_value; } prev_value = *ptr; @@ -150,18 +150,19 @@ inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, do { old_value = *ptr; } while (!OSAtomicCompareAndSwap64(old_value, new_value, - const_cast(ptr))); + reinterpret_cast(ptr))); return old_value; } inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { - return OSAtomicAdd64(increment, const_cast(ptr)); + return OSAtomicAdd64(increment, reinterpret_cast(ptr)); } inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { - return OSAtomicAdd64Barrier(increment, const_cast(ptr)); + return OSAtomicAdd64Barrier(increment, + reinterpret_cast(ptr)); } inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, @@ -169,8 +170,8 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, Atomic64 new_value) { Atomic64 prev_value; do { - if (OSAtomicCompareAndSwap64Barrier(old_value, new_value, - const_cast(ptr))) { + if (OSAtomicCompareAndSwap64Barrier( + old_value, new_value, reinterpret_cast(ptr))) { return old_value; } prev_value = *ptr;