OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project 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 V8CONFIG_H_ | 5 #ifndef V8CONFIG_H_ |
6 #define V8CONFIG_H_ | 6 #define V8CONFIG_H_ |
7 | 7 |
8 // clang-format off | 8 // clang-format off |
9 | 9 |
10 // Platform headers for feature detection below. | 10 // Platform headers for feature detection below. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 (__has_attribute(warn_unused_result)) | 220 (__has_attribute(warn_unused_result)) |
221 | 221 |
222 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz)) | 222 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz)) |
223 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) | 223 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) |
224 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) | 224 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) |
225 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) | 225 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) |
226 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) | 226 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) |
227 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) | 227 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) |
228 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) | 228 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) |
229 # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) | 229 # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) |
| 230 # define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16)) |
| 231 # define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32)) |
| 232 # define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64)) |
230 | 233 |
231 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) | 234 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) |
232 | 235 |
233 #elif defined(__GNUC__) | 236 #elif defined(__GNUC__) |
234 | 237 |
235 # define V8_CC_GNU 1 | 238 # define V8_CC_GNU 1 |
236 # if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0 | 239 # if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0 |
237 # define V8_CC_INTEL 1 | 240 # define V8_CC_INTEL 1 |
238 # endif | 241 # endif |
239 # if defined(__MINGW32__) | 242 # if defined(__MINGW32__) |
(...skipping 18 matching lines...) Expand all Loading... |
258 # define V8_HAS_ATTRIBUTE_UNUSED (V8_GNUC_PREREQ(2, 95, 0)) | 261 # define V8_HAS_ATTRIBUTE_UNUSED (V8_GNUC_PREREQ(2, 95, 0)) |
259 # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) | 262 # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) |
260 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ | 263 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ |
261 (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) | 264 (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) |
262 | 265 |
263 # define V8_HAS_BUILTIN_CLZ (V8_GNUC_PREREQ(3, 4, 0)) | 266 # define V8_HAS_BUILTIN_CLZ (V8_GNUC_PREREQ(3, 4, 0)) |
264 # define V8_HAS_BUILTIN_CTZ (V8_GNUC_PREREQ(3, 4, 0)) | 267 # define V8_HAS_BUILTIN_CTZ (V8_GNUC_PREREQ(3, 4, 0)) |
265 # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) | 268 # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) |
266 # define V8_HAS_BUILTIN_FRAME_ADDRESS (V8_GNUC_PREREQ(2, 96, 0)) | 269 # define V8_HAS_BUILTIN_FRAME_ADDRESS (V8_GNUC_PREREQ(2, 96, 0)) |
267 # define V8_HAS_BUILTIN_POPCOUNT (V8_GNUC_PREREQ(3, 4, 0)) | 270 # define V8_HAS_BUILTIN_POPCOUNT (V8_GNUC_PREREQ(3, 4, 0)) |
| 271 # define V8_HAS_BUILTIN_BSWAP16 (V8_GNUC_PREREQ(4, 8, 0)) |
| 272 # define V8_HAS_BUILTIN_BSWAP32 (V8_GNUC_PREREQ(4, 8, 0)) |
| 273 # define V8_HAS_BUILTIN_BSWAP64 (V8_GNUC_PREREQ(4, 8, 0)) |
268 | 274 |
269 # if __cplusplus >= 201103L | 275 # if __cplusplus >= 201103L |
270 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) | 276 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) |
271 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) | 277 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) |
272 # endif | 278 # endif |
273 #endif | 279 #endif |
274 | 280 |
275 #if defined(_MSC_VER) | 281 #if defined(_MSC_VER) |
276 # define V8_CC_MSVC 1 | 282 # define V8_CC_MSVC 1 |
277 # define V8_HAS___ALIGNOF 1 | 283 # define V8_HAS___ALIGNOF 1 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // int foo() WARN_UNUSED_RESULT; | 429 // int foo() WARN_UNUSED_RESULT; |
424 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 430 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
425 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 431 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
426 #else | 432 #else |
427 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 433 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
428 #endif | 434 #endif |
429 | 435 |
430 // clang-format on | 436 // clang-format on |
431 | 437 |
432 #endif // V8CONFIG_H_ | 438 #endif // V8CONFIG_H_ |
OLD | NEW |