Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: build/build_config.h

Issue 12944002: Attempt at improved OS macros (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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__) 17 #if defined(__APPLE__)
18 #include <TargetConditionals.h> 18 #include <TargetConditionals.h>
19 #endif 19 #endif
20 20
21 // A set of macros to use for platform detection. 21 // A set of macros to use for platform detection.
22 #if defined(__APPLE__) 22 #if defined(__APPLE__)
23 #define OS_MACOSX 1 23 #define OS_MACOSX 1
24 #define OS_IS_ENABLED__WIN +
Ryan Sleevi 2013/03/19 21:55:13 BUG: s/__WIN/__MAC
24 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE 25 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
25 #define OS_IOS 1 26 #define OS_IOS 1
27 #define OS_IS_ENABLED__IOS +
26 #endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE 28 #endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
27 #elif defined(ANDROID) 29 #elif defined(ANDROID)
28 #define OS_ANDROID 1 30 #define OS_ANDROID 1
31 #define OS_IS_ENABLED__ANDROID +
29 #elif defined(__native_client__) 32 #elif defined(__native_client__)
30 #define OS_NACL 1 33 #define OS_NACL 1
34 #define OS_IS_ENABLED__NACL +
31 #elif defined(__linux__) 35 #elif defined(__linux__)
32 #define OS_LINUX 1 36 #define OS_LINUX 1
37 #define OS_IS_ENABLED__LINUX +
33 // Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined. 38 // Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined.
34 #if !defined(TOOLKIT_VIEWS) 39 #if !defined(TOOLKIT_VIEWS)
35 #define TOOLKIT_GTK 40 #define TOOLKIT_GTK
36 #endif 41 #endif
37 #elif defined(_WIN32) 42 #elif defined(_WIN32)
38 #define OS_WIN 1 43 #define OS_WIN 1
39 #define TOOLKIT_VIEWS 1 44 #define TOOLKIT_VIEWS 1
45 #define OS_IS_ENABLED__WIN +
40 #elif defined(__FreeBSD__) 46 #elif defined(__FreeBSD__)
41 #define OS_FREEBSD 1 47 #define OS_FREEBSD 1
48 #define OS_IS_ENABLED__FREEBSD +
42 #define TOOLKIT_GTK 49 #define TOOLKIT_GTK
43 #elif defined(__OpenBSD__) 50 #elif defined(__OpenBSD__)
44 #define OS_OPENBSD 1 51 #define OS_OPENBSD 1
52 #define OS_IS_ENABLED__OPENBSD +
45 #define TOOLKIT_GTK 53 #define TOOLKIT_GTK
46 #elif defined(__sun) 54 #elif defined(__sun)
47 #define OS_SOLARIS 1 55 #define OS_SOLARIS 1
56 #define OS_IS_ENABLED__SOLARIS +
48 #define TOOLKIT_GTK 57 #define TOOLKIT_GTK
49 #else 58 #else
50 #error Please add support for your platform in build/build_config.h 59 #error Please add support for your platform in build/build_config.h
51 #endif 60 #endif
52 61
62 #define OS(x) ((1 OS_IS_ENABLED__##x 1) == 2)
63
53 #if defined(USE_OPENSSL) && defined(USE_NSS) 64 #if defined(USE_OPENSSL) && defined(USE_NSS)
54 #error Cannot use both OpenSSL and NSS 65 #error Cannot use both OpenSSL and NSS
55 #endif 66 #endif
56 67
57 // For access to standard BSD features, use OS_BSD instead of a 68 // For access to standard BSD features, use OS_BSD instead of a
58 // more specific macro. 69 // more specific macro.
59 #if defined(OS_FREEBSD) || defined(OS_OPENBSD) 70 #if defined(OS_FREEBSD) || defined(OS_OPENBSD)
60 #define OS_BSD 1 71 #define OS_BSD 1
61 #endif 72 #endif
62 73
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 #if defined(OS_ANDROID) 156 #if defined(OS_ANDROID)
146 // The compiler thinks std::string::const_iterator and "const char*" are 157 // The compiler thinks std::string::const_iterator and "const char*" are
147 // equivalent types. 158 // equivalent types.
148 #define STD_STRING_ITERATOR_IS_CHAR_POINTER 159 #define STD_STRING_ITERATOR_IS_CHAR_POINTER
149 // The compiler thinks base::string16::const_iterator and "char16*" are 160 // The compiler thinks base::string16::const_iterator and "char16*" are
150 // equivalent types. 161 // equivalent types.
151 #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER 162 #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
152 #endif 163 #endif
153 164
154 #endif // BUILD_BUILD_CONFIG_H_ 165 #endif // BUILD_BUILD_CONFIG_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698