| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file adds defines about the platform we're currently building on. | |
| 6 // Operating System: | |
| 7 // OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) | |
| 8 // Compiler: | |
| 9 // COMPILER_MSVC / COMPILER_GCC | |
| 10 // Processor: | |
| 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 | |
| 13 | |
| 14 #ifndef BUILD_BUILD_CONFIG_H_ | |
| 15 #define BUILD_BUILD_CONFIG_H_ | |
| 16 | |
| 17 // A set of macros to use for platform detection. | |
| 18 #if defined(__APPLE__) | |
| 19 #define OS_MACOSX 1 | |
| 20 #elif defined(__linux__) | |
| 21 #define OS_LINUX 1 | |
| 22 #elif defined(_WIN32) | |
| 23 #define OS_WIN 1 | |
| 24 #else | |
| 25 #error Please add support for your platform in build/build_config.h | |
| 26 #endif | |
| 27 | |
| 28 // For access to standard POSIX features, use OS_POSIX instead of a more | |
| 29 // specific macro. | |
| 30 #if defined(OS_MACOSX) || defined(OS_LINUX) | |
| 31 #define OS_POSIX 1 | |
| 32 #endif | |
| 33 | |
| 34 // Compiler detection. | |
| 35 #if defined(__GNUC__) | |
| 36 #define COMPILER_GCC 1 | |
| 37 #elif defined(_MSC_VER) | |
| 38 #define COMPILER_MSVC 1 | |
| 39 #else | |
| 40 #error Please add support for your compiler in build/build_config.h | |
| 41 #endif | |
| 42 | |
| 43 // Processor architecture detection. For more info on what's defined, see: | |
| 44 // http://msdn.microsoft.com/en-us/library/b0084kay.aspx | |
| 45 // http://www.agner.org/optimize/calling_conventions.pdf | |
| 46 #if defined(_M_X64) || defined(__x86_64__) | |
| 47 #define ARCH_CPU_X86_FAMILY 1 | |
| 48 #define ARCH_CPU_X86_64 1 | |
| 49 #define ARCH_CPU_64_BITS 1 | |
| 50 #elif defined(_M_IX86) || defined(__i386__) | |
| 51 #define ARCH_CPU_X86_FAMILY 1 | |
| 52 #define ARCH_CPU_X86 1 | |
| 53 #define ARCH_CPU_32_BITS 1 | |
| 54 #else | |
| 55 #error Please add support for your architecture in build/build_config.h | |
| 56 #endif | |
| 57 | |
| 58 // Type detection for wchar_t. | |
| 59 #if defined(OS_WIN) | |
| 60 #define WCHAR_T_IS_UTF16 | |
| 61 #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ | |
| 62 defined(__WCHAR_MAX__) && __WCHAR_MAX__ == 0x7fffffff | |
| 63 #define WCHAR_T_IS_UTF32 | |
| 64 #else | |
| 65 #error Please add support for your compiler in build/build_config.h | |
| 66 #endif | |
| 67 | |
| 68 #endif // BUILD_BUILD_CONFIG_H_ | |
| OLD | NEW |