diff options
author | William Orr <will@worrbase.com> | 2014-09-19 22:04:23 -0700 |
---|---|---|
committer | William Orr <will@worrbase.com> | 2014-09-19 22:04:23 -0700 |
commit | 2d7786cfc3aa8f38326f97fe43b2efc092aacf6f (patch) | |
tree | ac216cddf3fb619774474ac5259e7c4071642e62 /src/google/protobuf/stubs/atomicops.h | |
parent | 7d50120316b62499d1ec64580acc8ff32fceb147 (diff) |
Add support for solaris atomicops
This patch adds support for atomic operations on Solaris, on any platform.
It makes use of the atomic functions made available in Solaris' atomic.h
header.
Diffstat (limited to 'src/google/protobuf/stubs/atomicops.h')
-rw-r--r-- | src/google/protobuf/stubs/atomicops.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h index 17b7be7f..b00f6db5 100644 --- a/src/google/protobuf/stubs/atomicops.h +++ b/src/google/protobuf/stubs/atomicops.h @@ -66,9 +66,10 @@ typedef int32 Atomic32; #ifdef GOOGLE_PROTOBUF_ARCH_64_BIT // 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) +#if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL) || defined(GOOGLE_PROTOBUF_ARCH_SPARC) // 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 int64 Atomic64; #else typedef intptr_t Atomic64; @@ -174,6 +175,10 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); GOOGLE_PROTOBUF_ATOMICOPS_ERROR #endif +// Solaris +#elif defined(GOOGLE_PROTOBUF_OS_SOLARIS) +#include <google/protobuf/stubs/atomicops_internals_solaris.h> + // Apple. #elif defined(GOOGLE_PROTOBUF_OS_APPLE) #include <google/protobuf/stubs/atomicops_internals_macosx.h> |