| 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 //    OS_NACL (NACL_SFI or NACL_NONSFI) / OS_NACL_SFI / OS_NACL_NONSFI |    8 //    OS_NACL (NACL_SFI or NACL_NONSFI) / OS_NACL_SFI / OS_NACL_NONSFI | 
|    9 //    OS_CHROMEOS is set by the build system |    9 //    OS_CHROMEOS is set by the build system | 
|   10 //  Compiler: |   10 //  Compiler: | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   42 #elif defined(__linux__) |   42 #elif defined(__linux__) | 
|   43 #define OS_LINUX 1 |   43 #define OS_LINUX 1 | 
|   44 // include a system header to pull in features.h for glibc/uclibc macros. |   44 // include a system header to pull in features.h for glibc/uclibc macros. | 
|   45 #include <unistd.h> |   45 #include <unistd.h> | 
|   46 #if defined(__GLIBC__) && !defined(__UCLIBC__) |   46 #if defined(__GLIBC__) && !defined(__UCLIBC__) | 
|   47 // we really are using glibc, not uClibc pretending to be glibc |   47 // we really are using glibc, not uClibc pretending to be glibc | 
|   48 #define LIBC_GLIBC 1 |   48 #define LIBC_GLIBC 1 | 
|   49 #endif |   49 #endif | 
|   50 #elif defined(_WIN32) |   50 #elif defined(_WIN32) | 
|   51 #define OS_WIN 1 |   51 #define OS_WIN 1 | 
 |   52 #elif defined(__Fuchsia__) | 
 |   53 #define OS_FUCHSIA 1 | 
|   52 #elif defined(__FreeBSD__) |   54 #elif defined(__FreeBSD__) | 
|   53 #define OS_FREEBSD 1 |   55 #define OS_FREEBSD 1 | 
|   54 #elif defined(__NetBSD__) |   56 #elif defined(__NetBSD__) | 
|   55 #define OS_NETBSD 1 |   57 #define OS_NETBSD 1 | 
|   56 #elif defined(__OpenBSD__) |   58 #elif defined(__OpenBSD__) | 
|   57 #define OS_OPENBSD 1 |   59 #define OS_OPENBSD 1 | 
|   58 #elif defined(__sun) |   60 #elif defined(__sun) | 
|   59 #define OS_SOLARIS 1 |   61 #define OS_SOLARIS 1 | 
|   60 #elif defined(__QNXNTO__) |   62 #elif defined(__QNXNTO__) | 
|   61 #define OS_QNX 1 |   63 #define OS_QNX 1 | 
|   62 #elif defined(_AIX) |   64 #elif defined(_AIX) | 
|   63 #define OS_AIX 1 |   65 #define OS_AIX 1 | 
|   64 #else |   66 #else | 
|   65 #error Please add support for your platform in build/build_config.h |   67 #error Please add support for your platform in build/build_config.h | 
|   66 #endif |   68 #endif | 
|   67  |   69  | 
|   68 #if defined(USE_OPENSSL_CERTS) && defined(USE_NSS_CERTS) |   70 #if defined(USE_OPENSSL_CERTS) && defined(USE_NSS_CERTS) | 
|   69 #error Cannot use both OpenSSL and NSS for certificates |   71 #error Cannot use both OpenSSL and NSS for certificates | 
|   70 #endif |   72 #endif | 
|   71  |   73  | 
|   72 // For access to standard BSD features, use OS_BSD instead of a |   74 // For access to standard BSD features, use OS_BSD instead of a | 
|   73 // more specific macro. |   75 // more specific macro. | 
|   74 #if defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD) |   76 #if defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD) | 
|   75 #define OS_BSD 1 |   77 #define OS_BSD 1 | 
|   76 #endif |   78 #endif | 
|   77  |   79  | 
|   78 // For access to standard POSIXish features, use OS_POSIX instead of a |   80 // For access to standard POSIXish features, use OS_POSIX instead of a | 
|   79 // more specific macro. |   81 // more specific macro. | 
|   80 #if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \ |   82 #if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_FREEBSD) ||  \ | 
|   81     defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_NACL) ||   \ |   83     defined(OS_FUCHSIA) || defined(OS_LINUX) || defined(OS_MACOSX) || \ | 
|   82     defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_QNX) ||  \ |   84     defined(OS_NACL) || defined(OS_NETBSD) || defined(OS_OPENBSD) ||  \ | 
|   83     defined(OS_SOLARIS) |   85     defined(OS_QNX) || defined(OS_SOLARIS) | 
|   84 #define OS_POSIX 1 |   86 #define OS_POSIX 1 | 
|   85 #endif |   87 #endif | 
|   86  |   88  | 
|   87 // Use tcmalloc |   89 // Use tcmalloc | 
|   88 #if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \ |   90 #if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \ | 
|   89     !defined(NO_TCMALLOC) |   91     !defined(NO_TCMALLOC) | 
|   90 #define USE_TCMALLOC 1 |   92 #define USE_TCMALLOC 1 | 
|   91 #endif |   93 #endif | 
|   92  |   94  | 
|   93 // Compiler detection. |   95 // Compiler detection. | 
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  158 #define ARCH_CPU_32_BITS 1 |  160 #define ARCH_CPU_32_BITS 1 | 
|  159 #define ARCH_CPU_LITTLE_ENDIAN 1 |  161 #define ARCH_CPU_LITTLE_ENDIAN 1 | 
|  160 #endif |  162 #endif | 
|  161 #else |  163 #else | 
|  162 #error Please add support for your architecture in build/build_config.h |  164 #error Please add support for your architecture in build/build_config.h | 
|  163 #endif |  165 #endif | 
|  164  |  166  | 
|  165 // Type detection for wchar_t. |  167 // Type detection for wchar_t. | 
|  166 #if defined(OS_WIN) |  168 #if defined(OS_WIN) | 
|  167 #define WCHAR_T_IS_UTF16 |  169 #define WCHAR_T_IS_UTF16 | 
|  168 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ |  170 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \ | 
|  169     defined(__WCHAR_MAX__) && \ |  | 
|  170     (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) |  171     (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) | 
|  171 #define WCHAR_T_IS_UTF32 |  172 #define WCHAR_T_IS_UTF32 | 
|  172 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ |  173 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \ | 
|  173     defined(__WCHAR_MAX__) && \ |  | 
|  174     (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) |  174     (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) | 
|  175 // On Posix, we'll detect short wchar_t, but projects aren't guaranteed to |  175 // On Posix, we'll detect short wchar_t, but projects aren't guaranteed to | 
|  176 // compile in this mode (in particular, Chrome doesn't). This is intended for |  176 // compile in this mode (in particular, Chrome doesn't). This is intended for | 
|  177 // other projects using base who manage their own dependencies and make sure |  177 // other projects using base who manage their own dependencies and make sure | 
|  178 // short wchar works for them. |  178 // short wchar works for them. | 
|  179 #define WCHAR_T_IS_UTF16 |  179 #define WCHAR_T_IS_UTF16 | 
|  180 #else |  180 #else | 
|  181 #error Please add support for your compiler in build/build_config.h |  181 #error Please add support for your compiler in build/build_config.h | 
|  182 #endif |  182 #endif | 
|  183  |  183  | 
|  184 #if defined(OS_ANDROID) |  184 #if defined(OS_ANDROID) | 
|  185 // The compiler thinks std::string::const_iterator and "const char*" are |  185 // The compiler thinks std::string::const_iterator and "const char*" are | 
|  186 // equivalent types. |  186 // equivalent types. | 
|  187 #define STD_STRING_ITERATOR_IS_CHAR_POINTER |  187 #define STD_STRING_ITERATOR_IS_CHAR_POINTER | 
|  188 // The compiler thinks base::string16::const_iterator and "char16*" are |  188 // The compiler thinks base::string16::const_iterator and "char16*" are | 
|  189 // equivalent types. |  189 // equivalent types. | 
|  190 #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER |  190 #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER | 
|  191 #endif |  191 #endif | 
|  192  |  192  | 
|  193 #endif  // BUILD_BUILD_CONFIG_H_ |  193 #endif  // BUILD_BUILD_CONFIG_H_ | 
| OLD | NEW |