| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file adds defines about the platform we're currently building on. | 5 // This file adds defines about the platform we're currently building on. |
| 6 // Operating System: | 6 // Operating System: |
| 7 // OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) | 7 // OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) |
| 8 // Compiler: | 8 // Compiler: |
| 9 // COMPILER_MSVC / COMPILER_GCC | 9 // COMPILER_MSVC / COMPILER_GCC |
| 10 // Processor: | 10 // Processor: |
| 11 // ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64) | 11 // ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64) |
| 12 // ARCH_CPU_32_BITS / ARCH_CPU_64_BITS | 12 // ARCH_CPU_32_BITS / ARCH_CPU_64_BITS |
| 13 | 13 |
| 14 #ifndef BUILD_BUILD_CONFIG_H_ | 14 #ifndef BUILD_BUILD_CONFIG_H_ |
| 15 #define BUILD_BUILD_CONFIG_H_ | 15 #define BUILD_BUILD_CONFIG_H_ |
| 16 | 16 |
| 17 #if defined(__APPLE__) |
| 18 #include <TargetConditionals.h> |
| 19 #endif |
| 20 |
| 17 // A set of macros to use for platform detection. | 21 // A set of macros to use for platform detection. |
| 18 #if defined(__APPLE__) | 22 #if defined(__APPLE__) |
| 19 #define OS_MACOSX 1 | 23 #define OS_MACOSX 1 |
| 24 #if defined(TARGET_OS_IPHONE) |
| 25 #define OS_IOS 1 |
| 26 #endif // defined(TARGET_OS_IPHONE) |
| 20 #elif defined(ANDROID) | 27 #elif defined(ANDROID) |
| 21 #define OS_ANDROID 1 | 28 #define OS_ANDROID 1 |
| 22 #elif defined(__native_client__) | 29 #elif defined(__native_client__) |
| 23 #define OS_NACL 1 | 30 #define OS_NACL 1 |
| 24 #elif defined(__linux__) | 31 #elif defined(__linux__) |
| 25 #define OS_LINUX 1 | 32 #define OS_LINUX 1 |
| 26 // Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined. | 33 // Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined. |
| 27 #if !defined(TOOLKIT_VIEWS) | 34 #if !defined(TOOLKIT_VIEWS) |
| 28 #define TOOLKIT_GTK | 35 #define TOOLKIT_GTK |
| 29 #endif | 36 #endif |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #elif defined(_M_IX86) || defined(__i386__) | 99 #elif defined(_M_IX86) || defined(__i386__) |
| 93 #define ARCH_CPU_X86_FAMILY 1 | 100 #define ARCH_CPU_X86_FAMILY 1 |
| 94 #define ARCH_CPU_X86 1 | 101 #define ARCH_CPU_X86 1 |
| 95 #define ARCH_CPU_32_BITS 1 | 102 #define ARCH_CPU_32_BITS 1 |
| 96 #define ARCH_CPU_LITTLE_ENDIAN 1 | 103 #define ARCH_CPU_LITTLE_ENDIAN 1 |
| 97 #elif defined(__ARMEL__) | 104 #elif defined(__ARMEL__) |
| 98 #define ARCH_CPU_ARM_FAMILY 1 | 105 #define ARCH_CPU_ARM_FAMILY 1 |
| 99 #define ARCH_CPU_ARMEL 1 | 106 #define ARCH_CPU_ARMEL 1 |
| 100 #define ARCH_CPU_32_BITS 1 | 107 #define ARCH_CPU_32_BITS 1 |
| 101 #define ARCH_CPU_LITTLE_ENDIAN 1 | 108 #define ARCH_CPU_LITTLE_ENDIAN 1 |
| 102 #define WCHAR_T_IS_UNSIGNED 1 | |
| 103 #elif defined(__pnacl__) | 109 #elif defined(__pnacl__) |
| 104 #define ARCH_CPU_32_BITS 1 | 110 #define ARCH_CPU_32_BITS 1 |
| 105 #elif defined(__MIPSEL__) | 111 #elif defined(__MIPSEL__) |
| 106 #define ARCH_CPU_MIPS_FAMILY 1 | 112 #define ARCH_CPU_MIPS_FAMILY 1 |
| 107 #define ARCH_CPU_MIPSEL 1 | 113 #define ARCH_CPU_MIPSEL 1 |
| 108 #define ARCH_CPU_32_BITS 1 | 114 #define ARCH_CPU_32_BITS 1 |
| 109 #define ARCH_CPU_LITTLE_ENDIAN 1 | 115 #define ARCH_CPU_LITTLE_ENDIAN 1 |
| 110 #define WCHAR_T_IS_UNSIGNED 0 | |
| 111 #else | 116 #else |
| 112 #error Please add support for your architecture in build/build_config.h | 117 #error Please add support for your architecture in build/build_config.h |
| 113 #endif | 118 #endif |
| 114 | 119 |
| 115 // Type detection for wchar_t. | 120 // Type detection for wchar_t. |
| 116 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
| 117 #define WCHAR_T_IS_UTF16 | 122 #define WCHAR_T_IS_UTF16 |
| 118 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ | 123 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ |
| 119 defined(__WCHAR_MAX__) && \ | 124 defined(__WCHAR_MAX__) && \ |
| 120 (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) | 125 (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) |
| 121 #define WCHAR_T_IS_UTF32 | 126 #define WCHAR_T_IS_UTF32 |
| 122 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ | 127 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ |
| 123 defined(__WCHAR_MAX__) && \ | 128 defined(__WCHAR_MAX__) && \ |
| 124 (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) | 129 (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) |
| 125 // On Posix, we'll detect short wchar_t, but projects aren't guaranteed to | 130 // On Posix, we'll detect short wchar_t, but projects aren't guaranteed to |
| 126 // compile in this mode (in particular, Chrome doesn't). This is intended for | 131 // compile in this mode (in particular, Chrome doesn't). This is intended for |
| 127 // other projects using base who manage their own dependencies and make sure | 132 // other projects using base who manage their own dependencies and make sure |
| 128 // short wchar works for them. | 133 // short wchar works for them. |
| 129 #define WCHAR_T_IS_UTF16 | 134 #define WCHAR_T_IS_UTF16 |
| 130 #else | 135 #else |
| 131 #error Please add support for your compiler in build/build_config.h | 136 #error Please add support for your compiler in build/build_config.h |
| 132 #endif | 137 #endif |
| 133 | 138 |
| 139 #if defined(__ARMEL__) && !defined(OS_IOS) |
| 140 #define WCHAR_T_IS_UNSIGNED 1 |
| 141 #elif defined(__MIPSEL__) |
| 142 #define WCHAR_T_IS_UNSIGNED 0 |
| 143 #endif |
| 144 |
| 134 #if defined(OS_CHROMEOS) | 145 #if defined(OS_CHROMEOS) |
| 135 // Single define to trigger whether CrOS fonts have BCI on. | 146 // Single define to trigger whether CrOS fonts have BCI on. |
| 136 // In that case font sizes/deltas should be adjusted. | 147 // In that case font sizes/deltas should be adjusted. |
| 137 //define CROS_FONTS_USING_BCI | 148 //define CROS_FONTS_USING_BCI |
| 138 #endif | 149 #endif |
| 139 | 150 |
| 140 #if defined(OS_ANDROID) | 151 #if defined(OS_ANDROID) |
| 141 // The compiler thinks std::string::const_iterator and "const char*" are | 152 // The compiler thinks std::string::const_iterator and "const char*" are |
| 142 // equivalent types. | 153 // equivalent types. |
| 143 #define STD_STRING_ITERATOR_IS_CHAR_POINTER | 154 #define STD_STRING_ITERATOR_IS_CHAR_POINTER |
| 144 // The compiler thinks base::string16::const_iterator and "char16*" are | 155 // The compiler thinks base::string16::const_iterator and "char16*" are |
| 145 // equivalent types. | 156 // equivalent types. |
| 146 #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER | 157 #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER |
| 147 #endif | 158 #endif |
| 148 | 159 |
| 149 #endif // BUILD_BUILD_CONFIG_H_ | 160 #endif // BUILD_BUILD_CONFIG_H_ |
| OLD | NEW |