Chromium Code Reviews| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 // #if V8_CC_INTEL | 194 // #if V8_CC_INTEL |
| 195 // ... | 195 // ... |
| 196 // #endif | 196 // #endif |
| 197 | 197 |
| 198 #if defined(__clang__) | 198 #if defined(__clang__) |
| 199 | 199 |
| 200 #if defined(__GNUC__) // Clang in gcc mode. | 200 #if defined(__GNUC__) // Clang in gcc mode. |
| 201 # define V8_CC_GNU 1 | 201 # define V8_CC_GNU 1 |
| 202 #elif defined(_MSC_VER) // Clang in cl mode. | 202 #elif defined(_MSC_VER) // Clang in cl mode. |
| 203 # define V8_CC_MSVC 1 | 203 # define V8_CC_MSVC 1 |
| 204 # define V8_HAS_DECLSPEC_SELECTANY 1 | |
| 204 #endif | 205 #endif |
| 205 | 206 |
| 206 // Clang defines __alignof__ as alias for __alignof | 207 // Clang defines __alignof__ as alias for __alignof |
| 207 # define V8_HAS___ALIGNOF 1 | 208 # define V8_HAS___ALIGNOF 1 |
| 208 # define V8_HAS___ALIGNOF__ V8_HAS___ALIGNOF | 209 # define V8_HAS___ALIGNOF__ V8_HAS___ALIGNOF |
| 209 | 210 |
| 210 # define V8_HAS_ATTRIBUTE_ALIGNED (__has_attribute(aligned)) | 211 # define V8_HAS_ATTRIBUTE_ALIGNED (__has_attribute(aligned)) |
| 211 # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) | 212 # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) |
| 212 # define V8_HAS_ATTRIBUTE_DEPRECATED (__has_attribute(deprecated)) | 213 # define V8_HAS_ATTRIBUTE_DEPRECATED (__has_attribute(deprecated)) |
| 213 # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) | 214 # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, | 263 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, |
| 263 // more standardly, by checking whether __cplusplus has a C++11 or greater | 264 // more standardly, by checking whether __cplusplus has a C++11 or greater |
| 264 // value. Current versions of g++ do not correctly set __cplusplus, so we check | 265 // value. Current versions of g++ do not correctly set __cplusplus, so we check |
| 265 // both for forward compatibility. | 266 // both for forward compatibility. |
| 266 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L | 267 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L |
| 267 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) | 268 # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0)) |
| 268 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) | 269 # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0)) |
| 269 # define V8_HAS_CXX11_STATIC_ASSERT (V8_GNUC_PREREQ(4, 3, 0)) | 270 # define V8_HAS_CXX11_STATIC_ASSERT (V8_GNUC_PREREQ(4, 3, 0)) |
| 270 # endif | 271 # endif |
| 271 | 272 |
| 272 #elif defined(_MSC_VER) | 273 #elif defined(_MSC_VER) |
|
Nico
2015/05/20 19:28:22
don't we support all the stuff in here too? Should
hans
2015/05/20 20:21:15
Yeah, that would work.
| |
| 273 | 274 |
| 274 # define V8_CC_MSVC 1 | 275 # define V8_CC_MSVC 1 |
| 275 | 276 |
| 276 # define V8_HAS___ALIGNOF 1 | 277 # define V8_HAS___ALIGNOF 1 |
| 277 | 278 |
| 278 # define V8_HAS_DECLSPEC_ALIGN 1 | 279 # define V8_HAS_DECLSPEC_ALIGN 1 |
| 279 # define V8_HAS_DECLSPEC_DEPRECATED 1 | 280 # define V8_HAS_DECLSPEC_DEPRECATED 1 |
| 280 # define V8_HAS_DECLSPEC_NOINLINE 1 | 281 # define V8_HAS_DECLSPEC_NOINLINE 1 |
| 281 # define V8_HAS_DECLSPEC_SELECTANY 1 | 282 # define V8_HAS_DECLSPEC_SELECTANY 1 |
| 282 | 283 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 // Annotate a function indicating the caller must examine the return value. | 397 // Annotate a function indicating the caller must examine the return value. |
| 397 // Use like: | 398 // Use like: |
| 398 // int foo() WARN_UNUSED_RESULT; | 399 // int foo() WARN_UNUSED_RESULT; |
| 399 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 400 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
| 400 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 401 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
| 401 #else | 402 #else |
| 402 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 403 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
| 403 #endif | 404 #endif |
| 404 | 405 |
| 405 #endif // V8CONFIG_H_ | 406 #endif // V8CONFIG_H_ |
| OLD | NEW |