| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2012 Google Inc. All rights reserved. | 2 // Copyright 2012 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 typedef intptr_t Atomic64; | 69 typedef intptr_t Atomic64; |
| 70 #else | 70 #else |
| 71 typedef intptr_t Atomic32; | 71 typedef intptr_t Atomic32; |
| 72 typedef int64 Atomic64; | 72 typedef int64 Atomic64; |
| 73 #endif | 73 #endif |
| 74 #else | 74 #else |
| 75 typedef int32 Atomic32; | 75 typedef int32 Atomic32; |
| 76 #ifdef GOOGLE_PROTOBUF_ARCH_64_BIT | 76 #ifdef GOOGLE_PROTOBUF_ARCH_64_BIT |
| 77 // We need to be able to go between Atomic64 and AtomicWord implicitly. This | 77 // We need to be able to go between Atomic64 and AtomicWord implicitly. This |
| 78 // means Atomic64 and AtomicWord should be the same type on 64-bit. | 78 // means Atomic64 and AtomicWord should be the same type on 64-bit. |
| 79 #if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL) || defined(GOOGLE_PRO
TOBUF_ARCH_SPARC) | 79 #if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL) |
| 80 // NaCl's intptr_t is not actually 64-bits on 64-bit! | 80 // NaCl's intptr_t is not actually 64-bits on 64-bit! |
| 81 // http://code.google.com/p/nativeclient/issues/detail?id=1162 | 81 // http://code.google.com/p/nativeclient/issues/detail?id=1162 |
| 82 // sparcv9's pointer type is 32bits | 82 // sparcv9's pointer type is 32bits |
| 83 typedef int64 Atomic64; | 83 typedef int64 Atomic64; |
| 84 #else | 84 #else |
| 85 typedef intptr_t Atomic64; | 85 typedef intptr_t Atomic64; |
| 86 #endif | 86 #endif |
| 87 #endif | 87 #endif |
| 88 #endif | 88 #endif |
| 89 | 89 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 #elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64) | 207 #elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64) |
| 208 #include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h> | 208 #include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h> |
| 209 #elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX) | 209 #elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX) |
| 210 #include <google/protobuf/stubs/atomicops_internals_arm_qnx.h> | 210 #include <google/protobuf/stubs/atomicops_internals_arm_qnx.h> |
| 211 #elif defined(GOOGLE_PROTOBUF_ARCH_MIPS) || defined(GOOGLE_PROTOBUF_ARCH_MIPS64) | 211 #elif defined(GOOGLE_PROTOBUF_ARCH_MIPS) || defined(GOOGLE_PROTOBUF_ARCH_MIPS64) |
| 212 #include <google/protobuf/stubs/atomicops_internals_mips_gcc.h> | 212 #include <google/protobuf/stubs/atomicops_internals_mips_gcc.h> |
| 213 #elif defined(GOOGLE_PROTOBUF_ARCH_POWER) | 213 #elif defined(GOOGLE_PROTOBUF_ARCH_POWER) |
| 214 #include <google/protobuf/stubs/atomicops_internals_power.h> | 214 #include <google/protobuf/stubs/atomicops_internals_power.h> |
| 215 #elif defined(__native_client__) | 215 #elif defined(__native_client__) |
| 216 #include <google/protobuf/stubs/atomicops_internals_pnacl.h> | 216 #include <google/protobuf/stubs/atomicops_internals_pnacl.h> |
| 217 #elif defined(GOOGLE_PROTOBUF_ARCH_PPC) |
| 218 #include <google/protobuf/stubs/atomicops_internals_ppc_gcc.h> |
| 217 #elif (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)) | 219 #elif (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)) |
| 218 #include <google/protobuf/stubs/atomicops_internals_generic_gcc.h> | 220 #include <google/protobuf/stubs/atomicops_internals_generic_gcc.h> |
| 219 #elif defined(__clang__) | 221 #elif defined(__clang__) |
| 220 #if __has_extension(c_atomic) | 222 #if __has_extension(c_atomic) |
| 221 #include <google/protobuf/stubs/atomicops_internals_generic_gcc.h> | 223 #include <google/protobuf/stubs/atomicops_internals_generic_gcc.h> |
| 222 #else | 224 #else |
| 223 #error GOOGLE_PROTOBUF_ATOMICOPS_ERROR | 225 #error GOOGLE_PROTOBUF_ATOMICOPS_ERROR |
| 224 #endif | 226 #endif |
| 225 #else | 227 #else |
| 226 #error GOOGLE_PROTOBUF_ATOMICOPS_ERROR | 228 #error GOOGLE_PROTOBUF_ATOMICOPS_ERROR |
| 227 #endif | 229 #endif |
| 228 | 230 |
| 229 // Unknown. | 231 // Unknown. |
| 230 #else | 232 #else |
| 231 #error GOOGLE_PROTOBUF_ATOMICOPS_ERROR | 233 #error GOOGLE_PROTOBUF_ATOMICOPS_ERROR |
| 232 #endif | 234 #endif |
| 233 | 235 |
| 234 // On some platforms we need additional declarations to make AtomicWord | 236 // On some platforms we need additional declarations to make AtomicWord |
| 235 // compatible with our other Atomic* types. | 237 // compatible with our other Atomic* types. |
| 236 #if defined(GOOGLE_PROTOBUF_OS_APPLE) | 238 #if defined(GOOGLE_PROTOBUF_OS_APPLE) |
| 237 #include <google/protobuf/stubs/atomicops_internals_atomicword_compat.h> | 239 #include <google/protobuf/stubs/atomicops_internals_atomicword_compat.h> |
| 238 #endif | 240 #endif |
| 239 | 241 |
| 240 #undef GOOGLE_PROTOBUF_ATOMICOPS_ERROR | 242 #undef GOOGLE_PROTOBUF_ATOMICOPS_ERROR |
| 241 | 243 |
| 242 #endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY | 244 #endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY |
| 243 | 245 |
| 244 #endif // GOOGLE_PROTOBUF_ATOMICOPS_H_ | 246 #endif // GOOGLE_PROTOBUF_ATOMICOPS_H_ |
| OLD | NEW |