| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 #elif V8_HAS___ALIGNOF__ | 414 #elif V8_HAS___ALIGNOF__ |
| 415 # define V8_ALIGNOF(type) __alignof__(type) | 415 # define V8_ALIGNOF(type) __alignof__(type) |
| 416 #else | 416 #else |
| 417 // Note that alignment of a type within a struct can be less than the | 417 // Note that alignment of a type within a struct can be less than the |
| 418 // alignment of the type stand-alone (because of ancient ABIs), so this | 418 // alignment of the type stand-alone (because of ancient ABIs), so this |
| 419 // should only be used as a last resort. | 419 // should only be used as a last resort. |
| 420 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } | 420 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } |
| 421 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) | 421 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) |
| 422 #endif | 422 #endif |
| 423 | 423 |
| 424 // Annotate a function indicating the caller must examine the return value. |
| 425 // Use like: |
| 426 // int foo() WARN_UNUSED_RESULT; |
| 427 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
| 428 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
| 429 #else |
| 430 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
| 431 #endif |
| 432 |
| 424 #endif // V8CONFIG_H_ | 433 #endif // V8CONFIG_H_ |
| OLD | NEW |