31 #ifndef GOOGLE_PROTOBUF_PLATFORM_MACROS_H_
32 #define GOOGLE_PROTOBUF_PLATFORM_MACROS_H_
36 #define GOOGLE_PROTOBUF_PLATFORM_ERROR \
37 #error "Host platform was not detected as supported by protobuf"
43 #if defined(_M_X64) || defined(__x86_64__)
44 #define GOOGLE_PROTOBUF_ARCH_X64 1
45 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
46 #elif defined(_M_IX86) || defined(__i386__)
47 #define GOOGLE_PROTOBUF_ARCH_IA32 1
48 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
49 #elif defined(__QNX__)
50 #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1
51 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
52 #elif defined(__ARMEL__)
53 #define GOOGLE_PROTOBUF_ARCH_ARM 1
54 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
55 #elif defined(__aarch64__)
56 #define GOOGLE_PROTOBUF_ARCH_AARCH64 1
57 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
58 #elif defined(__MIPSEL__)
60 #define GOOGLE_PROTOBUF_ARCH_MIPS64 1
61 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
63 #define GOOGLE_PROTOBUF_ARCH_MIPS 1
64 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
66 #elif defined(__pnacl__)
67 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
69 #define GOOGLE_PROTOBUF_ARCH_SPARC 1
70 #ifdef SOLARIS_64BIT_ENABLED
71 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
73 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
75 #elif defined(__GNUC__)
76 # if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
78 # elif defined(__clang__)
79 # if !__has_extension(c_atomic)
85 # define GOOGLE_PROTOBUF_ARCH_64_BIT 1
87 # define GOOGLE_PROTOBUF_ARCH_32_BIT 1
93 #if defined(__APPLE__)
94 #define GOOGLE_PROTOBUF_OS_APPLE
95 #elif defined(__native_client__)
96 #define GOOGLE_PROTOBUF_OS_NACL
98 #define GOOGLE_PROTOBUF_OS_SOLARIS
101 #undef GOOGLE_PROTOBUF_PLATFORM_ERROR
103 #endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_