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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) | 259 # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) |
260 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ | 260 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ |
261 (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) | 261 (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) |
262 | 262 |
263 # define V8_HAS_BUILTIN_CLZ (V8_GNUC_PREREQ(3, 4, 0)) | 263 # define V8_HAS_BUILTIN_CLZ (V8_GNUC_PREREQ(3, 4, 0)) |
264 # define V8_HAS_BUILTIN_CTZ (V8_GNUC_PREREQ(3, 4, 0)) | 264 # define V8_HAS_BUILTIN_CTZ (V8_GNUC_PREREQ(3, 4, 0)) |
265 # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) | 265 # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) |
266 # define V8_HAS_BUILTIN_FRAME_ADDRESS (V8_GNUC_PREREQ(2, 96, 0)) | 266 # define V8_HAS_BUILTIN_FRAME_ADDRESS (V8_GNUC_PREREQ(2, 96, 0)) |
267 # define V8_HAS_BUILTIN_POPCOUNT (V8_GNUC_PREREQ(3, 4, 0)) | 267 # define V8_HAS_BUILTIN_POPCOUNT (V8_GNUC_PREREQ(3, 4, 0)) |
268 | 268 |
269 // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality | 269 # if __cplusplus >= 201103L |
270 // without warnings (functionality used by the macros below). These modes | |
271 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, | |
272 // more standardly, by checking whether __cplusplus has a C++11 or greater | |
273 // value. Current versions of g++ do not correctly set __cplusplus, so we check | |
274 // both for forward compatibility. | |
275 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L | |
276 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) | 270 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) |
277 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) | 271 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) |
278 # endif | 272 # endif |
279 #endif | 273 #endif |
280 | 274 |
281 #if defined(_MSC_VER) | 275 #if defined(_MSC_VER) |
282 # define V8_CC_MSVC 1 | 276 # define V8_CC_MSVC 1 |
283 # define V8_HAS___ALIGNOF 1 | 277 # define V8_HAS___ALIGNOF 1 |
284 | 278 |
285 # define V8_HAS_DECLSPEC_ALIGN 1 | 279 # define V8_HAS_DECLSPEC_ALIGN 1 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 // int foo() WARN_UNUSED_RESULT; | 423 // int foo() WARN_UNUSED_RESULT; |
430 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 424 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
431 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 425 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
432 #else | 426 #else |
433 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 427 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
434 #endif | 428 #endif |
435 | 429 |
436 // clang-format on | 430 // clang-format on |
437 | 431 |
438 #endif // V8CONFIG_H_ | 432 #endif // V8CONFIG_H_ |
OLD | NEW |