OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // These helpers allow to avoid the use of an #ifdef when the code can | 5 // These helpers allow to avoid the use of an #ifdef when the code can |
6 // compile without them. Thanks to compiler optimizations, the final generated | 6 // compile without them. Thanks to compiler optimizations, the final generated |
7 // binary should look the same when using these. | 7 // binary should look the same when using these. |
8 | 8 |
9 #ifndef BUILD_BUILD_CONFIG_FUNCTIONS_H_ | 9 #ifndef SANDBOX_LINUX_SERVICES_BUILD_CONFIG_FUNCTIONS_H_ |
10 #define BUILD_BUILD_CONFIG_FUNCTIONS_H_ | 10 #define SANDBOX_LINUX_SERVICES_BUILD_CONFIG_FUNCTIONS_H_ |
11 | 11 |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 | 13 |
14 namespace build { | 14 namespace sandbox { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 inline bool IsASANBuild() { | 18 inline bool IsASANBuild() { |
19 #if defined(ADDRESS_SANITIZER) | 19 #if defined(ADDRESS_SANITIZER) |
20 return true; | 20 return true; |
21 #else | 21 #else |
22 return false; | 22 return false; |
23 #endif | 23 #endif |
24 } | 24 } |
(...skipping 15 matching lines...) Expand all Loading... | |
40 } | 40 } |
41 | 41 |
42 inline bool IsAndroid() { | 42 inline bool IsAndroid() { |
43 #if defined(OS_ANDROID) | 43 #if defined(OS_ANDROID) |
44 return true; | 44 return true; |
45 #else | 45 #else |
46 return false; | 46 return false; |
47 #endif | 47 #endif |
48 } | 48 } |
49 | 49 |
50 inline bool IsPOSIX() { | |
jww
2013/12/06 01:56:59
I assume you purposefully got rid of these functio
| |
51 #if defined(OS_POSIX) | |
52 return true; | |
53 #else | |
54 return false; | |
55 #endif | |
56 } | |
57 | |
58 inline bool IsWindows() { | |
59 #if defined(OS_WIN) | |
60 return true; | |
61 #else | |
62 return false; | |
63 #endif | |
64 } | |
65 | |
66 inline bool IsMac() { | |
67 #if defined(OS_MACOSX) | |
68 return true; | |
69 #else | |
70 return false; | |
71 #endif | |
72 } | |
73 | |
74 inline bool IsArchitectureX86_64() { | 50 inline bool IsArchitectureX86_64() { |
75 #if defined(ARCH_CPU_X86_64) | 51 #if defined(ARCH_CPU_X86_64) |
76 return true; | 52 return true; |
77 #else | 53 #else |
78 return false; | 54 return false; |
79 #endif | 55 #endif |
80 } | 56 } |
81 | 57 |
82 inline bool IsArchitectureI386() { | 58 inline bool IsArchitectureI386() { |
83 #if defined(ARCH_CPU_X86) | 59 #if defined(ARCH_CPU_X86) |
(...skipping 14 matching lines...) Expand all Loading... | |
98 inline bool IsUsingToolKitGtk() { | 74 inline bool IsUsingToolKitGtk() { |
99 #if defined(TOOLKIT_GTK) | 75 #if defined(TOOLKIT_GTK) |
100 return true; | 76 return true; |
101 #else | 77 #else |
102 return false; | 78 return false; |
103 #endif | 79 #endif |
104 } | 80 } |
105 | 81 |
106 } // namespace. | 82 } // namespace. |
107 | 83 |
108 } // namespace build. | 84 } // namespace sandbox. |
109 | 85 |
110 #endif // BUILD_BUILD_CONFIG_FUNCTIONS_H_ | 86 #endif // SANDBOX_LINUX_SERVICES_BUILD_CONFIG_FUNCTIONS_H_ |
OLD | NEW |