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 // Platform headers for feature detection below. | 8 // Platform headers for feature detection below. |
9 #if defined(__ANDROID__) | 9 #if defined(__ANDROID__) |
10 # include <sys/cdefs.h> | 10 # include <sys/cdefs.h> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32) | 156 // V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32) |
157 // V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64) | 157 // V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64) |
158 // V8_CC_MSVC - Microsoft Visual C/C++, or clang in cl.exe mode | 158 // V8_CC_MSVC - Microsoft Visual C/C++, or clang in cl.exe mode |
159 // | 159 // |
160 // C++11 feature detection | 160 // C++11 feature detection |
161 // | 161 // |
162 // V8_HAS_CXX11_ALIGNAS - alignas specifier supported | 162 // V8_HAS_CXX11_ALIGNAS - alignas specifier supported |
163 // V8_HAS_CXX11_ALIGNOF - alignof(type) operator supported | 163 // V8_HAS_CXX11_ALIGNOF - alignof(type) operator supported |
164 // V8_HAS_CXX11_STATIC_ASSERT - static_assert() supported | 164 // V8_HAS_CXX11_STATIC_ASSERT - static_assert() supported |
165 // V8_HAS_CXX11_DELETE - deleted functions supported | 165 // V8_HAS_CXX11_DELETE - deleted functions supported |
166 // V8_HAS_CXX11_FINAL - final marker supported | |
167 // V8_HAS_CXX11_OVERRIDE - override marker supported | |
168 // | 166 // |
169 // Compiler-specific feature detection | 167 // Compiler-specific feature detection |
170 // | 168 // |
171 // V8_HAS___ALIGNOF - __alignof(type) operator supported | 169 // V8_HAS___ALIGNOF - __alignof(type) operator supported |
172 // V8_HAS___ALIGNOF__ - __alignof__(type) operator supported | 170 // V8_HAS___ALIGNOF__ - __alignof__(type) operator supported |
173 // V8_HAS_ATTRIBUTE_ALIGNED - __attribute__((aligned(n))) supported | 171 // V8_HAS_ATTRIBUTE_ALIGNED - __attribute__((aligned(n))) supported |
174 // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline)) | 172 // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline)) |
175 // supported | 173 // supported |
176 // V8_HAS_ATTRIBUTE_DEPRECATED - __attribute__((deprecated)) supported | 174 // V8_HAS_ATTRIBUTE_DEPRECATED - __attribute__((deprecated)) supported |
177 // 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... |
224 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) | 222 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) |
225 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) | 223 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) |
226 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) | 224 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) |
227 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) | 225 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) |
228 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) | 226 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) |
229 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) | 227 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) |
230 | 228 |
231 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) | 229 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) |
232 # define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert)) | 230 # define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert)) |
233 # define V8_HAS_CXX11_DELETE (__has_feature(cxx_deleted_functions)) | 231 # define V8_HAS_CXX11_DELETE (__has_feature(cxx_deleted_functions)) |
234 # define V8_HAS_CXX11_FINAL (__has_feature(cxx_override_control)) | |
235 # define V8_HAS_CXX11_OVERRIDE (__has_feature(cxx_override_control)) | |
236 | 232 |
237 #elif defined(__GNUC__) | 233 #elif defined(__GNUC__) |
238 | 234 |
239 # define V8_CC_GNU 1 | 235 # define V8_CC_GNU 1 |
240 // Intel C++ also masquerades as GCC 3.2.0 | 236 // Intel C++ also masquerades as GCC 3.2.0 |
241 # define V8_CC_INTEL (defined(__INTEL_COMPILER)) | 237 # define V8_CC_INTEL (defined(__INTEL_COMPILER)) |
242 # define V8_CC_MINGW32 (defined(__MINGW32__)) | 238 # define V8_CC_MINGW32 (defined(__MINGW32__)) |
243 # define V8_CC_MINGW64 (defined(__MINGW64__)) | 239 # define V8_CC_MINGW64 (defined(__MINGW64__)) |
244 # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) | 240 # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) |
245 | 241 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // Annotate a function indicating the caller must examine the return value. | 428 // Annotate a function indicating the caller must examine the return value. |
433 // Use like: | 429 // Use like: |
434 // int foo() WARN_UNUSED_RESULT; | 430 // int foo() WARN_UNUSED_RESULT; |
435 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 431 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
436 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 432 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
437 #else | 433 #else |
438 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 434 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
439 #endif | 435 #endif |
440 | 436 |
441 #endif // V8CONFIG_H_ | 437 #endif // V8CONFIG_H_ |
OLD | NEW |