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 165 matching lines...) Loading... |
176 // V8_HAS_ATTRIBUTE_VISIBILITY - __attribute__((visibility)) supported | 176 // V8_HAS_ATTRIBUTE_VISIBILITY - __attribute__((visibility)) supported |
177 // V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT - __attribute__((warn_unused_result)) | 177 // V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT - __attribute__((warn_unused_result)) |
178 // supported | 178 // supported |
179 // V8_HAS_BUILTIN_CLZ - __builtin_clz() supported | 179 // V8_HAS_BUILTIN_CLZ - __builtin_clz() supported |
180 // V8_HAS_BUILTIN_CTZ - __builtin_ctz() supported | 180 // V8_HAS_BUILTIN_CTZ - __builtin_ctz() supported |
181 // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported | 181 // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported |
182 // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported | 182 // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported |
183 // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported | 183 // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported |
184 // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported | 184 // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported |
185 // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported | 185 // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported |
| 186 // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported |
186 // V8_HAS_DECLSPEC_ALIGN - __declspec(align(n)) supported | 187 // V8_HAS_DECLSPEC_ALIGN - __declspec(align(n)) supported |
187 // V8_HAS_DECLSPEC_DEPRECATED - __declspec(deprecated) supported | 188 // V8_HAS_DECLSPEC_DEPRECATED - __declspec(deprecated) supported |
188 // V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported | 189 // V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported |
189 // V8_HAS_DECLSPEC_SELECTANY - __declspec(selectany) supported | 190 // V8_HAS_DECLSPEC_SELECTANY - __declspec(selectany) supported |
190 // V8_HAS___FORCEINLINE - __forceinline supported | 191 // V8_HAS___FORCEINLINE - __forceinline supported |
191 // | 192 // |
192 // Note that testing for compilers and/or features must be done using #if | 193 // Note that testing for compilers and/or features must be done using #if |
193 // not #ifdef. For example, to test for Intel C++ Compiler, use: | 194 // not #ifdef. For example, to test for Intel C++ Compiler, use: |
194 // #if V8_CC_INTEL | 195 // #if V8_CC_INTEL |
195 // ... | 196 // ... |
(...skipping 18 matching lines...) Loading... |
214 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ | 215 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ |
215 (__has_attribute(warn_unused_result)) | 216 (__has_attribute(warn_unused_result)) |
216 | 217 |
217 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz)) | 218 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz)) |
218 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) | 219 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz)) |
219 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) | 220 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) |
220 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) | 221 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) |
221 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) | 222 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) |
222 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) | 223 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) |
223 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) | 224 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) |
| 225 # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) |
224 | 226 |
225 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) | 227 # define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas)) |
226 # define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert)) | 228 # define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert)) |
227 | 229 |
228 #elif defined(__GNUC__) | 230 #elif defined(__GNUC__) |
229 | 231 |
230 # define V8_CC_GNU 1 | 232 # define V8_CC_GNU 1 |
231 // Intel C++ also masquerades as GCC 3.2.0 | 233 // Intel C++ also masquerades as GCC 3.2.0 |
232 # define V8_CC_INTEL (defined(__INTEL_COMPILER)) | 234 # define V8_CC_INTEL (defined(__INTEL_COMPILER)) |
233 # define V8_CC_MINGW32 (defined(__MINGW32__)) | 235 # define V8_CC_MINGW32 (defined(__MINGW32__)) |
(...skipping 170 matching lines...) Loading... |
404 // Annotate a function indicating the caller must examine the return value. | 406 // Annotate a function indicating the caller must examine the return value. |
405 // Use like: | 407 // Use like: |
406 // int foo() WARN_UNUSED_RESULT; | 408 // int foo() WARN_UNUSED_RESULT; |
407 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 409 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
408 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 410 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
409 #else | 411 #else |
410 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 412 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
411 #endif | 413 #endif |
412 | 414 |
413 #endif // V8CONFIG_H_ | 415 #endif // V8CONFIG_H_ |
OLD | NEW |