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 #ifndef BASE_COMPILER_SPECIFIC_H_ | 5 #ifndef BASE_COMPILER_SPECIFIC_H_ |
6 #define BASE_COMPILER_SPECIFIC_H_ | 6 #define BASE_COMPILER_SPECIFIC_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(COMPILER_MSVC) | 10 #if defined(COMPILER_MSVC) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // Macro for hinting that an expression is likely to be false. | 181 // Macro for hinting that an expression is likely to be false. |
182 #if !defined(UNLIKELY) | 182 #if !defined(UNLIKELY) |
183 #if defined(COMPILER_GCC) | 183 #if defined(COMPILER_GCC) |
184 #define UNLIKELY(x) __builtin_expect(!!(x), 0) | 184 #define UNLIKELY(x) __builtin_expect(!!(x), 0) |
185 #else | 185 #else |
186 #define UNLIKELY(x) (x) | 186 #define UNLIKELY(x) (x) |
187 #endif // defined(COMPILER_GCC) | 187 #endif // defined(COMPILER_GCC) |
188 #endif // !defined(UNLIKELY) | 188 #endif // !defined(UNLIKELY) |
189 | 189 |
190 // Compiler feature-detection. | 190 // Compiler feature-detection. |
191 // http://clang.llvm.org/docs/LanguageExtensions.html | 191 // clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension |
192 #if !defined(__has_feature) | 192 #if defined(__has_feature) |
193 #define __has_feature(FEATURE) 0 | 193 #define HAS_FEATURE(FEATURE) __has_feature(FEATURE) |
| 194 #else |
| 195 #define HAS_FEATURE(FEATURE) 0 |
194 #endif | 196 #endif |
195 | 197 |
196 #endif // BASE_COMPILER_SPECIFIC_H_ | 198 #endif // BASE_COMPILER_SPECIFIC_H_ |
OLD | NEW |