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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // V8_CC_INTEL - Intel C++ | 156 // V8_CC_INTEL - Intel C++ |
157 // V8_CC_MINGW - Minimalist GNU for Windows | 157 // V8_CC_MINGW - Minimalist GNU for Windows |
158 // V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32) | 158 // V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32) |
159 // V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64) | 159 // V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64) |
160 // V8_CC_MSVC - Microsoft Visual C/C++, or clang in cl.exe mode | 160 // V8_CC_MSVC - Microsoft Visual C/C++, or clang in cl.exe mode |
161 // | 161 // |
162 // C++11 feature detection | 162 // C++11 feature detection |
163 // | 163 // |
164 // V8_HAS_CXX11_ALIGNAS - alignas specifier supported | 164 // V8_HAS_CXX11_ALIGNAS - alignas specifier supported |
165 // V8_HAS_CXX11_ALIGNOF - alignof(type) operator supported | 165 // V8_HAS_CXX11_ALIGNOF - alignof(type) operator supported |
166 // V8_HAS_CXX11_STATIC_ASSERT - static_assert() supported | |
167 // | 166 // |
168 // Compiler-specific feature detection | 167 // Compiler-specific feature detection |
169 // | 168 // |
170 // V8_HAS___ALIGNOF - __alignof(type) operator supported | 169 // V8_HAS___ALIGNOF - __alignof(type) operator supported |
171 // V8_HAS___ALIGNOF__ - __alignof__(type) operator supported | 170 // V8_HAS___ALIGNOF__ - __alignof__(type) operator supported |
172 // V8_HAS_ATTRIBUTE_ALIGNED - __attribute__((aligned(n))) supported | 171 // V8_HAS_ATTRIBUTE_ALIGNED - __attribute__((aligned(n))) supported |
173 // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline)) | 172 // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline)) |
174 // supported | 173 // supported |
175 // V8_HAS_ATTRIBUTE_DEPRECATED - __attribute__((deprecated)) supported | 174 // V8_HAS_ATTRIBUTE_DEPRECATED - __attribute__((deprecated)) supported |
176 // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported | 175 // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz)) | 222 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz)) |
224 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) | 223 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) |
225 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) | 224 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) |
226 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) | 225 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) |
227 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) | 226 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) |
228 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) | 227 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) |
229 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) | 228 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) |
230 # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) | 229 # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) |
231 | 230 |
232 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) | 231 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) |
233 # define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert)) | |
234 | 232 |
235 #elif defined(__GNUC__) | 233 #elif defined(__GNUC__) |
236 | 234 |
237 # define V8_CC_GNU 1 | 235 # define V8_CC_GNU 1 |
238 # if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0 | 236 # if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0 |
239 # define V8_CC_INTEL 1 | 237 # define V8_CC_INTEL 1 |
240 # endif | 238 # endif |
241 # if defined(__MINGW32__) | 239 # if defined(__MINGW32__) |
242 # define V8_CC_MINGW32 1 | 240 # define V8_CC_MINGW32 1 |
243 # endif | 241 # endif |
(...skipping 26 matching lines...) Expand all Loading... |
270 | 268 |
271 // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality | 269 // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality |
272 // without warnings (functionality used by the macros below). These modes | 270 // without warnings (functionality used by the macros below). These modes |
273 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, | 271 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, |
274 // more standardly, by checking whether __cplusplus has a C++11 or greater | 272 // more standardly, by checking whether __cplusplus has a C++11 or greater |
275 // value. Current versions of g++ do not correctly set __cplusplus, so we check | 273 // value. Current versions of g++ do not correctly set __cplusplus, so we check |
276 // both for forward compatibility. | 274 // both for forward compatibility. |
277 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L | 275 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L |
278 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) | 276 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) |
279 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) | 277 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) |
280 # define V8_HAS_CXX11_STATIC_ASSERT (V8_GNUC_PREREQ(4, 3, 0)) | |
281 # endif | 278 # endif |
282 #endif | 279 #endif |
283 | 280 |
284 #if defined(_MSC_VER) | 281 #if defined(_MSC_VER) |
285 # define V8_CC_MSVC 1 | 282 # define V8_CC_MSVC 1 |
286 # define V8_HAS___ALIGNOF 1 | 283 # define V8_HAS___ALIGNOF 1 |
287 | 284 |
288 # define V8_HAS_DECLSPEC_ALIGN 1 | 285 # define V8_HAS_DECLSPEC_ALIGN 1 |
289 # define V8_HAS_DECLSPEC_DEPRECATED 1 | 286 # define V8_HAS_DECLSPEC_DEPRECATED 1 |
290 # define V8_HAS_DECLSPEC_NOINLINE 1 | 287 # define V8_HAS_DECLSPEC_NOINLINE 1 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // int foo() WARN_UNUSED_RESULT; | 429 // int foo() WARN_UNUSED_RESULT; |
433 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 430 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
434 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 431 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
435 #else | 432 #else |
436 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 433 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
437 #endif | 434 #endif |
438 | 435 |
439 // clang-format on | 436 // clang-format on |
440 | 437 |
441 #endif // V8CONFIG_H_ | 438 #endif // V8CONFIG_H_ |
OLD | NEW |