| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8CONFIG_H_ | 28 #ifndef V8CONFIG_H_ |
| 29 #define V8CONFIG_H_ | 29 #define V8CONFIG_H_ |
| 30 | 30 |
| 31 // Platform headers for feature detection below. | 31 // Platform headers for feature detection below. |
| 32 #if defined(__ANDROID__) | 32 #if defined(__ANDROID__) |
| 33 # include <sys/cdefs.h> | 33 # include <sys/cdefs.h> |
| 34 #elif defined(__APPLE__) | 34 #elif defined(__APPLE__) |
| 35 # include <TargetConditions.h> | 35 # include <TargetConditionals.h> |
| 36 #elif defined(__linux__) | 36 #elif defined(__linux__) |
| 37 # include <features.h> | 37 # include <features.h> |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 | 40 |
| 41 // This macro allows to test for the version of the GNU C library (or | 41 // This macro allows to test for the version of the GNU C library (or |
| 42 // a compatible C library that masquerades as glibc). It evaluates to | 42 // a compatible C library that masquerades as glibc). It evaluates to |
| 43 // 0 if libc is not GNU libc or compatible. | 43 // 0 if libc is not GNU libc or compatible. |
| 44 // Use like: | 44 // Use like: |
| 45 // #if V8_GLIBC_PREREQ(2, 3) | 45 // #if V8_GLIBC_PREREQ(2, 3) |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 # define V8_ALIGNOF(type) __alignof__(type) | 438 # define V8_ALIGNOF(type) __alignof__(type) |
| 439 #else | 439 #else |
| 440 // Note that alignment of a type within a struct can be less than the | 440 // Note that alignment of a type within a struct can be less than the |
| 441 // alignment of the type stand-alone (because of ancient ABIs), so this | 441 // alignment of the type stand-alone (because of ancient ABIs), so this |
| 442 // should only be used as a last resort. | 442 // should only be used as a last resort. |
| 443 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } | 443 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } |
| 444 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) | 444 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) |
| 445 #endif | 445 #endif |
| 446 | 446 |
| 447 #endif // V8CONFIG_H_ | 447 #endif // V8CONFIG_H_ |
| OLD | NEW |