Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:12:04

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2012 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef GOOGLE_PROTOBUF_PLATFORM_MACROS_H_
0009 #define GOOGLE_PROTOBUF_PLATFORM_MACROS_H_
0010 
0011 #define GOOGLE_PROTOBUF_PLATFORM_ERROR \
0012 #error "Host platform was not detected as supported by protobuf"
0013 
0014 // Processor architecture detection.  For more info on what's defined, see:
0015 //   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
0016 //   http://www.agner.org/optimize/calling_conventions.pdf
0017 //   or with gcc, run: "echo | gcc -E -dM -"
0018 #if defined(_M_X64) || defined(__x86_64__)
0019 #define GOOGLE_PROTOBUF_ARCH_X64 1
0020 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0021 #elif defined(_M_IX86) || defined(__i386__)
0022 #define GOOGLE_PROTOBUF_ARCH_IA32 1
0023 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0024 #elif defined(__QNX__)
0025 #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1
0026 #if defined(__aarch64__)
0027 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0028 #else
0029 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0030 #endif
0031 #elif defined(_M_ARM) || defined(__ARMEL__)
0032 #define GOOGLE_PROTOBUF_ARCH_ARM 1
0033 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0034 #elif defined(_M_ARM64)
0035 #define GOOGLE_PROTOBUF_ARCH_ARM 1
0036 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0037 #elif defined(__aarch64__)
0038 #define GOOGLE_PROTOBUF_ARCH_AARCH64 1
0039 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0040 #elif defined(__mips__)
0041 #if defined(__LP64__)
0042 #define GOOGLE_PROTOBUF_ARCH_MIPS64 1
0043 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0044 #else
0045 #define GOOGLE_PROTOBUF_ARCH_MIPS 1
0046 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0047 #endif
0048 #elif defined(__pnacl__)
0049 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0050 #elif defined(sparc)
0051 #define GOOGLE_PROTOBUF_ARCH_SPARC 1
0052 #if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
0053 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0054 #else
0055 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0056 #endif
0057 #elif defined(_POWER) || defined(__powerpc64__) || defined(__PPC64__)
0058 #define GOOGLE_PROTOBUF_ARCH_POWER 1
0059 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0060 #elif defined(__PPC__)
0061 #define GOOGLE_PROTOBUF_ARCH_PPC 1
0062 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0063 #elif defined(__GNUC__)
0064 # if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
0065 // We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h
0066 # elif defined(__clang__)
0067 #  if !__has_extension(c_atomic)
0068 GOOGLE_PROTOBUF_PLATFORM_ERROR
0069 #  endif
0070 // We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h
0071 # endif
0072 # if __LP64__
0073 #  define GOOGLE_PROTOBUF_ARCH_64_BIT 1
0074 # else
0075 #  define GOOGLE_PROTOBUF_ARCH_32_BIT 1
0076 # endif
0077 #else
0078 GOOGLE_PROTOBUF_PLATFORM_ERROR
0079 #endif
0080 
0081 #if defined(__APPLE__)
0082 #define GOOGLE_PROTOBUF_OS_APPLE
0083 #include <Availability.h>
0084 #include <TargetConditionals.h>
0085 #if TARGET_OS_IPHONE
0086 #define GOOGLE_PROTOBUF_OS_IPHONE
0087 #endif
0088 #elif defined(__EMSCRIPTEN__)
0089 #define GOOGLE_PROTOBUF_OS_EMSCRIPTEN
0090 #elif defined(__native_client__)
0091 #define GOOGLE_PROTOBUF_OS_NACL
0092 #elif defined(sun)
0093 #define GOOGLE_PROTOBUF_OS_SOLARIS
0094 #elif defined(_AIX)
0095 #define GOOGLE_PROTOBUF_OS_AIX
0096 #elif defined(__ANDROID__)
0097 #define GOOGLE_PROTOBUF_OS_ANDROID
0098 #endif
0099 
0100 #undef GOOGLE_PROTOBUF_PLATFORM_ERROR
0101 
0102 #if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE)
0103 // Android ndk does not support the __thread keyword very well yet. Here
0104 // we use pthread_key_create()/pthread_getspecific()/... methods for
0105 // TLS support on android.
0106 // iOS also does not support the __thread keyword.
0107 #define GOOGLE_PROTOBUF_NO_THREADLOCAL
0108 #endif
0109 
0110 #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
0111 // __thread keyword requires at least 10.7
0112 #define GOOGLE_PROTOBUF_NO_THREADLOCAL
0113 #endif
0114 
0115 #endif  // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_